diff --git a/applications/solvers/modules/fluid/isothermalFluid/isothermalFluid.C b/applications/solvers/modules/fluid/isothermalFluid/isothermalFluid.C index f43bc2f3e1..93dfa6518f 100644 --- a/applications/solvers/modules/fluid/isothermalFluid/isothermalFluid.C +++ b/applications/solvers/modules/fluid/isothermalFluid/isothermalFluid.C @@ -276,14 +276,27 @@ void Foam::solvers::isothermalFluid::preSolve() fvModels().preUpdateMesh(); + //- Pointer to the vol momentum field + // used for mesh-change to set rhoUf for introduced faces + autoPtr rhoU; + autoPtr rhoU0; + // Store momentum to set rhoUf for introduced faces - if (rhoUf.valid()) + if (mesh.topoChanging()) { rhoU = new volVectorField("rhoU", rho*U); + + if (rhoUf().nOldTimes() > 1) + { + rhoU0 = new volVectorField("rhoU_0", rho.oldTime()*U.oldTime()); + } } // Update the mesh for topology change, mesh to mesh mapping mesh.update(); + + rhoU.clear(); + rhoU0.clear(); } @@ -326,7 +339,6 @@ void Foam::solvers::isothermalFluid::thermophysicalTransportCorrector() void Foam::solvers::isothermalFluid::postSolve() { - rhoU.clear(); divrhoU.clear(); if (!mesh.schemes().steady()) diff --git a/applications/solvers/modules/fluid/isothermalFluid/isothermalFluid.H b/applications/solvers/modules/fluid/isothermalFluid/isothermalFluid.H index f11aeaa1ee..eff45cb6c1 100644 --- a/applications/solvers/modules/fluid/isothermalFluid/isothermalFluid.H +++ b/applications/solvers/modules/fluid/isothermalFluid/isothermalFluid.H @@ -155,10 +155,6 @@ protected: // used to recreate the flux after mesh-change autoPtr rhoUf; - //- Pointer to the vol momentum field - // used for mesh-change to set rhoUf for introduced faces - autoPtr rhoU; - //- Pointer to the vol momentum divergence field // used in correctPhi to ensure the corrected phi has the // same divergence diff --git a/tutorials/modules/multicomponentFluid/aachenBomb/system/fvSolution b/tutorials/modules/multicomponentFluid/aachenBomb/system/fvSolution index 5418324e0e..33a38a08e0 100644 --- a/tutorials/modules/multicomponentFluid/aachenBomb/system/fvSolution +++ b/tutorials/modules/multicomponentFluid/aachenBomb/system/fvSolution @@ -16,18 +16,32 @@ FoamFile solvers { - rho + "rho.*" { - solver PCG; - preconditioner DIC; - tolerance 1e-05; + solver diagonal; + } + + pcorr + { + solver GAMG; + smoother GaussSeidel; + + tolerance 1e-3; + relTol 0; + } + + p + { + solver GAMG; + smoother GaussSeidel; + + tolerance 1e-6; relTol 0.1; } - rhoFinal + pFinal { - $rho; - tolerance 1e-05; + $p; relTol 0; } @@ -35,29 +49,14 @@ solvers { solver smoothSolver; smoother symGaussSeidel; - tolerance 1e-06; - relTol 0.1; - } - p - { - solver GAMG; - tolerance 0; + tolerance 1e-6; relTol 0.1; - smoother GaussSeidel; - } - - pFinal - { - $p; - tolerance 1e-06; - relTol 0; } "(U|k|epsilon)Final" { $U; - tolerance 1e-06; relTol 0; } @@ -65,6 +64,7 @@ solvers { solver PBiCGStab; preconditioner DILU; + tolerance 1e-6; relTol 0.1; }