//========================================================================================= // PDE Coupling Newtonian and Viscoelastic fluid using Cahn-Hilliard equation //========================================================================================= // this code is modifyed to involve the effect of red blood cell // phi3 is the volume fraction of clot //1-phi3 is the volume fraction of plasma // phi2*phi3 is the volume fraction of fibrin and platelet //(1-phi2)*phi3 is the volume fraction of red blood cell // phi1*phi2*phi3 is the volume fraction of fibrin //(1-phi1)*phi2*phi3 is the volume fraction of platelet int meshsize=128; int meshcircle = 300; real dt=0.01;//1./real(meshsize)/10.; real Re=2.5e-2; real etaf=1e-1,etap=1e0,etan=1e0,etar=1.e0; // viscosity real beta1=0.2,beta2=0.2,beta3=0.1;// cohesion energy real betae=0.0;// eleasticity real s1,s2,s3; // convex splitting real tau1=1e-4,tau2=1e-4,tau3=1e-4;// mobility real alphanp=1e1,alphanr=1.0; // elasticity diff real alpha=1e0,beta=0.5/3.0,gamma=0.0; // G_1 coffecient real alpha22=1e1,beta22=0.2/3.0; real eps1=0.01,eps2=0.01,eps3=0.01;// surface width real thetas=pi/2.0; //real a=abs(3*alpha-6*alpha*beta)/2.0; s1= abs(3*alpha-6*alpha*beta); s2=5.0; s3=5.0; //real a2=abs(3*alpha22-6*alpha22*beta22)/2.0; //real b=7.0; real eps; // used in SUPG should be update in each time setp real umax=8.88889; real dh=0.3,dl=2.0; func uin=umax*(dh-y)*y; func psi1in=-y; real t; func psi2in=x; real ul2; cout<<"dt is "<< dt<10) //{//delta=6.0*sqrt(2.0)*eps3*(dx(phi03)^2+dy(phi03)^2); delta=sqrt(dx(phi03)^2+dy(phi03)^2); stress=knt*stressn-stresstnorm; //growth=(phi03>=0.01&&phi03=0)*keff*(stress)*(1.0-phi03/phimax)*phi03;//*sqrt(dx(phi03)^2+dy(phi03)^2); growth=(phi03>=0.1&&phi03=4.0)*keff*(stress)*delta*phi03; cout<0.0001)*phi3; tmp=(phi3<0.999&phi3>0.01)*1.0; voltmp=int2d(Th)(tmp); //vophi3=int2d(Th)(tmp*phi3); //vophi30=int2d(Th)(tmp*phi03); //verr3=(vophi30-vophi3-(int1d(Th,2)(u01*phi03) //+int1d(Th,4)(-u01*phi03)))/voltmp; //cout<<"the modify error is : "<< verr3<0.0001)*phi2; tmp=(phi2<0.999&phi2>0.01)*1.0; voltmp=int2d(Th)(tmp); vophi2=int2d(Th)(phi2); //verr2=(vophi20-vophi2-(int1d(Th,2)(u01*phi02) //+int1d(Th,4)(-u01*phi02)))/vol; verr2=(vophi20-vophi2)/voltmp; phi2=phi2+tmp*verr2; phi2=max(min(phi2,1.0),0.0); vophi2=int2d(Th)(phi2); */ // solve the system phi118 /*step3; //vophi10=int2d(Th)(phi1); phi1=max(min(phi1,1.000001),-0.000001); phi1=(phi1>0.0001)*phi1; tmp=(phi1<0.999&phi1>0.01)*1.0; vophi1=int2d(Th)(phi1); //verr1=(vophi10-vophi1-(int1d(Th,2)(u01*phi01) //+int1d(Th,4)(-u01*phi01)))/vol; verr1=(vophi10-vophi1)/voltmp; phi1=phi1+tmp*verr1; phi1=max(min(phi1,1.0),0.0); vophi1=int2d(Th)(phi1); */ //cout<<"the volume of phi1 is "<< vophi1<<" the volume of phi2 is "<