Commit 1464c4ff authored by Henry's avatar Henry
Browse files

multiphase (VoF): Added support for general turbulence models

Required the addition of the divDevRhoR function to all incompressible turbulence models
parent ccba3469
surfaceScalarField muEff
(
"muEff",
twoPhaseProperties.muf()
+ fvc::interpolate(rho*turbulence->nut())
);
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, U)
- fvm::laplacian(muEff, U)
//- (fvc::grad(U) & fvc::grad(muf))
- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))
+ turbulence->divDevRhoReff(rho, U)
);
UEqn.relax();
......
surfaceScalarField muEff
(
"muEff",
twoPhaseProperties.muf()
+ fvc::interpolate(rho*turbulence->nut())
);
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(rhoPhi, U)
- fvm::laplacian(muEff, U)
- (fvc::grad(U) & fvc::grad(muEff))
//- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))
+ turbulence->divDevRhoReff(rho, U)
);
UEqn.relax();
......
surfaceScalarField muEff
(
"muEff",
twoPhaseProperties.muf()
+ fvc::interpolate(rho*turbulence->nut())
);
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(rhoPhi, U)
- fvm::laplacian(muEff, U)
- (fvc::grad(U) & fvc::grad(muEff))
//- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))
+ turbulence->divDevRhoReff(rho, U)
);
UEqn.relax();
......
surfaceScalarField muEff
(
"muEff",
twoPhaseProperties->muf()
+ fvc::interpolate(rho*turbulence->nut())
);
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(rhoPhi, U)
- fvm::Sp(fvc::ddt(rho) + fvc::div(rhoPhi), U)
- fvm::laplacian(muEff, U)
- (fvc::grad(U) & fvc::grad(muEff))
//- fvc::div(muEff*(fvc::interpolate(dev2(fvc::grad(U))) & mesh.Sf()))
+ turbulence->divDevRhoReff(rho, U)
);
UEqn.relax();
......
surfaceScalarField muEff
(
"muEff",
mixture.muf()
+ fvc::interpolate(rho*turbulence->nut())
);
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(mixture.rhoPhi(), U)
- fvm::laplacian(muEff, U)
- (fvc::grad(U) & fvc::grad(muEff))
//- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))
+ turbulence->divDevRhoReff(rho, U)
);
UEqn.relax();
......
......@@ -11,7 +11,6 @@
)
- fvm::laplacian(muEff, U, "laplacian(muEff,U)")
- (fvc::grad(U) & fvc::grad(muEff))
//- fvc::div(muEff*dev2(T(fvc::grad(U))))
);
UEqn.relax();
......
surfaceScalarField muEff
(
"muEff",
twoPhaseProperties.muf()
+ fvc::interpolate(rho*turbulence->nut())
);
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(rhoPhi, U)
- fvm::laplacian(muEff, U)
- (fvc::grad(U) & fvc::grad(muEff))
//- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))
+ turbulence->divDevRhoReff(rho, U)
);
UEqn.relax();
......
......@@ -66,14 +66,14 @@ Foam::tmp<Foam::volSymmTensorField> Foam::forces::devRhoReff() const
const compressible::LESModel& les =
obr_.lookupObject<compressible::LESModel>("LESProperties");
return les.devRhoBeff();
return les.devRhoReff();
}
else if (obr_.foundObject<incompressible::LESModel>("LESProperties"))
{
const incompressible::LESModel& les
= obr_.lookupObject<incompressible::LESModel>("LESProperties");
return rho()*les.devBeff();
return rho()*les.devReff();
}
else if (obr_.foundObject<basicThermo>("thermophysicalProperties"))
{
......
......@@ -87,17 +87,34 @@ tmp<volSymmTensorField> GenEddyVisc::B() const
}
tmp<volSymmTensorField> GenEddyVisc::devBeff() const
tmp<volSymmTensorField> GenEddyVisc::devReff() const
{
return -nuEff()*dev(twoSymm(fvc::grad(U())));
}
tmp<fvVectorMatrix> GenEddyVisc::divDevBeff(volVectorField& U) const
tmp<fvVectorMatrix> GenEddyVisc::divDevReff(volVectorField& U) const
{
return
(
- fvm::laplacian(nuEff(), U) - fvc::div(nuEff()*dev(T(fvc::grad(U))))
- fvm::laplacian(nuEff(), U)
- fvc::div(nuEff()*dev(T(fvc::grad(U))))
);
}
tmp<fvVectorMatrix> GenEddyVisc::divDevRhoReff
(
const volScalarField& rho,
volVectorField& U
) const
{
volScalarField muEff("muEff", rho*nuEff());
return
(
- fvm::laplacian(muEff, U)
- fvc::div(muEff*dev(T(fvc::grad(U))))
);
}
......
......@@ -118,11 +118,19 @@ public:
//- Return the effective sub-grid turbulence stress tensor
// including the laminar stress
virtual tmp<volSymmTensorField> devBeff() const;
virtual tmp<volSymmTensorField> devReff() const;
//- Return the deviatoric part of the effective sub-grid
// turbulence stress tensor including the laminar stress
virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const;
virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const;
//- Return the deviatoric part of the effective sub-grid
// turbulence stress tensor including the laminar stress
virtual tmp<fvVectorMatrix> divDevRhoReff
(
const volScalarField& rho,
volVectorField& U
) const;
//- Correct Eddy-Viscosity and related properties
virtual void correct(const tmp<volTensorField>& gradU);
......
......@@ -115,7 +115,7 @@ GenSGSStress::GenSGSStress
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
tmp<volSymmTensorField> GenSGSStress::devBeff() const
tmp<volSymmTensorField> GenSGSStress::devReff() const
{
return tmp<volSymmTensorField>
(
......@@ -135,7 +135,7 @@ tmp<volSymmTensorField> GenSGSStress::devBeff() const
}
tmp<fvVectorMatrix> GenSGSStress::divDevBeff
tmp<fvVectorMatrix> GenSGSStress::divDevReff
(
volVectorField& U
) const
......@@ -164,6 +164,38 @@ tmp<fvVectorMatrix> GenSGSStress::divDevBeff
}
tmp<fvVectorMatrix> GenSGSStress::divDevRhoReff
(
const volScalarField& rho,
volVectorField& U
) const
{
volScalarField muEff("muEff", rho*nuEff());
if (couplingFactor_.value() > 0.0)
{
return
(
fvc::div(rho*B_ + couplingFactor_*rho*nuSgs_*fvc::grad(U))
+ fvc::laplacian
(
(1.0 - couplingFactor_)*rho*nuSgs_, U, "laplacian(muEff,U)"
)
- fvm::laplacian(muEff, U)
);
}
else
{
return
(
fvc::div(rho*B_)
+ fvc::laplacian(rho*nuSgs_, U, "laplacian(muEff,U)")
- fvm::laplacian(muEff, U)
);
}
}
bool GenSGSStress::read()
{
if (LESModel::read())
......
......@@ -128,11 +128,19 @@ public:
//- Return the effective sub-grid turbulence stress tensor
// including the laminar stress
virtual tmp<volSymmTensorField> devBeff() const;
virtual tmp<volSymmTensorField> devReff() const;
//- Returns div(B).
// This is the additional term due to the filtering of the NSE.
virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const;
//- Return the deviatoric part of the effective sub-grid
// turbulence stress tensor including the laminar stress
virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const;
//- Return the deviatoric part of the effective sub-grid
// turbulence stress tensor including the laminar stress
virtual tmp<fvVectorMatrix> divDevRhoReff
(
const volScalarField& rho,
volVectorField& U
) const;
//- Read LESProperties dictionary
virtual bool read();
......
......@@ -202,14 +202,6 @@ public:
//- Return the sub-grid stress tensor.
virtual tmp<volSymmTensorField> B() const = 0;
//- Return the deviatoric part of the effective sub-grid
// turbulence stress tensor including the laminar stress
virtual tmp<volSymmTensorField> devBeff() const = 0;
//- Returns div(dev(Beff)).
// This is the additional term due to the filtering of the NSE.
virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const = 0;
// RAS compatibility functions for the turbulenceModel base class
......@@ -225,18 +217,6 @@ public:
return B();
}
//- Return the effective stress tensor including the laminar stress
virtual tmp<volSymmTensorField> devReff() const
{
return devBeff();
}
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const
{
return divDevBeff(U);
}
//- Correct Eddy-Viscosity and related properties.
// This calls correct(const tmp<volTensorField>& gradU) by supplying
......
......@@ -81,7 +81,7 @@ tmp<volSymmTensorField> Smagorinsky2::B() const
}
tmp<fvVectorMatrix> Smagorinsky2::divDevBeff
tmp<fvVectorMatrix> Smagorinsky2::divDevReff
(
volVectorField& U
) const
......@@ -101,6 +101,28 @@ tmp<fvVectorMatrix> Smagorinsky2::divDevBeff
}
tmp<fvVectorMatrix> Smagorinsky2::divDevRhoReff
(
const volScalarField& rho,
volVectorField& U
) const
{
volTensorField gradU(fvc::grad(U));
volSymmTensorField aniMuEff
(
"muEff",
I*(rho*nuEff()) + (cD2_*rho*delta())*symm(gradU)
);
return
(
- fvm::laplacian(aniMuEff, U)
- fvc::div(rho*nuEff()*dev(T(fvc::grad(U))))
);
}
bool Smagorinsky2::read()
{
if (Smagorinsky::read())
......
......@@ -109,9 +109,17 @@ public:
//- Return B.
virtual tmp<volSymmTensorField> B() const;
//- Returns div(B).
// This is the additional term due to the filtering of the NSE.
virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const;
//- Return the deviatoric part of the effective sub-grid
// turbulence stress tensor including the laminar stress
virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const;
//- Return the deviatoric part of the effective sub-grid
// turbulence stress tensor including the laminar stress
virtual tmp<fvVectorMatrix> divDevRhoReff
(
const volScalarField& rho,
volVectorField& U
) const;
//- Read LESProperties dictionary
virtual bool read();
......
......@@ -338,17 +338,34 @@ tmp<volSymmTensorField> SpalartAllmaras::B() const
}
tmp<volSymmTensorField> SpalartAllmaras::devBeff() const
tmp<volSymmTensorField> SpalartAllmaras::devReff() const
{
return -nuEff()*dev(twoSymm(fvc::grad(U())));
}
tmp<fvVectorMatrix> SpalartAllmaras::divDevBeff(volVectorField& U) const
tmp<fvVectorMatrix> SpalartAllmaras::divDevReff(volVectorField& U) const
{
return
(
- fvm::laplacian(nuEff(), U) - fvc::div(nuEff()*dev(T(fvc::grad(U))))
- fvm::laplacian(nuEff(), U)
- fvc::div(nuEff()*dev(T(fvc::grad(U))))
);
}
tmp<fvVectorMatrix> SpalartAllmaras::divDevRhoReff
(
const volScalarField& rho,
volVectorField& U
) const
{
volScalarField muEff("muEff", rho*nuEff());
return
(
- fvm::laplacian(muEff, U)
- fvc::div(muEff*dev(T(fvc::grad(U))))
);
}
......
......@@ -172,11 +172,19 @@ public:
//- Return the effective sub-grid turbulence stress tensor
// including the laminar stress
virtual tmp<volSymmTensorField> devBeff() const;
virtual tmp<volSymmTensorField> devReff() const;
//- Return the deviatoric part of the divergence of Beff
// i.e. the additional term in the filtered NSE.
virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const;
//- Return the deviatoric part of the effective sub-grid
// turbulence stress tensor including the laminar stress
virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const;
//- Return the deviatoric part of the effective sub-grid
// turbulence stress tensor including the laminar stress
virtual tmp<fvVectorMatrix> divDevRhoReff
(
const volScalarField& rho,
volVectorField& U
) const;
//- Correct nuTilda and related properties
virtual void correct(const tmp<volTensorField>& gradU);
......
......@@ -425,17 +425,34 @@ tmp<volSymmTensorField> kOmegaSSTSAS::B() const
}
tmp<volSymmTensorField> kOmegaSSTSAS::devBeff() const
tmp<volSymmTensorField> kOmegaSSTSAS::devReff() const
{
return -nuEff()*dev(twoSymm(fvc::grad(U())));
}
tmp<fvVectorMatrix> kOmegaSSTSAS::divDevBeff(volVectorField& U) const
tmp<fvVectorMatrix> kOmegaSSTSAS::divDevReff(volVectorField& U) const
{
return
(
- fvm::laplacian(nuEff(), U) - fvc::div(nuEff()*dev(T(fvc::grad(U))))
- fvm::laplacian(nuEff(), U)
- fvc::div(nuEff()*dev(T(fvc::grad(U))))
);
}
tmp<fvVectorMatrix> kOmegaSSTSAS::divDevRhoReff
(
const volScalarField& rho,
volVectorField& U
) const
{
volScalarField muEff("muEff", rho*nuEff());
return
(
- fvm::laplacian(muEff, U)
- fvc::div(muEff*dev(T(fvc::grad(U))))
);
}
......
......@@ -249,11 +249,19 @@ public:
//- Return the effective sub-grid turbulence stress tensor
// including the laminar stress
virtual tmp<volSymmTensorField> devBeff() const;
virtual tmp<volSymmTensorField> devReff() const;
//- Return the deviatoric part of the divergence of Beff
// i.e. the additional term in the filtered NSE.
virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const;
//- Return the deviatoric part of the effective sub-grid
// turbulence stress tensor including the laminar stress
virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const;
//- Return the deviatoric part of the effective sub-grid
// turbulence stress tensor including the laminar stress
virtual tmp<fvVectorMatrix> divDevRhoReff
(
const volScalarField& rho,
volVectorField& U
) const;
//- Solve the turbulence equations (k-w) and correct the turbulence
// viscosity
......
......@@ -136,17 +136,34 @@ tmp<volSymmTensorField> laminar::B() const
}
tmp<volSymmTensorField> laminar::devBeff() const
tmp<volSymmTensorField> laminar::devReff() const
{
return -nu()*dev(twoSymm(fvc::grad(U())));
}
tmp<fvVectorMatrix> laminar::divDevBeff(volVectorField& U) const
tmp<fvVectorMatrix> laminar::divDevReff(volVectorField& U) const
{
return
(
- fvm::laplacian(nu(), U) - fvc::div(nu()*dev(T(fvc::grad(U))))
- fvm::laplacian(nu(), U)
- fvc::div(nu()*dev(T(fvc::grad(U))))
);
}
tmp<fvVectorMatrix> laminar::divDevRhoReff
(
const volScalarField& rho,
volVectorField& U
) const
{
volScalarField muEff("muEff", rho*nuEff());
return
(
- fvm::laplacian(muEff, U)
- fvc::div(muEff*dev(T(fvc::grad(U))))
);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment