diff --git a/applications/solvers/multiphase/driftFluxFoam/UEqn.H b/applications/solvers/multiphase/driftFluxFoam/UEqn.H index 8933a0821c..f8cf3a9b91 100644 --- a/applications/solvers/multiphase/driftFluxFoam/UEqn.H +++ b/applications/solvers/multiphase/driftFluxFoam/UEqn.H @@ -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)))) == diff --git a/applications/solvers/multiphase/driftFluxFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/driftFluxFoam/alphaEqnSubCycle.H index 218ef2d9e0..53da0f1f78 100644 --- a/applications/solvers/multiphase/driftFluxFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/driftFluxFoam/alphaEqnSubCycle.H @@ -13,7 +13,7 @@ surfaceScalarField phir ( - mesh.Sf() & fvc::interpolate(uRelModel.Udm()) + mesh.Sf() & fvc::interpolate(UdmModel.Udm()) ); if (nAlphaSubCycles > 1) diff --git a/applications/solvers/multiphase/driftFluxFoam/createFields.H b/applications/solvers/multiphase/driftFluxFoam/createFields.H index 13a5cf81c0..36c54f8e2b 100644 --- a/applications/solvers/multiphase/driftFluxFoam/createFields.H +++ b/applications/solvers/multiphase/driftFluxFoam/createFields.H @@ -86,7 +86,7 @@ // Relative Velocity // ~~~~~~~~~~~~~~~~~ - autoPtr uRelModelPtr + autoPtr UdmModelPtr ( relativeVelocityModel::New ( @@ -95,7 +95,7 @@ ) ); - relativeVelocityModel& uRelModel(uRelModelPtr()); + relativeVelocityModel& UdmModel(UdmModelPtr()); // Turbulence diff --git a/applications/solvers/multiphase/driftFluxFoam/driftFluxFoam.C b/applications/solvers/multiphase/driftFluxFoam/driftFluxFoam.C index 72a86c6ec1..8912e0f3f6 100644 --- a/applications/solvers/multiphase/driftFluxFoam/driftFluxFoam.C +++ b/applications/solvers/multiphase/driftFluxFoam/driftFluxFoam.C @@ -82,7 +82,7 @@ int main(int argc, char *argv[]) { #include "alphaControls.H" - uRelModel.update(); + UdmModel.correct(); #include "alphaEqnSubCycle.H" diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/general/general.C b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/general/general.C index f39aa74708..4e8801f2ea 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/general/general.C +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/general/general.C @@ -62,11 +62,11 @@ Foam::relativeVelocityModels::general::~general() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -Foam::tmp -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))) diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/general/general.H b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/general/general.H index 34f5247a21..a3e6b7eca0 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/general/general.H +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/general/general.H @@ -89,8 +89,8 @@ public: // Member Functions - //- Relative velocity - virtual tmp Ur() const; + //- Update the diffusion velocity + virtual void correct(); }; diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C index 5b0e51a2db..7f785d32d7 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C @@ -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 Foam::relativeVelocityModel::rho() const { - tmp URel(Ur()); + return alphaC_*rhoC_ + alphaD_*rhoD_; +} - tmp betaC(alphaC_*rhoC_); - tmp betaD(alphaD_*rhoD_); - tmp rhoM(betaC() + betaD()); - tmp Udm = URel()*betaC()/rhoM; - tmp Ucm = Udm() - URel; +tmp 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 + ( + new volSymmTensorField + ( + "tauDm", + betaD*sqr(Udm_) + betaC*sqr(Ucm) + ) + ); } diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.H b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.H index 73277bc3ec..86c9a1987e 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.H +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.H @@ -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 Ur() const = 0; + //- Return the mixture mean density + tmp 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 tauDm() const; - //- Update the stored diffusion velocity and stress - void update(); + //- Update the diffusion velocity + virtual void correct() = 0; }; diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/simple/simple.C b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/simple/simple.C index a8e99b2527..a0d72b753a 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/simple/simple.C +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/simple/simple.C @@ -61,13 +61,9 @@ Foam::relativeVelocityModels::simple::~simple() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -Foam::tmp -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))); } diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/simple/simple.H b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/simple/simple.H index e94f854eee..6ce106e78b 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/simple/simple.H +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/simple/simple.H @@ -86,8 +86,8 @@ public: // Member Functions - //- Relative velocity - virtual tmp Ur() const; + //- Update the diffusion velocity + virtual void correct(); }; diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitWith/limitWith.H b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitWith/limitWith.H index 0c33e74d87..49f8b5e7a8 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitWith/limitWith.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitWith/limitWith.H @@ -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 diff --git a/tutorials/multiphase/driftFluxFoam/ras/dahl/system/fvSchemes b/tutorials/multiphase/driftFluxFoam/ras/dahl/system/fvSchemes index 97d932b344..bc016492ef 100644 --- a/tutorials/multiphase/driftFluxFoam/ras/dahl/system/fvSchemes +++ b/tutorials/multiphase/driftFluxFoam/ras/dahl/system/fvSchemes @@ -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; diff --git a/tutorials/multiphase/driftFluxFoam/ras/mixerVessel2D/system/fvSchemes b/tutorials/multiphase/driftFluxFoam/ras/mixerVessel2D/system/fvSchemes index 97d932b344..bc016492ef 100644 --- a/tutorials/multiphase/driftFluxFoam/ras/mixerVessel2D/system/fvSchemes +++ b/tutorials/multiphase/driftFluxFoam/ras/mixerVessel2D/system/fvSchemes @@ -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; diff --git a/tutorials/multiphase/driftFluxFoam/ras/tank3D/system/fvSchemes b/tutorials/multiphase/driftFluxFoam/ras/tank3D/system/fvSchemes index 179ae7dbf7..1301b3534f 100644 --- a/tutorials/multiphase/driftFluxFoam/ras/tank3D/system/fvSchemes +++ b/tutorials/multiphase/driftFluxFoam/ras/tank3D/system/fvSchemes @@ -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;