mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
driftFluxFoam: Rationalisation of the handling of Udm and tauDm
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
(
|
||||
fvm::ddt(rho, U)
|
||||
+ fvm::div(rhoPhi, U)
|
||||
+ fvc::div(uRelModel.tau(), "div(phiUkm,Ukm)")
|
||||
+ fvc::div(UdmModel.tauDm())
|
||||
- fvm::laplacian(muEff, U)
|
||||
- fvc::div(muEff*dev2(T(fvc::grad(U))))
|
||||
==
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
surfaceScalarField phir
|
||||
(
|
||||
mesh.Sf() & fvc::interpolate(uRelModel.Udm())
|
||||
mesh.Sf() & fvc::interpolate(UdmModel.Udm())
|
||||
);
|
||||
|
||||
if (nAlphaSubCycles > 1)
|
||||
|
||||
@ -86,7 +86,7 @@
|
||||
// Relative Velocity
|
||||
// ~~~~~~~~~~~~~~~~~
|
||||
|
||||
autoPtr<relativeVelocityModel> uRelModelPtr
|
||||
autoPtr<relativeVelocityModel> UdmModelPtr
|
||||
(
|
||||
relativeVelocityModel::New
|
||||
(
|
||||
@ -95,7 +95,7 @@
|
||||
)
|
||||
);
|
||||
|
||||
relativeVelocityModel& uRelModel(uRelModelPtr());
|
||||
relativeVelocityModel& UdmModel(UdmModelPtr());
|
||||
|
||||
|
||||
// Turbulence
|
||||
|
||||
@ -82,7 +82,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
#include "alphaControls.H"
|
||||
|
||||
uRelModel.update();
|
||||
UdmModel.correct();
|
||||
|
||||
#include "alphaEqnSubCycle.H"
|
||||
|
||||
|
||||
@ -62,11 +62,11 @@ Foam::relativeVelocityModels::general::~general()
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volVectorField>
|
||||
Foam::relativeVelocityModels::general::Ur() const
|
||||
void Foam::relativeVelocityModels::general::correct()
|
||||
{
|
||||
return
|
||||
V0_
|
||||
Udm_ =
|
||||
(rhoC_/rho())
|
||||
*V0_
|
||||
*(
|
||||
exp(-a_*max(alphaD_ - residualAlpha_, scalar(0)))
|
||||
- exp(-a1_*max(alphaD_ - residualAlpha_, scalar(0)))
|
||||
|
||||
@ -89,8 +89,8 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Relative velocity
|
||||
virtual tmp<volVectorField> Ur() const;
|
||||
//- Update the diffusion velocity
|
||||
virtual void correct();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -85,23 +85,6 @@ Foam::relativeVelocityModel::relativeVelocityModel
|
||||
alphaC_.mesh(),
|
||||
dimensionedVector("Udm", dimVelocity, vector::zero),
|
||||
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 * * * * * * * * * * * * * * //
|
||||
|
||||
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<volVectorField> Ucm = Udm() - URel;
|
||||
tmp<volSymmTensorField> Foam::relativeVelocityModel::tauDm() const
|
||||
{
|
||||
volScalarField betaC(alphaC_*rhoC_);
|
||||
volScalarField betaD(alphaD_*rhoD_);
|
||||
|
||||
Udm_ = Udm();
|
||||
tau_ = betaD*sqr(Udm) + betaC*sqr(Ucm);
|
||||
// Calculate the relative velocity of the continuous phase w.r.t the mean
|
||||
volVectorField Ucm(betaD*Udm_/betaC);
|
||||
|
||||
return tmp<volSymmTensorField>
|
||||
(
|
||||
new volSymmTensorField
|
||||
(
|
||||
"tauDm",
|
||||
betaD*sqr(Udm_) + betaC*sqr(Ucm)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -81,10 +81,7 @@ protected:
|
||||
const dimensionedScalar& rhoD_;
|
||||
|
||||
//- Dispersed diffusion velocity
|
||||
volVectorField Udm_;
|
||||
|
||||
//- Stress
|
||||
volSymmTensorField tau_;
|
||||
mutable volVectorField Udm_;
|
||||
|
||||
|
||||
public:
|
||||
@ -127,8 +124,8 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Calculate the relative velocity of the dispersed phase
|
||||
virtual tmp<volVectorField> Ur() const = 0;
|
||||
//- Return the mixture mean density
|
||||
tmp<volScalarField> rho() const;
|
||||
|
||||
//- Return the diffusion velocity of the dispersed phase
|
||||
const volVectorField& Udm() const
|
||||
@ -137,13 +134,10 @@ public:
|
||||
}
|
||||
|
||||
//- Return the stress tensor due to the phase transport
|
||||
const volSymmTensorField& tau() const
|
||||
{
|
||||
return tau_;
|
||||
}
|
||||
tmp<volSymmTensorField> tauDm() const;
|
||||
|
||||
//- Update the stored diffusion velocity and stress
|
||||
void update();
|
||||
//- Update the diffusion velocity
|
||||
virtual void correct() = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -61,13 +61,9 @@ Foam::relativeVelocityModels::simple::~simple()
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volVectorField>
|
||||
Foam::relativeVelocityModels::simple::Ur() const
|
||||
void Foam::relativeVelocityModels::simple::correct()
|
||||
{
|
||||
return
|
||||
V0_
|
||||
*pow(scalar(10), -a_*max(alphaD_, scalar(0)))
|
||||
/max(alphaC_, residualAlpha_);
|
||||
Udm_ = (rhoC_/rho())*V0_*pow(scalar(10), -a_*max(alphaD_, scalar(0)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -86,8 +86,8 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Relative velocity
|
||||
virtual tmp<volVectorField> Ur() const;
|
||||
//- Update the diffusion velocity
|
||||
virtual void correct();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,20 @@ Class
|
||||
|
||||
Description
|
||||
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
|
||||
limitWith.C
|
||||
|
||||
@ -30,7 +30,7 @@ divSchemes
|
||||
default none;
|
||||
|
||||
div(rhoPhi,U) Gauss linearUpwind grad(U);
|
||||
div(phiUkm,Ukm) Gauss linear;
|
||||
div(tauDm) Gauss linear;
|
||||
"div\(phi,alpha.*\)" Gauss vanLeer;
|
||||
"div\(phirb,alpha.*\)" Gauss linear;
|
||||
div(rhoPhi,k) Gauss limitedLinear 1;
|
||||
|
||||
@ -30,7 +30,7 @@ divSchemes
|
||||
default none;
|
||||
|
||||
div(rhoPhi,U) Gauss linearUpwind grad(U);
|
||||
div(phiUkm,Ukm) Gauss linear;
|
||||
div(tauDm) Gauss linear;
|
||||
"div\(phi,alpha.*\)" Gauss vanLeer;
|
||||
"div\(phirb,alpha.*\)" Gauss linear;
|
||||
div(rhoPhi,k) Gauss limitedLinear 1;
|
||||
|
||||
@ -30,7 +30,7 @@ divSchemes
|
||||
default none;
|
||||
|
||||
div(rhoPhi,U) Gauss linearUpwind grad(U);
|
||||
div(phiUkm,Ukm) Gauss linear;
|
||||
div(tauDm) Gauss linear;
|
||||
"div\(phi,alpha.*\)" Gauss vanLeer;
|
||||
"div\(phirb,alpha.*\)" Gauss linear;
|
||||
div(rhoPhi,k) Gauss limitedLinear 1;
|
||||
|
||||
Reference in New Issue
Block a user