solvers::isothermalFluid: Improved the consistency, accuracy and stability of the pressure-work term

for moving mesh cases, in both the internal energy and enthalpy equations
This commit is contained in:
Henry Weller
2022-11-17 18:08:59 +00:00
parent 29b82422d7
commit b36d8fca44
11 changed files with 55 additions and 12 deletions

View File

@ -7,7 +7,7 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
hea.name() == "ea"
? mvConvection->fvcDiv(fvc::absolute(phi, rho, U), p/rho)
? fvc::div(fvc::absolute(phi, rho, U), p/rho)
: -dpdt
)
+ thermophysicalTransport.divq(hea)

View File

@ -8,7 +8,7 @@ if (ign.ignited())
+ (fvc::ddt(rho, K) + fvc::div(phi, K))*rho/thermo.rhou()
+ (
heau.name() == "eau"
? mvConvection->fvcDiv(fvc::absolute(phi, rho, U), p/rho)
? fvc::div(fvc::absolute(phi, rho, U), p/rho)
*rho/thermo.rhou()
: -dpdt*rho/thermo.rhou()
)

View File

@ -7,7 +7,7 @@
+ betav*fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
hea.name() == "ea"
? mvConvection->fvcDiv(fvc::absolute(phi, rho, U), p/rho)
? fvc::div(fvc::absolute(phi, rho, U), p/rho)
: -betav*dpdt
)
- fvm::laplacian(Db, hea)

View File

@ -8,7 +8,7 @@ if (ign.ignited())
+ (betav*fvc::ddt(rho, K) + fvc::div(phi, K))*rho/thermo.rhou()
+ (
heau.name() == "eau"
? mvConvection->fvcDiv(fvc::absolute(phi, rho, U), p/rho)
? fvc::div(fvc::absolute(phi, rho, U), p/rho)
*rho/thermo.rhou()
: -betav*dpdt*rho/thermo.rhou()
)

View File

@ -37,7 +37,7 @@ void Foam::solvers::fluid::thermophysicalPredictor()
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
he.name() == "e"
? fvc::div(fvc::absolute(phi, rho, U), p/rho)
? addMotionWork(fvc::div(phi, p/rho))
: -dpdt
)
+ thermophysicalTransport->divq(he)

View File

@ -265,7 +265,7 @@ void Foam::solvers::isothermalFluid::correctBuoyantPressure()
if (mesh.moving())
{
dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
dpdt -= motionWork();
}
}
}

View File

@ -241,7 +241,7 @@ void Foam::solvers::isothermalFluid::correctPressure()
if (mesh.moving())
{
dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
dpdt -= motionWork();
}
}
}

View File

@ -54,6 +54,37 @@ void Foam::solvers::isothermalFluid::continuityErrors()
}
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::solvers::isothermalFluid::motionWork() const
{
return fvc::div
(
fvc::interpolate(rho)*fvc::meshPhi(rho, U),
p/rho,
"div(phi,(p|rho))"
);
}
Foam::tmp<Foam::volScalarField>
Foam::solvers::isothermalFluid::addMotionWork
(
const tmp<volScalarField>& work
) const
{
if (mesh.moving())
{
return work + motionWork();
}
else
{
return work;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::solvers::isothermalFluid::isothermalFluid

View File

@ -193,6 +193,17 @@ private:
void correctBuoyantPressure();
protected:
//- Return the mesh-motion work
// Used to correct dpdt of the enthalpy equation
// or added to the div(Up) term of the internal energy equation
tmp<volScalarField> motionWork() const;
//- Adds the mesh-motion work to the work term provided
tmp<volScalarField> addMotionWork(const tmp<volScalarField>&) const;
public:
//- Runtime type information

View File

@ -51,9 +51,9 @@ void Foam::solvers::multicomponentFluid::thermophysicalPredictor()
fvScalarMatrix YiEqn
(
fvm::ddt(rho, Yi)
+ mvConvection->fvmDiv(phi, Yi)
+ thermophysicalTransport->divj(Yi)
==
+ mvConvection->fvmDiv(phi, Yi)
+ thermophysicalTransport->divj(Yi)
==
reaction->R(Yi)
+ fvModels().source(rho, Yi)
);
@ -79,7 +79,7 @@ void Foam::solvers::multicomponentFluid::thermophysicalPredictor()
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
he.name() == "e"
? mvConvection->fvcDiv(fvc::absolute(phi, rho, U), p/rho)
? addMotionWork(mvConvection->fvcDiv(phi, p/rho))
: -dpdt
)
+ thermophysicalTransport->divq(he)

View File

@ -35,7 +35,8 @@ divSchemes
sludge vanLeer;
".*" upwind;
};
div(phi,K) Gauss limitedLinear 1;
div(phi,K) Gauss upwind;
div(phi,(p|rho)) Gauss upwind;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}