driftFluxFoam: Rationalisation of the handling of Udm and tauDm

This commit is contained in:
Henry
2014-03-05 15:58:23 +00:00
parent 57814d7b85
commit c6bff08bad
14 changed files with 57 additions and 62 deletions

View File

@ -4,7 +4,7 @@
( (
fvm::ddt(rho, U) fvm::ddt(rho, U)
+ fvm::div(rhoPhi, U) + fvm::div(rhoPhi, U)
+ fvc::div(uRelModel.tau(), "div(phiUkm,Ukm)") + fvc::div(UdmModel.tauDm())
- fvm::laplacian(muEff, U) - fvm::laplacian(muEff, U)
- fvc::div(muEff*dev2(T(fvc::grad(U)))) - fvc::div(muEff*dev2(T(fvc::grad(U))))
== ==

View File

@ -13,7 +13,7 @@
surfaceScalarField phir surfaceScalarField phir
( (
mesh.Sf() & fvc::interpolate(uRelModel.Udm()) mesh.Sf() & fvc::interpolate(UdmModel.Udm())
); );
if (nAlphaSubCycles > 1) if (nAlphaSubCycles > 1)

View File

@ -86,7 +86,7 @@
// Relative Velocity // Relative Velocity
// ~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~
autoPtr<relativeVelocityModel> uRelModelPtr autoPtr<relativeVelocityModel> UdmModelPtr
( (
relativeVelocityModel::New relativeVelocityModel::New
( (
@ -95,7 +95,7 @@
) )
); );
relativeVelocityModel& uRelModel(uRelModelPtr()); relativeVelocityModel& UdmModel(UdmModelPtr());
// Turbulence // Turbulence

View File

@ -82,7 +82,7 @@ int main(int argc, char *argv[])
{ {
#include "alphaControls.H" #include "alphaControls.H"
uRelModel.update(); UdmModel.correct();
#include "alphaEqnSubCycle.H" #include "alphaEqnSubCycle.H"

View File

@ -62,11 +62,11 @@ Foam::relativeVelocityModels::general::~general()
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volVectorField> void Foam::relativeVelocityModels::general::correct()
Foam::relativeVelocityModels::general::Ur() const
{ {
return Udm_ =
V0_ (rhoC_/rho())
*V0_
*( *(
exp(-a_*max(alphaD_ - residualAlpha_, scalar(0))) exp(-a_*max(alphaD_ - residualAlpha_, scalar(0)))
- exp(-a1_*max(alphaD_ - residualAlpha_, scalar(0))) - exp(-a1_*max(alphaD_ - residualAlpha_, scalar(0)))

View File

@ -89,8 +89,8 @@ public:
// Member Functions // Member Functions
//- Relative velocity //- Update the diffusion velocity
virtual tmp<volVectorField> Ur() const; virtual void correct();
}; };

View File

@ -85,23 +85,6 @@ Foam::relativeVelocityModel::relativeVelocityModel
alphaC_.mesh(), alphaC_.mesh(),
dimensionedVector("Udm", dimVelocity, vector::zero), dimensionedVector("Udm", dimVelocity, vector::zero),
mixture.U().boundaryField().types() mixture.U().boundaryField().types()
),
tau_
(
IOobject
(
"Udm",
alphaC_.time().timeName(),
alphaC_.mesh()
),
alphaC_.mesh(),
dimensionedSymmTensor
(
"Udm",
sqr(dimVelocity)*dimDensity,
symmTensor::zero
)
) )
{} {}
@ -156,19 +139,28 @@ Foam::relativeVelocityModel::~relativeVelocityModel()
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::relativeVelocityModel::update() tmp<volScalarField> Foam::relativeVelocityModel::rho() const
{ {
tmp<volVectorField> URel(Ur()); return alphaC_*rhoC_ + alphaD_*rhoD_;
}
tmp<volScalarField> betaC(alphaC_*rhoC_);
tmp<volScalarField> betaD(alphaD_*rhoD_);
tmp<volScalarField> rhoM(betaC() + betaD());
tmp<volVectorField> Udm = URel()*betaC()/rhoM; tmp<volSymmTensorField> Foam::relativeVelocityModel::tauDm() const
tmp<volVectorField> Ucm = Udm() - URel; {
volScalarField betaC(alphaC_*rhoC_);
volScalarField betaD(alphaD_*rhoD_);
Udm_ = Udm(); // Calculate the relative velocity of the continuous phase w.r.t the mean
tau_ = betaD*sqr(Udm) + betaC*sqr(Ucm); volVectorField Ucm(betaD*Udm_/betaC);
return tmp<volSymmTensorField>
(
new volSymmTensorField
(
"tauDm",
betaD*sqr(Udm_) + betaC*sqr(Ucm)
)
);
} }

View File

@ -81,10 +81,7 @@ protected:
const dimensionedScalar& rhoD_; const dimensionedScalar& rhoD_;
//- Dispersed diffusion velocity //- Dispersed diffusion velocity
volVectorField Udm_; mutable volVectorField Udm_;
//- Stress
volSymmTensorField tau_;
public: public:
@ -127,8 +124,8 @@ public:
// Member Functions // Member Functions
//- Calculate the relative velocity of the dispersed phase //- Return the mixture mean density
virtual tmp<volVectorField> Ur() const = 0; tmp<volScalarField> rho() const;
//- Return the diffusion velocity of the dispersed phase //- Return the diffusion velocity of the dispersed phase
const volVectorField& Udm() const const volVectorField& Udm() const
@ -137,13 +134,10 @@ public:
} }
//- Return the stress tensor due to the phase transport //- Return the stress tensor due to the phase transport
const volSymmTensorField& tau() const tmp<volSymmTensorField> tauDm() const;
{
return tau_;
}
//- Update the stored diffusion velocity and stress //- Update the diffusion velocity
void update(); virtual void correct() = 0;
}; };

