surfaceFilmModels::kinematicSingleLayer: Added support for density gradient effects on the hydrostatic pressure
avoiding gradients in the extruded mesh geometry which causes serious errors at corners.
This commit is contained in:
@ -176,9 +176,23 @@ tmp<volScalarField> kinematicSingleLayer::pe()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tmp<volScalarField> kinematicSingleLayer::rhog() const
|
tmp<surfaceScalarField> kinematicSingleLayer::rhog() const
|
||||||
{
|
{
|
||||||
return -rho_*min(nHat() & g_, dimensionedScalar(g_.dimensions(), 0))*VbyA();
|
return
|
||||||
|
fvc::interpolate
|
||||||
|
(
|
||||||
|
max(nHat() & -g_, dimensionedScalar(g_.dimensions(), 0))*VbyA()
|
||||||
|
)*fvc::interpolate(rho_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
tmp<surfaceScalarField> kinematicSingleLayer::gGradRho() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
fvc::interpolate
|
||||||
|
(
|
||||||
|
max(nHat() & -g_, dimensionedScalar(g_.dimensions(), 0))*VbyA()
|
||||||
|
)*fvc::snGrad(rho_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -311,6 +325,8 @@ tmp<Foam::fvVectorMatrix> kinematicSingleLayer::solveMomentum
|
|||||||
|
|
||||||
if (pimple_.momentumPredictor())
|
if (pimple_.momentumPredictor())
|
||||||
{
|
{
|
||||||
|
const surfaceScalarField alphaf(fvc::interpolate(alpha_));
|
||||||
|
|
||||||
solve
|
solve
|
||||||
(
|
(
|
||||||
UEqn
|
UEqn
|
||||||
@ -319,11 +335,12 @@ tmp<Foam::fvVectorMatrix> kinematicSingleLayer::solveMomentum
|
|||||||
(
|
(
|
||||||
constrainFilmField
|
constrainFilmField
|
||||||
(
|
(
|
||||||
fvc::interpolate(alpha_)
|
alphaf
|
||||||
*(
|
*(
|
||||||
(
|
(
|
||||||
fvc::snGrad(pe + pc(), "snGrad(p)")
|
fvc::snGrad(pe + pc(), "snGrad(p)")
|
||||||
+ fvc::interpolate(rhog())*fvc::snGrad(alpha_)
|
+ gGradRho()*alphaf
|
||||||
|
+ rhog()*fvc::snGrad(alpha_)
|
||||||
)*regionMesh().magSf()
|
)*regionMesh().magSf()
|
||||||
- fvc::interpolate(rho_)*(g_ & regionMesh().Sf())
|
- fvc::interpolate(rho_)*(g_ & regionMesh().Sf())
|
||||||
), 0
|
), 0
|
||||||
@ -355,7 +372,7 @@ void kinematicSingleLayer::solveAlpha
|
|||||||
const surfaceScalarField alphaf(fvc::interpolate(alpha_));
|
const surfaceScalarField alphaf(fvc::interpolate(alpha_));
|
||||||
const surfaceScalarField rhof(fvc::interpolate(rho_));
|
const surfaceScalarField rhof(fvc::interpolate(rho_));
|
||||||
const surfaceScalarField alpharAUf(fvc::interpolate(alpha_*rAU));
|
const surfaceScalarField alpharAUf(fvc::interpolate(alpha_*rAU));
|
||||||
const surfaceScalarField rhogf(fvc::interpolate(rhog()));
|
const surfaceScalarField rhogf(rhog());
|
||||||
|
|
||||||
const surfaceScalarField phiu
|
const surfaceScalarField phiu
|
||||||
(
|
(
|
||||||
@ -363,7 +380,10 @@ void kinematicSingleLayer::solveAlpha
|
|||||||
(
|
(
|
||||||
constrainFilmField
|
constrainFilmField
|
||||||
(
|
(
|
||||||
fvc::snGrad(pe + pc(), "snGrad(p)")*regionMesh().magSf()
|
(
|
||||||
|
fvc::snGrad(pe + pc(), "snGrad(p)")
|
||||||
|
+ gGradRho()*alphaf
|
||||||
|
)*regionMesh().magSf()
|
||||||
- rhof*(g_ & regionMesh().Sf()),
|
- rhof*(g_ & regionMesh().Sf()),
|
||||||
0
|
0
|
||||||
)
|
)
|
||||||
|
|||||||
@ -232,7 +232,10 @@ protected:
|
|||||||
virtual void transferPrimaryRegionSourceFields();
|
virtual void transferPrimaryRegionSourceFields();
|
||||||
|
|
||||||
//- Hydrostatic pressure coefficient
|
//- Hydrostatic pressure coefficient
|
||||||
tmp<volScalarField> rhog() const;
|
tmp<surfaceScalarField> rhog() const;
|
||||||
|
|
||||||
|
//- Hydrostatic pressure coefficient gradient
|
||||||
|
tmp<surfaceScalarField> gGradRho() const;
|
||||||
|
|
||||||
//- Capillary pressure
|
//- Capillary pressure
|
||||||
tmp<volScalarField> pc();
|
tmp<volScalarField> pc();
|
||||||
|
|||||||
Reference in New Issue
Block a user