Esempio n. 1
0
void Cconfig::iterate(double time_step)
{ 	
	dt=time_step;
	dt_on_2 = dt/2.;
	dt2_on_2=dt*dt/2.;
	
	predictor();			//motion integration
	
	update_contact();		//find contact and get the force and torque
	sum_force(); 			//sum the force moment of each contact on particle   
	if(simule_thermal_conduction) sum_heat(); 					//Heat transfer 
	
	//AK addition
	if(MELT_SURFTEN){melt_dist();}
	
	cell.rigid_velocity *= 0.0;
	corrector();			//acceleration of particles according to the sum of force/moment they experience
	cell.rigid_velocity /= parameter.total_mass;

// Velocity offset by rigid motion
#pragma omp parallel for num_threads(NTHREADS)	// YG, MPI
	for(int ip=0; ip< P.size(); ip++) 
		P[ip].V -= cell.rigid_velocity;
}
Esempio n. 2
0
void Cconfig::iterate(double time_step)
{ 	
	dt=time_step;
	dt_on_2 = dt/2.;
	dt2_on_2=dt*dt/2.;
	
	predictor();			//motion integration
	
	update_contact();		//find contact and get the force and torque
	sum_force(); 			//sum the force moment of each contact on particle   
	if(simule_thermal_conduction) sum_heat(); 					//Heat transfer 
	
	if(LIQUID_TRANSFER) liquid_transfer();
	
	// water input, controlling water volume
	if(LIQUID_TRANSFER){
	for(int ip=0; ip< P.size(); ip++) 
	{
		// initial
		if(dt==0) P[ip].water_volume = parameter.INITIAL_SATURATION * P[ip].void_volume;
		if(P[ip].X.x[0]>=-0.5 && P[ip].X.x[0]<=0.5)
			P[ip].water_volume = parameter.FIXED_SATURATION * P[ip].void_volume; //exp
		P[ip].saturation = P[ip].water_volume/P[ip].void_volume; // update the saturation of each cell
		if(P[ip].saturation > MAX_SATURATION) P[ip].saturation = MAX_SATURATION; //exp
	}}

	cell.rigid_velocity *= 0.0;
	corrector();			//acceleration of particles according to the sum of force/moment they experience
	cell.rigid_velocity /= parameter.total_mass;
	// Velocity offset by rigid motion
//#pragma omp parallel for num_threads(NTHREADS)	// YG, MPI
//	for(int ip=0; ip< P.size(); ip++) 
//		P[ip].V -= cell.rigid_velocity;

	if(dt==0) {
		for(int ip=0; ip< P.size(); ip++) P[ip].V *= 0.0;}
			
	for(int ip=0; ip< P.size(); ip++) {
		P[ip].V *= (1.0 - 1.0*dt); // Global damping
		P[ip].Ome *= (1.0 - 1.0*dt);
		}
		
	// calculation of global and local water pressure.
	cap_pressure=0;
	for(int ip=0; ip< P.size(); ip++) {
		P[ip].water_pressure = 0.0;}
		
	for(int ic=0;ic<C.size();ic++) if(C[ic].fcap >0) {
//		cap_pressure -= C[ic].fcap * C[ic].dx;
		P[C[ic].A].water_pressure -= C[ic].fcap * C[ic].dx * P[C[ic].A].R /(P[C[ic].A].R+P[C[ic].B].R);
		P[C[ic].B].water_pressure -= C[ic].fcap * C[ic].dx * P[C[ic].B].R /(P[C[ic].A].R+P[C[ic].B].R);
	}
	for(int ip=0; ip< P.size(); ip++) {
// Modified effective stress term with the degree of saturation (micro-scale).
		if(P[ip].voronoi_volume>1.0e-10) P[ip].water_pressure /= (3.0 *P[ip].voronoi_volume);
		P[ip].positive_pressure = 0.0;
		if(P[ip].saturation > 1.0) {
			P[ip].positive_pressure = WATER_K*parameter.SURFACE_TENSION *(P[ip].saturation - 1.0); // positive pressure
			P[ip].water_pressure += P[ip].positive_pressure;
			}
		if(P[ip].saturation>=1.0e-10) P[ip].water_pressure /= P[ip].saturation;
		}
		
	//Overall saturation and pressure
	saturation = 0.0;
//	cap_pressure = 0.0;
	double void_volume=0.0;
	double water_volume=0.0;
	
	for(int ip=0; ip< P.size(); ip++){
		void_volume += P[ip].void_volume;
		water_volume += P[ip].water_volume;
// Modified effective stress term with the degree of saturation (macro-scale).
//		if(P[ip].saturation <= 1.0) cap_pressure -= P[ip].water_pressure * P[ip].water_volume; // modified cap pressure
//			else cap_pressure -= P[ip].water_pressure * P[ip].void_volume;
		cap_pressure -= P[ip].water_pressure * P[ip].saturation *P[ip].voronoi_volume;
	}
	saturation = water_volume / void_volume;
	if(saturation<1.0e-10) saturation = 1.e-10;
	double total_volume = cell.L.x[0]* cell.L.x[1]* cell.L.x[2];
	cap_pressure /= saturation * total_volume;
	water_content = water_volume /total_volume;
}
Esempio n. 3
0
void Cconfig::iterate(double time_step)
{ 	
	dt=time_step;
	dt_on_2 = dt/2.;
	dt2_on_2=dt*dt/2.;
	
	predictor();			//motion integration
	
	update_contact();		//find contact and get the force and torque
	sum_force(); 			//sum the force moment of each contact on particle   
	if(simule_thermal_conduction) sum_heat(); 					//Heat transfer 
	
	if(LIQUID_TRANSFER) liquid_transfer();
	
	// water input, controlling water volume
	if(LIQUID_TRANSFER){

	if(dt==0) flag_wetting = true;

	for(int ip=0; ip< P.size(); ip++) 
	{
		// initial
		if(dt==0) {P[ip].water_volume = parameter.INITIAL_SATURATION * P[ip].void_volume;
			P[ip].water_volume_old = P[ip].water_volume; }

		
		if(P[ip].void_volume <= 1e-3 * P[ip].grain_volume) 
			P[ip].void_volume = 1e-3 * P[ip].grain_volume; // avoid negative Void volume
			
		P[ip].saturation = P[ip].water_volume/P[ip].void_volume; // update the saturation of each cell
		if(P[ip].saturation > MAX_SATURATION) P[ip].saturation = MAX_SATURATION; //exp
	}}
	
	if(!LIQUID_TRANSFER){ // for pre-packing stage
	for(int ip=0; ip< P.size(); ip++) 
	{
		P[ip].saturation = 0.1;
		P[ip].water_volume = 0.1 * P[ip].void_volume; }}

	cell.rigid_velocity *= 0.0;
	corrector();			//acceleration of particles according to the sum of force/moment they experience
	cell.rigid_velocity /= parameter.total_mass;
// Velocity offset by rigid motion
//#pragma omp parallel for num_threads(NTHREADS)	// YG, MPI
	for(int ip=0; ip< P.size(); ip++) 
		P[ip].V -= cell.rigid_velocity;

	if(dt==0) {
		for(int ip=0; ip< P.size(); ip++) P[ip].V *= 0.0;}
			
	for(int ip=0; ip< P.size(); ip++) {
		P[ip].V *= (1.0 - GLOBAL_DAMPING*dt); // Global damping
		P[ip].Ome *= (1.0 - GLOBAL_DAMPING*dt);
		}
		
	// calculation of global and local water pressure.
	for(int ip=0; ip< P.size(); ip++) {
		P[ip].water_pressure = 0.0;}
		
	for(int ic=0;ic<C.size();ic++) if(C[ic].fcap >0) {
		P[C[ic].A].water_pressure -= C[ic].fcap * C[ic].dx * P[C[ic].A].R /(P[C[ic].A].R+P[C[ic].B].R);
		P[C[ic].B].water_pressure -= C[ic].fcap * C[ic].dx * P[C[ic].B].R /(P[C[ic].A].R+P[C[ic].B].R);
	}
	for(int ip=0; ip< P.size(); ip++) {
// Modified effective stress term with the degree of saturation (micro-scale).
		if(P[ip].voronoi_volume>1.0e-10) P[ip].water_pressure /= (3.0 *P[ip].voronoi_volume);
		P[ip].positive_pressure = 0.0;
		if(P[ip].saturation > MAX_SATURATION_AIR && P[ip].saturation < 1.0) {
			P[ip].positive_pressure = 
				AIR_K *(P[ip].saturation - MAX_SATURATION_AIR)/(1.0 - P[ip].saturation); // positive pressure
			P[ip].water_pressure += P[ip].positive_pressure*1.0; // air compression the whole cell experiencing the pressure
			}
		if(P[ip].saturation>=1.0e-10) P[ip].water_pressure /= P[ip].saturation;
	}
		
	//Overall saturation and pressure
	saturation = 0.0;
	cap_pressure = 0.0;
	double void_volume=0.0;
	double water_volume=0.0;
	double total_volume_mid = 0.0;
	
	cap_pressure_mid = 0.0;
	double void_volume_mid=0.0;
	double water_volume_mid=0.0;
	
	for(int ip=0; ip< P.size(); ip++){
		void_volume += P[ip].void_volume;
		water_volume += P[ip].water_volume;
// Modified effective stress term with the degree of saturation (macro-scale).
//		if(P[ip].saturation <= 1.0) cap_pressure -= P[ip].water_pressure * P[ip].water_volume; // modified cap pressure
//			else cap_pressure -= P[ip].water_pressure * P[ip].void_volume;
		cap_pressure -= P[ip].water_pressure * P[ip].saturation *P[ip].voronoi_volume;
		if(P[ip].X.x[1] <= 5.0 && P[ip].X.x[1] >= -5.0){
			void_volume_mid += P[ip].void_volume;
			water_volume_mid += P[ip].water_volume;
			cap_pressure_mid -= P[ip].water_pressure * P[ip].saturation *P[ip].voronoi_volume;
			total_volume_mid += P[ip].voronoi_volume;
		}
	}
	saturation = water_volume / void_volume;
	if(saturation < 1.0e-10) saturation = 1.e-10;
	double total_volume = cell.L.x[0]* cell.L.x[1]* cell.L.x[2];
	cap_pressure /= saturation * total_volume;
	water_content = water_volume /total_volume;
	
	saturation_mid = water_volume_mid / void_volume_mid;
	if(saturation_mid<1.0e-10) saturation_mid = 1.e-10;
	if(total_volume_mid > 0.0){
		cap_pressure_mid /= saturation_mid * total_volume_mid;
		water_content_mid = water_volume_mid /total_volume_mid;
	}
	
	if(saturation >= MAX_SCAN && t>1.0 && flag_wetting)	flag_wetting=false;
	if(saturation <= MIN_SCAN && t>1.0 && !flag_wetting) flag_wetting=true;

}