fvMesh: Separated fvMesh::move() and fvMesh::update()
fvMesh::update() now executes at the beginning of the time-step, before time is incremented and handles topology change, mesh to mesh mapping and redistribution without point motion. Following each of these mesh changes fields are mapped from the previous mesh state to new mesh state in a conservative manner. These mesh changes not occur at most once per time-step. fvMesh::move() is executed after time is incremented and handles point motion mesh morphing during the time-step in an Arbitrary Lagrangian Eulerian approach requiring the mesh motion flux to match the cell volume change. fvMesh::move() can be called any number of times during the time-step to allow iterative update of the coupling between the mesh motion and field solution.
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -106,6 +106,18 @@ int main(int argc, char *argv[])
|
|||||||
#include "compressibleCourantNo.H"
|
#include "compressibleCourantNo.H"
|
||||||
#include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
|
|
||||||
|
fvModels.preUpdateMesh();
|
||||||
|
|
||||||
|
// Store momentum to set rhoUf for introduced faces.
|
||||||
|
autoPtr<volVectorField> rhoU;
|
||||||
|
if (rhoUf.valid())
|
||||||
|
{
|
||||||
|
rhoU = new volVectorField("rhoU", rho*U);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update the mesh for topology change, mesh to mesh mapping
|
||||||
|
mesh.update();
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
|
|
||||||
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
||||||
@ -117,17 +129,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
||||||
{
|
{
|
||||||
// Store momentum to set rhoUf for introduced faces.
|
// Move the mesh
|
||||||
autoPtr<volVectorField> rhoU;
|
mesh.move();
|
||||||
if (rhoUf.valid())
|
|
||||||
{
|
|
||||||
rhoU = new volVectorField("rhoU", rho*U);
|
|
||||||
}
|
|
||||||
|
|
||||||
fvModels.preUpdateMesh();
|
|
||||||
|
|
||||||
// Do any mesh changes
|
|
||||||
mesh.update();
|
|
||||||
|
|
||||||
if (mesh.changing())
|
if (mesh.changing())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -103,6 +103,18 @@ int main(int argc, char *argv[])
|
|||||||
#include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fvModels.preUpdateMesh();
|
||||||
|
|
||||||
|
// Store momentum to set rhoUf for introduced faces.
|
||||||
|
autoPtr<volVectorField> rhoU;
|
||||||
|
if (rhoUf.valid())
|
||||||
|
{
|
||||||
|
rhoU = new volVectorField("rhoU", rho*U);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update the mesh for topology change, mesh to mesh mapping
|
||||||
|
mesh.update();
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
|
|
||||||
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
||||||
@ -127,17 +139,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
||||||
{
|
{
|
||||||
// Store momentum to set rhoUf for introduced faces.
|
// Move the mesh
|
||||||
autoPtr<volVectorField> rhoU;
|
mesh.move();
|
||||||
if (rhoUf.valid())
|
|
||||||
{
|
|
||||||
rhoU = new volVectorField("rhoU", rho*U);
|
|
||||||
}
|
|
||||||
|
|
||||||
fvModels.preUpdateMesh();
|
|
||||||
|
|
||||||
// Do any mesh changes
|
|
||||||
mesh.update();
|
|
||||||
|
|
||||||
if (mesh.changing())
|
if (mesh.changing())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -101,6 +101,18 @@ int main(int argc, char *argv[])
|
|||||||
#include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fvModels.preUpdateMesh();
|
||||||
|
|
||||||
|
// Store momentum to set rhoUf for introduced faces.
|
||||||
|
autoPtr<volVectorField> rhoU;
|
||||||
|
if (rhoUf.valid())
|
||||||
|
{
|
||||||
|
rhoU = new volVectorField("rhoU", rho*U);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update the mesh for topology change, mesh to mesh mapping
|
||||||
|
mesh.update();
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
|
|
||||||
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
||||||
@ -125,17 +137,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
||||||
{
|
{
|
||||||
// Store momentum to set rhoUf for introduced faces.
|
// Move the mesh
|
||||||
autoPtr<volVectorField> rhoU;
|
mesh.move();
|
||||||
if (rhoUf.valid())
|
|
||||||
{
|
|
||||||
rhoU = new volVectorField("rhoU", rho*U);
|
|
||||||
}
|
|
||||||
|
|
||||||
fvModels.preUpdateMesh();
|
|
||||||
|
|
||||||
// Do any mesh changes
|
|
||||||
mesh.update();
|
|
||||||
|
|
||||||
if (mesh.changing())
|
if (mesh.changing())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -74,10 +74,14 @@ int main(int argc, char *argv[])
|
|||||||
if (!LTS)
|
if (!LTS)
|
||||||
{
|
{
|
||||||
#include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
|
|
||||||
|
// Update the mesh for topology change, mesh to mesh mapping
|
||||||
|
mesh.update();
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
|
|
||||||
// Do any mesh changes
|
// Move the mesh
|
||||||
mesh.update();
|
mesh.move();
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Directed interpolation of primitive fields onto faces
|
// --- Directed interpolation of primitive fields onto faces
|
||||||
|
|||||||
@ -99,6 +99,18 @@ int main(int argc, char *argv[])
|
|||||||
#include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fvModels.preUpdateMesh();
|
||||||
|
|
||||||
|
// Store momentum to set rhoUf for introduced faces.
|
||||||
|
autoPtr<volVectorField> rhoU;
|
||||||
|
if (rhoUf.valid())
|
||||||
|
{
|
||||||
|
rhoU = new volVectorField("rhoU", rho*U);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update the mesh for topology change, mesh to mesh mapping
|
||||||
|
mesh.update();
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
|
|
||||||
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
||||||
@ -108,17 +120,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
||||||
{
|
{
|
||||||
// Store momentum to set rhoUf for introduced faces.
|
// Move the mesh
|
||||||
autoPtr<volVectorField> rhoU;
|
mesh.move();
|
||||||
if (rhoUf.valid())
|
|
||||||
{
|
|
||||||
rhoU = new volVectorField("rhoU", rho*U);
|
|
||||||
}
|
|
||||||
|
|
||||||
fvModels.preUpdateMesh();
|
|
||||||
|
|
||||||
// Do any mesh changes
|
|
||||||
mesh.update();
|
|
||||||
|
|
||||||
if (mesh.changing())
|
if (mesh.changing())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -101,6 +101,18 @@ int main(int argc, char *argv[])
|
|||||||
#include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fvModels.preUpdateMesh();
|
||||||
|
|
||||||
|
// Store momentum to set rhoUf for introduced faces.
|
||||||
|
autoPtr<volVectorField> rhoU;
|
||||||
|
if (rhoUf.valid())
|
||||||
|
{
|
||||||
|
rhoU = new volVectorField("rhoU", rho*U);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update the mesh for topology change, mesh to mesh mapping
|
||||||
|
mesh.update();
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
|
|
||||||
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
||||||
@ -124,17 +136,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
||||||
{
|
{
|
||||||
// Store momentum to set rhoUf for introduced faces.
|
// Move the mesh
|
||||||
autoPtr<volVectorField> rhoU;
|
mesh.move();
|
||||||
if (rhoUf.valid())
|
|
||||||
{
|
|
||||||
rhoU = new volVectorField("rhoU", rho*U);
|
|
||||||
}
|
|
||||||
|
|
||||||
fvModels.preUpdateMesh();
|
|
||||||
|
|
||||||
// Do any mesh changes
|
|
||||||
mesh.update();
|
|
||||||
|
|
||||||
if (mesh.changing())
|
if (mesh.changing())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -83,6 +83,11 @@ int main(int argc, char *argv[])
|
|||||||
#include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fvModels.preUpdateMesh();
|
||||||
|
|
||||||
|
// Update the mesh for topology change, mesh to mesh mapping
|
||||||
|
mesh.update();
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
|
|
||||||
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
||||||
@ -92,9 +97,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
||||||
{
|
{
|
||||||
fvModels.preUpdateMesh();
|
// Move the mesh
|
||||||
|
mesh.move();
|
||||||
mesh.update();
|
|
||||||
|
|
||||||
if (mesh.changing())
|
if (mesh.changing())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -107,6 +107,9 @@ int main(int argc, char *argv[])
|
|||||||
#include "CourantNo.H"
|
#include "CourantNo.H"
|
||||||
#include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
|
|
||||||
|
// Update the mesh for topology change, mesh to mesh mapping
|
||||||
|
mesh.update();
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
|
|
||||||
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
||||||
@ -114,7 +117,8 @@ int main(int argc, char *argv[])
|
|||||||
// Store the particle positions
|
// Store the particle positions
|
||||||
clouds.storeGlobalPositions();
|
clouds.storeGlobalPositions();
|
||||||
|
|
||||||
mesh.update();
|
// Move the mesh
|
||||||
|
mesh.move();
|
||||||
|
|
||||||
if (mesh.changing())
|
if (mesh.changing())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -54,14 +54,20 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
while (runTime.loop())
|
while (runTime.run())
|
||||||
{
|
{
|
||||||
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
|
||||||
|
|
||||||
clouds.storeGlobalPositions();
|
clouds.storeGlobalPositions();
|
||||||
|
|
||||||
|
// Update the mesh for topology change, mesh to mesh mapping
|
||||||
mesh.update();
|
mesh.update();
|
||||||
|
|
||||||
|
runTime++;
|
||||||
|
|
||||||
|
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
||||||
|
|
||||||
|
// Move the mesh
|
||||||
|
mesh.move();
|
||||||
|
|
||||||
if (mesh.changing())
|
if (mesh.changing())
|
||||||
{
|
{
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -53,14 +53,19 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
while (runTime.loop())
|
while (runTime.run())
|
||||||
{
|
{
|
||||||
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
|
||||||
|
|
||||||
clouds.storeGlobalPositions();
|
clouds.storeGlobalPositions();
|
||||||
|
|
||||||
mesh.update();
|
mesh.update();
|
||||||
|
|
||||||
|
runTime++;
|
||||||
|
|
||||||
|
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
||||||
|
|
||||||
|
// Move the mesh
|
||||||
|
mesh.move();
|
||||||
|
|
||||||
if (mesh.changing())
|
if (mesh.changing())
|
||||||
{
|
{
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -70,12 +70,15 @@ int main(int argc, char *argv[])
|
|||||||
#include "CourantNo.H"
|
#include "CourantNo.H"
|
||||||
#include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
|
|
||||||
|
// Update the mesh for topology change, mesh to mesh mapping
|
||||||
|
mesh.update();
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
|
|
||||||
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
||||||
|
|
||||||
// Do any mesh changes
|
// Move the mesh
|
||||||
mesh.update();
|
mesh.move();
|
||||||
|
|
||||||
if (mesh.changing() && correctPhi)
|
if (mesh.changing() && correctPhi)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -91,6 +91,26 @@ int main(int argc, char *argv[])
|
|||||||
#include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fvModels.preUpdateMesh();
|
||||||
|
|
||||||
|
// Store divU from the previous mesh so that it can be mapped
|
||||||
|
// and used in correctPhi to ensure the corrected phi has the
|
||||||
|
// same divergence
|
||||||
|
tmp<volScalarField> divU;
|
||||||
|
|
||||||
|
if (correctPhi && mesh.topoChanging())
|
||||||
|
{
|
||||||
|
// Construct and register divU for mapping
|
||||||
|
divU = new volScalarField
|
||||||
|
(
|
||||||
|
"divU0",
|
||||||
|
fvc::div(fvc::absolute(phi, U))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update the mesh for topology change, mesh to mesh mapping
|
||||||
|
mesh.update();
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
|
|
||||||
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
||||||
@ -100,14 +120,9 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
||||||
{
|
{
|
||||||
// Store divU from the previous mesh so that it can be mapped
|
if (correctPhi && !divU.valid())
|
||||||
// and used in correctPhi to ensure the corrected phi has the
|
|
||||||
// same divergence
|
|
||||||
tmp<volScalarField> divU;
|
|
||||||
|
|
||||||
if (correctPhi)
|
|
||||||
{
|
{
|
||||||
// Construct and register divU for mapping
|
// Construct and register divU for correctPhi
|
||||||
divU = new volScalarField
|
divU = new volScalarField
|
||||||
(
|
(
|
||||||
"divU0",
|
"divU0",
|
||||||
@ -115,9 +130,8 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fvModels.preUpdateMesh();
|
// Move the mesh
|
||||||
|
mesh.move();
|
||||||
mesh.update();
|
|
||||||
|
|
||||||
if (mesh.changing())
|
if (mesh.changing())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -89,6 +89,38 @@ int main(int argc, char *argv[])
|
|||||||
#include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fvModels.preUpdateMesh();
|
||||||
|
|
||||||
|
// Store divU from the previous mesh so that it can be mapped
|
||||||
|
// and used in correctPhi to ensure the corrected phi has the
|
||||||
|
// same divergence
|
||||||
|
tmp<volScalarField> divU;
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
correctPhi
|
||||||
|
&& !isType<twoPhaseChangeModels::noPhaseChange>(phaseChange)
|
||||||
|
&& mesh.topoChanging()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
// Construct and register divU for correctPhi
|
||||||
|
divU = new volScalarField
|
||||||
|
(
|
||||||
|
"divU0",
|
||||||
|
fvc::div(fvc::absolute(phi, U))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update the mesh for topology change, mesh to mesh mapping
|
||||||
|
bool topoChanged = mesh.update();
|
||||||
|
|
||||||
|
// Do not apply previous time-step mesh compression flux
|
||||||
|
// if the mesh topology changed
|
||||||
|
if (topoChanged)
|
||||||
|
{
|
||||||
|
talphaPhi1Corr0.clear();
|
||||||
|
}
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
|
|
||||||
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
||||||
@ -98,18 +130,14 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
||||||
{
|
{
|
||||||
// Store divU from the previous mesh so that it can be mapped
|
|
||||||
// and used in correctPhi to ensure the corrected phi has the
|
|
||||||
// same divergence
|
|
||||||
tmp<volScalarField> divU;
|
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
correctPhi
|
correctPhi
|
||||||
&& !isType<twoPhaseChangeModels::noPhaseChange>(phaseChange)
|
&& !isType<twoPhaseChangeModels::noPhaseChange>(phaseChange)
|
||||||
|
&& !divU.valid()
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Construct and register divU for mapping
|
// Construct and register divU for correctPhi
|
||||||
divU = new volScalarField
|
divU = new volScalarField
|
||||||
(
|
(
|
||||||
"divU0",
|
"divU0",
|
||||||
@ -117,19 +145,11 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fvModels.preUpdateMesh();
|
// Move the mesh
|
||||||
|
mesh.move();
|
||||||
mesh.update();
|
|
||||||
|
|
||||||
if (mesh.changing())
|
if (mesh.changing())
|
||||||
{
|
{
|
||||||
// Do not apply previous time-step mesh compression flux
|
|
||||||
// if the mesh topology changed
|
|
||||||
if (mesh.topoChanging())
|
|
||||||
{
|
|
||||||
talphaPhi1Corr0.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
gh = (g & mesh.C()) - ghRef;
|
gh = (g & mesh.C()) - ghRef;
|
||||||
ghf = (g & mesh.Cf()) - ghRef;
|
ghf = (g & mesh.Cf()) - ghRef;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -88,6 +88,11 @@ int main(int argc, char *argv[])
|
|||||||
#include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fvModels.preUpdateMesh();
|
||||||
|
|
||||||
|
// Update the mesh for topology change, mesh to mesh mapping
|
||||||
|
mesh.update();
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
|
|
||||||
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
||||||
@ -97,9 +102,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
||||||
{
|
{
|
||||||
fvModels.preUpdateMesh();
|
// Move the mesh
|
||||||
|
mesh.move();
|
||||||
mesh.update();
|
|
||||||
|
|
||||||
if (mesh.changing())
|
if (mesh.changing())
|
||||||
{
|
{
|
||||||
@ -111,10 +115,10 @@ int main(int argc, char *argv[])
|
|||||||
if (correctPhi)
|
if (correctPhi)
|
||||||
{
|
{
|
||||||
#include "correctPhi.H"
|
#include "correctPhi.H"
|
||||||
|
|
||||||
mixture.correct();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mixture.correct();
|
||||||
|
|
||||||
if (checkMeshCourantNo)
|
if (checkMeshCourantNo)
|
||||||
{
|
{
|
||||||
#include "meshCourantNo.H"
|
#include "meshCourantNo.H"
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -98,7 +98,30 @@ int main(int argc, char *argv[])
|
|||||||
#include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fvModels.preUpdateMesh();
|
||||||
|
|
||||||
|
// Store divU from the previous mesh so that it can be
|
||||||
|
// mapped and used in correctPhi to ensure the corrected phi
|
||||||
|
// has the same divergence
|
||||||
|
tmp<volScalarField> divU;
|
||||||
|
|
||||||
|
if (correctPhi && mesh.topoChanging())
|
||||||
|
{
|
||||||
|
// Construct and register divU for mapping
|
||||||
|
divU = new volScalarField
|
||||||
|
(
|
||||||
|
"divU0",
|
||||||
|
fvc::div
|
||||||
|
(
|
||||||
|
fvc::absolute(phi, fluid.movingPhases()[0].U())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
mesh.update();
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
|
|
||||||
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
||||||
|
|
||||||
// --- Pressure-velocity PIMPLE corrector loop
|
// --- Pressure-velocity PIMPLE corrector loop
|
||||||
@ -131,15 +154,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
||||||
{
|
{
|
||||||
// Store divU from the previous mesh so that it can be
|
if (correctPhi && !divU.valid())
|
||||||
// mapped and used in correctPhi to ensure the corrected phi
|
|
||||||
// has the same divergence
|
|
||||||
tmp<volScalarField> divU;
|
|
||||||
|
|
||||||
if
|
|
||||||
(
|
|
||||||
correctPhi
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
// Construct and register divU for mapping
|
// Construct and register divU for mapping
|
||||||
divU = new volScalarField
|
divU = new volScalarField
|
||||||
@ -152,9 +167,8 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fvModels.preUpdateMesh();
|
// Move the mesh
|
||||||
|
mesh.move();
|
||||||
mesh.update();
|
|
||||||
|
|
||||||
if (mesh.changing())
|
if (mesh.changing())
|
||||||
{
|
{
|
||||||
@ -179,6 +193,8 @@ int main(int argc, char *argv[])
|
|||||||
#include "meshCourantNo.H"
|
#include "meshCourantNo.H"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
divU.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pimple.models())
|
if (pimple.models())
|
||||||
|
|||||||
@ -235,7 +235,7 @@ Foam::phaseSystem::phaseSystem
|
|||||||
phaseModel::iNew(*this, referencePhaseName_)
|
phaseModel::iNew(*this, referencePhaseName_)
|
||||||
),
|
),
|
||||||
|
|
||||||
phi_(calcPhi(phaseModels_)),
|
phi_("phi", calcPhi(phaseModels_)),
|
||||||
|
|
||||||
dpdt_
|
dpdt_
|
||||||
(
|
(
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -75,6 +75,11 @@ int main(int argc, char *argv[])
|
|||||||
#include "alphaCourantNo.H"
|
#include "alphaCourantNo.H"
|
||||||
#include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
|
|
||||||
|
fvModels.preUpdateMesh();
|
||||||
|
|
||||||
|
// Update the mesh for topology change, mesh to mesh mapping
|
||||||
|
mesh.update();
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
|
|
||||||
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
||||||
@ -86,9 +91,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
|
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
|
||||||
|
|
||||||
fvModels.preUpdateMesh();
|
// Move the mesh
|
||||||
|
mesh.move();
|
||||||
mesh.update();
|
|
||||||
|
|
||||||
if (mesh.changing())
|
if (mesh.changing())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -90,6 +90,20 @@ int main(int argc, char *argv[])
|
|||||||
#include "CourantNo.H"
|
#include "CourantNo.H"
|
||||||
#include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
|
|
||||||
|
fvModels.preUpdateMesh();
|
||||||
|
|
||||||
|
const scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
|
||||||
|
|
||||||
|
// Update the mesh for topology change, mesh to mesh mapping
|
||||||
|
const bool topoChanged = mesh.update();
|
||||||
|
|
||||||
|
if (topoChanged)
|
||||||
|
{
|
||||||
|
Info<< "Execution time for mesh.update() = "
|
||||||
|
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
|
||||||
|
<< " s" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
|
|
||||||
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
||||||
@ -99,18 +113,11 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
||||||
{
|
{
|
||||||
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
|
// Move the mesh
|
||||||
|
mesh.move();
|
||||||
fvModels.preUpdateMesh();
|
|
||||||
|
|
||||||
mesh.update();
|
|
||||||
|
|
||||||
if (mesh.changing())
|
if (mesh.changing())
|
||||||
{
|
{
|
||||||
Info<< "Execution time for mesh.update() = "
|
|
||||||
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
|
|
||||||
<< " s" << endl;
|
|
||||||
|
|
||||||
MRF.update();
|
MRF.update();
|
||||||
|
|
||||||
if (correctPhi)
|
if (correctPhi)
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -382,9 +382,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io, const IOobject& dictIO)
|
|||||||
new fvMesh
|
new fvMesh
|
||||||
(
|
(
|
||||||
io,
|
io,
|
||||||
move(newPoints),
|
std::move(newPoints),
|
||||||
move(newFaces),
|
std::move(newFaces),
|
||||||
move(newCells)
|
std::move(newCells)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -95,15 +95,21 @@ int main(int argc, char *argv[])
|
|||||||
pimple.dict().lookupOrDefault<Switch>("moveMeshOuterCorrectors", false)
|
pimple.dict().lookupOrDefault<Switch>("moveMeshOuterCorrectors", false)
|
||||||
);
|
);
|
||||||
|
|
||||||
while (runTime.loop())
|
while (runTime.run())
|
||||||
{
|
{
|
||||||
|
// Update the mesh for topology change, mesh to mesh mapping
|
||||||
|
mesh.update();
|
||||||
|
|
||||||
|
runTime++;
|
||||||
|
|
||||||
Info<< "Time = " << runTime.userTimeName() << endl;
|
Info<< "Time = " << runTime.userTimeName() << endl;
|
||||||
|
|
||||||
while (pimple.loop())
|
while (pimple.loop())
|
||||||
{
|
{
|
||||||
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
if (pimple.firstPimpleIter() || moveMeshOuterCorrectors)
|
||||||
{
|
{
|
||||||
mesh.update();
|
// Move the mesh
|
||||||
|
mesh.move();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -61,7 +61,7 @@ int main(int argc, char *argv[])
|
|||||||
runTime.setDeltaT(t0);
|
runTime.setDeltaT(t0);
|
||||||
runTime++;
|
runTime++;
|
||||||
Info<< "CA = " << runTime.userTimeValue() << endl;
|
Info<< "CA = " << runTime.userTimeValue() << endl;
|
||||||
mesh.update();
|
mesh.move();
|
||||||
}
|
}
|
||||||
|
|
||||||
scalar Vmax = sum(mesh.V().field());
|
scalar Vmax = sum(mesh.V().field());
|
||||||
@ -72,7 +72,7 @@ int main(int argc, char *argv[])
|
|||||||
runTime.setDeltaT(t1);
|
runTime.setDeltaT(t1);
|
||||||
runTime++;
|
runTime++;
|
||||||
Info<< "CA = " << runTime.userTimeValue() << endl;
|
Info<< "CA = " << runTime.userTimeValue() << endl;
|
||||||
mesh.update();
|
mesh.move();
|
||||||
}
|
}
|
||||||
|
|
||||||
scalar Vmin = sum(mesh.V().field());
|
scalar Vmin = sum(mesh.V().field());
|
||||||
|
|||||||
@ -220,6 +220,9 @@ void mixtureKEpsilon<BasicMomentumTransportModel>::correctInletOutlet
|
|||||||
(bf[patchi]).refValue() =
|
(bf[patchi]).refValue() =
|
||||||
refCast<const inletOutletFvPatchScalarField>
|
refCast<const inletOutletFvPatchScalarField>
|
||||||
(refBf[patchi]).refValue();
|
(refBf[patchi]).refValue();
|
||||||
|
|
||||||
|
refCast<inletOutletFvPatchScalarField>
|
||||||
|
(bf[patchi]).phiName() = "phim";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -311,6 +314,7 @@ void mixtureKEpsilon<BasicMomentumTransportModel>::initMixtureFields()
|
|||||||
epsilonBoundaryTypes(epsilonl)
|
epsilonBoundaryTypes(epsilonl)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
correctInletOutlet(epsilonm_(), epsilonl);
|
correctInletOutlet(epsilonm_(), epsilonl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -703,7 +707,6 @@ void mixtureKEpsilon<BasicMomentumTransportModel>::correct()
|
|||||||
fvConstraints.constrain(epsilonm);
|
fvConstraints.constrain(epsilonm);
|
||||||
bound(epsilonm, this->epsilonMin_);
|
bound(epsilonm, this->epsilonMin_);
|
||||||
|
|
||||||
|
|
||||||
// Turbulent kinetic energy equation
|
// Turbulent kinetic energy equation
|
||||||
tmp<fvScalarMatrix> kmEqn
|
tmp<fvScalarMatrix> kmEqn
|
||||||
(
|
(
|
||||||
|
|||||||
@ -171,4 +171,16 @@ void Foam::points0MotionSolver::distribute
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::points0MotionSolver::write() const
|
||||||
|
{
|
||||||
|
if (mesh().topoChanging())
|
||||||
|
{
|
||||||
|
points0_.instance() = mesh().time().timeName();
|
||||||
|
points0_.write();
|
||||||
|
}
|
||||||
|
|
||||||
|
return motionSolver::write();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -115,6 +115,9 @@ public:
|
|||||||
//- Update corresponding to the given distribution map
|
//- Update corresponding to the given distribution map
|
||||||
virtual void distribute(const polyDistributionMap&);
|
virtual void distribute(const polyDistributionMap&);
|
||||||
|
|
||||||
|
//- Write points0 if the mesh topology changed
|
||||||
|
virtual bool write() const;
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
// Member Operators
|
||||||
|
|
||||||
|
|||||||
@ -225,12 +225,6 @@ void Foam::solidBodyMotionSolver::topoChange(const polyTopoChangeMap& map)
|
|||||||
twoDCorrectPoints(newPoints0);
|
twoDCorrectPoints(newPoints0);
|
||||||
|
|
||||||
points0_.transfer(newPoints0);
|
points0_.transfer(newPoints0);
|
||||||
|
|
||||||
// points0 changed - set to write and check-in to database
|
|
||||||
points0_.rename("points0");
|
|
||||||
points0_.writeOpt() = IOobject::AUTO_WRITE;
|
|
||||||
points0_.instance() = mesh().time().timeName();
|
|
||||||
points0_.checkIn();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -157,6 +157,18 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Return the flux-field name
|
||||||
|
const word& phiName() const
|
||||||
|
{
|
||||||
|
return phiName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return access to the flux-field name
|
||||||
|
word& phiName()
|
||||||
|
{
|
||||||
|
return phiName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Update the coefficients associated with the patch field
|
//- Update the coefficients associated with the patch field
|
||||||
virtual void updateCoeffs();
|
virtual void updateCoeffs();
|
||||||
|
|||||||
@ -345,7 +345,7 @@ Foam::fvMesh::fvMesh
|
|||||||
polyMesh
|
polyMesh
|
||||||
(
|
(
|
||||||
io,
|
io,
|
||||||
move(points),
|
std::move(points),
|
||||||
shapes,
|
shapes,
|
||||||
boundaryFaces,
|
boundaryFaces,
|
||||||
boundaryPatchNames,
|
boundaryPatchNames,
|
||||||
@ -391,10 +391,10 @@ Foam::fvMesh::fvMesh
|
|||||||
polyMesh
|
polyMesh
|
||||||
(
|
(
|
||||||
io,
|
io,
|
||||||
move(points),
|
std::move(points),
|
||||||
move(faces),
|
std::move(faces),
|
||||||
move(allOwner),
|
std::move(allOwner),
|
||||||
move(allNeighbour),
|
std::move(allNeighbour),
|
||||||
syncPar
|
syncPar
|
||||||
),
|
),
|
||||||
surfaceInterpolation(*this),
|
surfaceInterpolation(*this),
|
||||||
@ -430,7 +430,14 @@ Foam::fvMesh::fvMesh
|
|||||||
const bool syncPar
|
const bool syncPar
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
polyMesh(io, move(points), move(faces), move(cells), syncPar),
|
polyMesh
|
||||||
|
(
|
||||||
|
io,
|
||||||
|
std::move(points),
|
||||||
|
std::move(faces),
|
||||||
|
std::move(cells),
|
||||||
|
syncPar
|
||||||
|
),
|
||||||
surfaceInterpolation(*this),
|
surfaceInterpolation(*this),
|
||||||
data(static_cast<const objectRegistry&>(*this)),
|
data(static_cast<const objectRegistry&>(*this)),
|
||||||
boundary_(*this),
|
boundary_(*this),
|
||||||
@ -475,44 +482,47 @@ bool Foam::fvMesh::update()
|
|||||||
{
|
{
|
||||||
bool updated = false;
|
bool updated = false;
|
||||||
|
|
||||||
if (curTimeIndex_ < time().timeIndex())
|
const bool hasV00 = V00Ptr_;
|
||||||
|
deleteDemandDrivenData(V00Ptr_);
|
||||||
|
|
||||||
|
if (!hasV00)
|
||||||
{
|
{
|
||||||
const bool hasV00 = V00Ptr_;
|
deleteDemandDrivenData(V0Ptr_);
|
||||||
deleteDemandDrivenData(V00Ptr_);
|
|
||||||
|
|
||||||
if (!hasV00)
|
|
||||||
{
|
|
||||||
deleteDemandDrivenData(V0Ptr_);
|
|
||||||
}
|
|
||||||
|
|
||||||
updated = topoChanger_->update() || updated;
|
|
||||||
|
|
||||||
// Register V0 for distribution
|
|
||||||
if (V0Ptr_)
|
|
||||||
{
|
|
||||||
V0Ptr_->checkIn();
|
|
||||||
}
|
|
||||||
|
|
||||||
updated = distributor_->update() || updated;
|
|
||||||
|
|
||||||
// De-register V0 after distribution
|
|
||||||
if (V0Ptr_)
|
|
||||||
{
|
|
||||||
V0Ptr_->checkOut();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hasV00)
|
|
||||||
{
|
|
||||||
// If V00 had been set reset to the mapped V0 prior to mesh-motion
|
|
||||||
V00();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updated = mover_->update() || updated;
|
updated = topoChanger_->update() || updated;
|
||||||
|
|
||||||
|
// Register V0 for distribution
|
||||||
|
if (V0Ptr_)
|
||||||
|
{
|
||||||
|
V0Ptr_->checkIn();
|
||||||
|
}
|
||||||
|
|
||||||
|
updated = distributor_->update() || updated;
|
||||||
|
|
||||||
|
// De-register V0 after distribution
|
||||||
|
if (V0Ptr_)
|
||||||
|
{
|
||||||
|
V0Ptr_->checkOut();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasV00)
|
||||||
|
{
|
||||||
|
// If V00 had been set reset to the mapped V0 prior to mesh-motion
|
||||||
|
V00();
|
||||||
|
}
|
||||||
|
|
||||||
|
return updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::fvMesh::move()
|
||||||
|
{
|
||||||
|
const bool moved = mover_->update();
|
||||||
|
|
||||||
curTimeIndex_ = time().timeIndex();
|
curTimeIndex_ = time().timeIndex();
|
||||||
|
|
||||||
return updated;
|
return moved;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -374,9 +374,13 @@ public:
|
|||||||
//- Is mesh dynamic
|
//- Is mesh dynamic
|
||||||
virtual bool dynamic() const;
|
virtual bool dynamic() const;
|
||||||
|
|
||||||
//- Update the mesh for both mesh motion and topology change
|
//- Update the mesh for topology change, mesh to mesh mapping
|
||||||
|
// or redistribution
|
||||||
virtual bool update();
|
virtual bool update();
|
||||||
|
|
||||||
|
//- Move the mesh
|
||||||
|
virtual bool move();
|
||||||
|
|
||||||
//- Clear all geometry and addressing
|
//- Clear all geometry and addressing
|
||||||
void clearOut();
|
void clearOut();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -276,10 +276,10 @@ void Foam::singleCellFvMesh::agglomerateMesh
|
|||||||
// actually change the mesh
|
// actually change the mesh
|
||||||
resetPrimitives
|
resetPrimitives
|
||||||
(
|
(
|
||||||
move(boundaryPoints),
|
std::move(boundaryPoints),
|
||||||
move(patchFaces),
|
std::move(patchFaces),
|
||||||
move(owner),
|
std::move(owner),
|
||||||
move(neighbour),
|
std::move(neighbour),
|
||||||
patchSizes,
|
patchSizes,
|
||||||
patchStarts,
|
patchStarts,
|
||||||
true // syncPar
|
true // syncPar
|
||||||
|
|||||||
@ -159,13 +159,11 @@ bool Foam::fvMeshTopoChangers::meshToMesh::update()
|
|||||||
|
|
||||||
bool hasChanged = false;
|
bool hasChanged = false;
|
||||||
|
|
||||||
const scalar userTime0 =
|
const scalar userTime = mesh().time().userTimeValue();
|
||||||
mesh().time().userTimeValue()
|
|
||||||
- mesh().time().timeToUserTime(mesh().time().deltaTValue());
|
|
||||||
|
|
||||||
if (timeIndices_.found((userTime0 + timeDelta_/2)/timeDelta_))
|
if (timeIndices_.found((userTime + timeDelta_/2)/timeDelta_))
|
||||||
{
|
{
|
||||||
const word meshDir = "meshToMesh_" + mesh().time().timeName(userTime0);
|
const word meshDir = "meshToMesh_" + mesh().time().timeName(userTime);
|
||||||
|
|
||||||
Info << "Mapping to mesh " << meshDir << endl;
|
Info << "Mapping to mesh " << meshDir << endl;
|
||||||
|
|
||||||
|
|||||||
@ -31,6 +31,7 @@ boundaryField
|
|||||||
{
|
{
|
||||||
type prghTotalPressure;
|
type prghTotalPressure;
|
||||||
U U.vapor;
|
U U.vapor;
|
||||||
|
phi phi.vapor;
|
||||||
rho thermo:rho.vapor;
|
rho thermo:rho.vapor;
|
||||||
p0 uniform 1e5;
|
p0 uniform 1e5;
|
||||||
value $internalField;
|
value $internalField;
|
||||||
|
|||||||
@ -31,6 +31,7 @@ boundaryField
|
|||||||
{
|
{
|
||||||
type prghTotalPressure;
|
type prghTotalPressure;
|
||||||
U U.vapor;
|
U U.vapor;
|
||||||
|
phi phi.vapor;
|
||||||
rho thermo:rho.vapor;
|
rho thermo:rho.vapor;
|
||||||
p0 uniform 1e5;
|
p0 uniform 1e5;
|
||||||
value $internalField;
|
value $internalField;
|
||||||
|
|||||||
Reference in New Issue
Block a user