further regulate the phase field

This commit is contained in:
Rex Zhe Li 2021-03-25 23:07:01 -04:00
parent e73a466b5f
commit ea64630cc7

View File

@ -161,6 +161,9 @@ extern "C" void ScaLBL_D3Q7_AAodd_FreeLeeModel_PhaseField(int *neighborList, int
fq = hq[nread];
phi += fq;
if (phi > 1.f) phi = 1.0;
if (phi < -1.f) phi = -1.0;
// save the number densities
Den[n] = rhoA + 0.5*(1.0-phi)*(rhoB-rhoA);
@ -207,6 +210,9 @@ extern "C" void ScaLBL_D3Q7_AAeven_FreeLeeModel_PhaseField(int *Map, double *hq,
fq = hq[5*Np+n];
phi += fq;
if (phi > 1.f) phi = 1.0;
if (phi < -1.f) phi = -1.0;
// save the number densities
Den[n] = rhoA + 0.5*(1.0-phi)*(rhoB-rhoA);