View File

@ -61,13 +61,9 @@ Foam::relativeVelocityModels::simple::~simple()
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volVectorField> void Foam::relativeVelocityModels::simple::correct()
Foam::relativeVelocityModels::simple::Ur() const
{ {
return Udm_ = (rhoC_/rho())*V0_*pow(scalar(10), -a_*max(alphaD_, scalar(0)));
V0_
*pow(scalar(10), -a_*max(alphaD_, scalar(0)))
/max(alphaC_, residualAlpha_);
} }

View File

@ -86,8 +86,8 @@ public:
// Member Functions // Member Functions
//- Relative velocity //- Update the diffusion velocity
virtual tmp<volVectorField> Ur() const; virtual void correct();
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -26,7 +26,20 @@ Class
Description Description
limitWith differencing scheme limits the specified scheme with the limitWith differencing scheme limits the specified scheme with the
specified limiter. limiter provided by another scheme.
Example: limit the LUST scheme using the limiter of the filteredLinear2
scheme for momentum convection
\verbatim
divSchemes
{
.
.
div(phi,U) Gauss limitWith LUST grad(U) filteredLinear2 0.5 0;
.
.
}
\endverbatim
SourceFiles SourceFiles
limitWith.C limitWith.C

View File

@ -30,7 +30,7 @@ divSchemes
default none; default none;
div(rhoPhi,U) Gauss linearUpwind grad(U); div(rhoPhi,U) Gauss linearUpwind grad(U);
div(phiUkm,Ukm) Gauss linear; div(tauDm) Gauss linear;
"div\(phi,alpha.*\)" Gauss vanLeer; "div\(phi,alpha.*\)" Gauss vanLeer;
"div\(phirb,alpha.*\)" Gauss linear; "div\(phirb,alpha.*\)" Gauss linear;
div(rhoPhi,k) Gauss limitedLinear 1; div(rhoPhi,k) Gauss limitedLinear 1;

View File

@ -30,7 +30,7 @@ divSchemes
default none; default none;
div(rhoPhi,U) Gauss linearUpwind grad(U); div(rhoPhi,U) Gauss linearUpwind grad(U);
div(phiUkm,Ukm) Gauss linear; div(tauDm) Gauss linear;
"div\(phi,alpha.*\)" Gauss vanLeer; "div\(phi,alpha.*\)" Gauss vanLeer;
"div\(phirb,alpha.*\)" Gauss linear; "div\(phirb,alpha.*\)" Gauss linear;
div(rhoPhi,k) Gauss limitedLinear 1; div(rhoPhi,k) Gauss limitedLinear 1;

View File

@ -30,7 +30,7 @@ divSchemes
default none; default none;
div(rhoPhi,U) Gauss linearUpwind grad(U); div(rhoPhi,U) Gauss linearUpwind grad(U);
div(phiUkm,Ukm) Gauss linear; div(tauDm) Gauss linear;
"div\(phi,alpha.*\)" Gauss vanLeer; "div\(phi,alpha.*\)" Gauss vanLeer;
"div\(phirb,alpha.*\)" Gauss linear; "div\(phirb,alpha.*\)" Gauss linear;
div(rhoPhi,k) Gauss limitedLinear 1; div(rhoPhi,k) Gauss limitedLinear 1;