foamRun,foamMultiRun: fvModels are now corrected directly

This ensures that all fvModels in all regions are updated before continuity is
predicted in any region so that inter-region mass transfers are included in the
region continuity equations.
This commit is contained in:
Henry Weller
2023-05-17 14:31:11 +01:00
parent b51aaf0464
commit 00cb37652f
14 changed files with 15 additions and 42 deletions

View File

@ -134,6 +134,11 @@ int main(int argc, char *argv[])
solvers[i].moveMesh(); solvers[i].moveMesh();
} }
forAll(solvers, i)
{
solvers[i].fvModels().correct();
}
forAll(solvers, i) forAll(solvers, i)
{ {
solvers[i].prePredictor(); solvers[i].prePredictor();

View File

@ -136,6 +136,7 @@ int main(int argc, char *argv[])
while (pimple.loop()) while (pimple.loop())
{ {
solver.moveMesh(); solver.moveMesh();
solver.fvModels().correct();
solver.prePredictor(); solver.prePredictor();
solver.momentumPredictor(); solver.momentumPredictor();
solver.thermophysicalPredictor(); solver.thermophysicalPredictor();

View File

@ -251,9 +251,7 @@ void Foam::solvers::VoFSolver::preSolve()
void Foam::solvers::VoFSolver::prePredictor() void Foam::solvers::VoFSolver::prePredictor()
{ {}
fvModels().correct();
}
void Foam::solvers::VoFSolver::postSolve() void Foam::solvers::VoFSolver::postSolve()

View File

@ -65,17 +65,6 @@ Foam::solvers::film::~film()
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::solvers::film::prePredictor()
{
isothermalFilm::prePredictor();
if (pimple.predictTransport())
{
thermophysicalTransport->predict();
}
}
void Foam::solvers::film::postCorrector() void Foam::solvers::film::postCorrector()
{ {
isothermalFilm::postCorrector(); isothermalFilm::postCorrector();

View File

@ -92,9 +92,6 @@ public:
// Member Functions // Member Functions
//- Called at the start of the PIMPLE loop
virtual void prePredictor();
//- Construct and solve the energy equation, //- Construct and solve the energy equation,
// convert to temperature // convert to temperature
// and update thermophysical and transport properties // and update thermophysical and transport properties

View File

@ -344,8 +344,6 @@ void Foam::solvers::incompressibleDenseParticleFluid::prePredictor()
).ptr(); ).ptr();
} }
fvModels().correct();
if (pimple.predictTransport()) if (pimple.predictTransport())
{ {
momentumTransport->predict(); momentumTransport->predict();

View File

@ -204,8 +204,6 @@ void Foam::solvers::incompressibleFluid::preSolve()
void Foam::solvers::incompressibleFluid::prePredictor() void Foam::solvers::incompressibleFluid::prePredictor()
{ {
fvModels().correct();
if (pimple.predictTransport()) if (pimple.predictTransport())
{ {
momentumTransport->predict(); momentumTransport->predict();

View File

@ -24,9 +24,9 @@ derivedFvPatchFields/filmSurfaceVelocity/filmSurfaceVelocityFvPatchVectorField.C
filmGaussGrad/filmGaussGrads.C filmGaussGrad/filmGaussGrads.C
contactForce.C contactForce.C
continuityPredictor.C
prePredictor.C prePredictor.C
momentumPredictor.C momentumPredictor.C
predictAlpha.C
correctAlpha.C correctAlpha.C
isothermalFilm.C isothermalFilm.C

View File

@ -30,7 +30,7 @@ License
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::solvers::isothermalFilm::predictAlpha() void Foam::solvers::isothermalFilm::continuityPredictor()
{ {
// Update delta and alpha BCs for time-varying inlets etc. // Update delta and alpha BCs for time-varying inlets etc.
delta_.correctBoundaryConditions(); delta_.correctBoundaryConditions();

View File

@ -203,16 +203,16 @@ private:
//- Correct the cached Courant number //- Correct the cached Courant number
void correctCoNum(); void correctCoNum();
// Solve the explicit continuity equation for the film volume-fraction
// to predict the film thickness
void continuityPredictor();
// Calculate the continuity error caused by limiting alpha // Calculate the continuity error caused by limiting alpha
void correctContinuityError(); void correctContinuityError();
//- Print the continuity errors //- Print the continuity errors
void continuityErrors(); void continuityErrors();
//- Construct the explicit film volume-fraction prediction equation
// and predict the film thickness
void predictAlpha();
//- Update film thickness delta from the film volume-fraction //- Update film thickness delta from the film volume-fraction
void correctDelta(); void correctDelta();

View File

@ -29,11 +29,7 @@ License
void Foam::solvers::isothermalFilm::prePredictor() void Foam::solvers::isothermalFilm::prePredictor()
{ {
predictAlpha(); continuityPredictor();
fvModels().correct();
predictAlpha();
if (pimple.predictTransport()) if (pimple.predictTransport())
{ {

View File

@ -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) 2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -39,8 +39,6 @@ void Foam::solvers::isothermalFluid::prePredictor()
correctDensity(); correctDensity();
} }
fvModels().correct();
if (pimple.predictTransport()) if (pimple.predictTransport())
{ {
momentumTransport->predict(); momentumTransport->predict();

View File

@ -242,11 +242,6 @@ void Foam::solvers::multiphaseEuler::preSolve()
void Foam::solvers::multiphaseEuler::prePredictor() void Foam::solvers::multiphaseEuler::prePredictor()
{ {
if (pimple.models())
{
fvModels().correct();
}
if (pimple.thermophysics() || pimple.flow()) if (pimple.thermophysics() || pimple.flow())
{ {
fluid_.solve(rAUs, rAUfs); fluid_.solve(rAUs, rAUfs);

View File

@ -33,8 +33,6 @@ void Foam::solvers::shockFluid::prePredictor()
correctDensity(); correctDensity();
fvModels().correct();
if (!inviscid && pimple.predictTransport()) if (!inviscid && pimple.predictTransport())
{ {
momentumTransport->predict(); momentumTransport->predict();