reactingEulerFoam: Reorganised continuity error update to avoid fluid properties being recalculated unnecessarily

in particular avoiding IATE being solved a second time after the energy
solution.
This commit is contained in:
Henry Weller
2019-04-25 19:49:53 +01:00
parent 54cb927cee
commit 4cb2466f28
4 changed files with 25 additions and 9 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -219,12 +219,8 @@ Foam::MovingPhaseModel<BasePhaseModel>::~MovingPhaseModel()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class BasePhaseModel>
void Foam::MovingPhaseModel<BasePhaseModel>::correct()
void Foam::MovingPhaseModel<BasePhaseModel>::correctContinuityErrors()
{
BasePhaseModel::correct();
this->fluid().MRF().correctBoundaryVelocity(U_);
volScalarField& rho = this->thermoRef().rho();
continuityErrorFlow_ = fvc::ddt(*this, rho) + fvc::div(alphaRhoPhi_);
@ -233,6 +229,15 @@ void Foam::MovingPhaseModel<BasePhaseModel>::correct()
}
template<class BasePhaseModel>
void Foam::MovingPhaseModel<BasePhaseModel>::correct()
{
BasePhaseModel::correct();
this->fluid().MRF().correctBoundaryVelocity(U_);
correctContinuityErrors();
}
template<class BasePhaseModel>
void Foam::MovingPhaseModel<BasePhaseModel>::correctKinematics()
{
@ -258,6 +263,13 @@ void Foam::MovingPhaseModel<BasePhaseModel>::correctKinematics()
}
template<class BasePhaseModel>
void Foam::MovingPhaseModel<BasePhaseModel>::correctThermo()
{
correctContinuityErrors();
}
template<class BasePhaseModel>
void Foam::MovingPhaseModel<BasePhaseModel>::correctTurbulence()
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -106,6 +106,9 @@ private:
//- Calculate and return the flux field
tmp<surfaceScalarField> phi(const volVectorField& U) const;
//- Correct the continuity errors
void correctContinuityErrors();
public:
@ -131,6 +134,9 @@ public:
//- Correct the kinematics
virtual void correctKinematics();
//- Correct the thermodynamics
virtual void correctThermo();
//- Correct the turbulence
virtual void correctTurbulence();

View File

@ -33,7 +33,6 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++)
}
fluid.correctThermo();
fluid.correct();
}

View File

@ -43,5 +43,4 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++)
}
fluid.correctThermo();
fluid.correct();
}