Improvement of round-off error handling
This commit is contained in:
parent
3fd4fb3793
commit
4d9ab22fbe
1 changed files with 5 additions and 2 deletions
|
@ -8,10 +8,13 @@ if (mesh.moving())
|
||||||
scalar sumV = gSum(V);
|
scalar sumV = gSum(V);
|
||||||
scalar sumV0 = gSum(V0);
|
scalar sumV0 = gSum(V0);
|
||||||
|
|
||||||
scalarField volChange = (1.0 - V0/V)/dt;
|
// Rewrite of mesh motion check based on round-off error problems
|
||||||
|
// Note precision around V and avoiding division with dt
|
||||||
|
// HJ, 4/Oct/2011
|
||||||
|
scalarField volChange = (V - V0)/V;
|
||||||
|
|
||||||
scalarField divFlux =
|
scalarField divFlux =
|
||||||
- fvc::div(mesh.phi())().internalField();
|
- fvc::div(mesh.phi())().internalField()*dt;
|
||||||
|
|
||||||
scalarField conserve = volChange + divFlux;
|
scalarField conserve = volChange + divFlux;
|
||||||
|
|
||||||
|
|
Reference in a new issue