better phase field init
This commit is contained in:
parent
af35c194ab
commit
11252ecb38
@ -2777,11 +2777,15 @@ extern "C" void ScaLBL_PhaseField_Init(int *Map, double *Phi, double *Den, doubl
|
||||
|
||||
n = Map[idx];
|
||||
phi = Phi[n];
|
||||
if (phi > 0.f){
|
||||
nA = 1.0; nB = 0.f;
|
||||
if (phi > 1.f){
|
||||
nA = 1.0; nB = 0.f;
|
||||
}
|
||||
else if (phi < -1.f){
|
||||
nB = 1.0; nA = 0.f;
|
||||
}
|
||||
else{
|
||||
nB = 1.0; nA = 0.f;
|
||||
nA=0.5*(phi-1.f);
|
||||
nB=0.5*(phi+1.f);
|
||||
}
|
||||
Den[idx] = nA;
|
||||
Den[Np+idx] = nB;
|
||||
|
16
gpu/Color.cu
16
gpu/Color.cu
@ -3902,12 +3902,16 @@ __global__ void dvc_ScaLBL_PhaseField_Init(int *Map, double *Phi, double *Den, d
|
||||
|
||||
n = Map[idx];
|
||||
phi = Phi[n];
|
||||
if (phi > 0.f){
|
||||
nA = 1.0; nB = 0.f;
|
||||
}
|
||||
else{
|
||||
nB = 1.0; nA = 0.f;
|
||||
}
|
||||
if (phi > 1.f){
|
||||
nA = 1.0; nB = 0.f;
|
||||
}
|
||||
else if (phi < -1.f){
|
||||
nB = 1.0; nA = 0.f;
|
||||
}
|
||||
else{
|
||||
nA=0.5*(phi-1.f);
|
||||
nB=0.5*(phi+1.f);
|
||||
}
|
||||
Den[idx] = nA;
|
||||
Den[Np+idx] = nB;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user