MoDeNa  1.0
Software framework facilitating sequential multi-scale modelling
alphaCorrection.H
Go to the documentation of this file.
1 
13 double gasvalue, foamvalue,alphasum,corrector,foamold,gasold;
14 corrector = 0.0001;
15 forAll(mesh.C(), celli)
16 {
17 
18  gasvalue = alpha1[celli];
19  foamvalue = alpha2[celli];
20 
21  foamold = alpha2.oldTime()[celli];
22  gasold = alpha1.oldTime()[celli];
23  alphasum = gasvalue + foamvalue;
24 
25  while (alphasum > 1.0)
26  {
27  if (gasvalue > foamvalue)
28  {
29  gasvalue = gasvalue - (Foam::mag(gasvalue - gasold))*corrector;
30  }
31  else
32  {
33  foamvalue = foamvalue - (Foam::mag(foamvalue - foamold))*corrector;
34  }
35  }
36 }