Merge branch 'master' of github.com:OpenFOAM/OpenFOAM-2.3.x

This commit is contained in:
mattijs 2014-03-19 10:04:42 +00:00
commit 4ef1b5eeb5
67 changed files with 2592 additions and 344 deletions

View file

@ -17,6 +17,8 @@ if (simple.transonic())
*(fvc::interpolate(HbyA) & mesh.Sf()) *(fvc::interpolate(HbyA) & mesh.Sf())
); );
fvOptions.makeRelative(fvc::interpolate(psi), phid);
surfaceScalarField phic surfaceScalarField phic
( (
"phic", "phic",
@ -61,6 +63,8 @@ else
fvc::interpolate(rho*HbyA) & mesh.Sf() fvc::interpolate(rho*HbyA) & mesh.Sf()
); );
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
closedVolume = adjustPhi(phiHbyA, U, p); closedVolume = adjustPhi(phiHbyA, U, p);
phiHbyA += fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf(); phiHbyA += fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf();

View file

@ -17,6 +17,11 @@
phi, phi,
upwind<scalar>(mesh, phi) upwind<scalar>(mesh, phi)
).fvmDiv(phi, alpha1) ).fvmDiv(phi, alpha1)
);
solve
(
alpha1Eqn
- fv::gaussLaplacianScheme<scalar, scalar> - fv::gaussLaplacianScheme<scalar, scalar>
( (
mesh, mesh,
@ -25,8 +30,6 @@
).fvmLaplacian(fvc::interpolate(mut/rho), alpha1) ).fvmLaplacian(fvc::interpolate(mut/rho), alpha1)
); );
alpha1Eqn.solve();
Info<< "Phase-1 volume fraction = " Info<< "Phase-1 volume fraction = "
<< alpha1.weightedAverage(mesh.Vsc()).value() << alpha1.weightedAverage(mesh.Vsc()).value()
<< " Min(alpha1) = " << min(alpha1).value() << " Min(alpha1) = " << min(alpha1).value()

View file

@ -10,7 +10,7 @@ if (turbulence)
dimensionedScalar epsilon0("epsilon0", epsilon.dimensions(), 0); dimensionedScalar epsilon0("epsilon0", epsilon.dimensions(), 0);
dimensionedScalar epsilonMin("epsilonMin", epsilon.dimensions(), SMALL); dimensionedScalar epsilonMin("epsilonMin", epsilon.dimensions(), SMALL);
volScalarField divU(fvc::div(rhoPhi/fvc::interpolate(rho))); volScalarField divU(fvc::div(phi));
tmp<volTensorField> tgradU = fvc::grad(U); tmp<volTensorField> tgradU = fvc::grad(U);
volScalarField G(mut*(tgradU() && dev(twoSymm(tgradU())))); volScalarField G(mut*(tgradU() && dev(twoSymm(tgradU()))));

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-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -82,14 +82,11 @@ int main(int argc, char *argv[])
{ {
#include "alphaControls.H" #include "alphaControls.H"
if (pimple.firstIter() || alphaOuterCorrectors) twoPhaseProperties.correct();
{
twoPhaseProperties.correct();
#define LTSSOLVE #define LTSSOLVE
#include "alphaEqnSubCycle.H" #include "alphaEqnSubCycle.H"
#undef LTSSOLVE #undef LTSSOLVE
}
turbulence->correct(); turbulence->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-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -86,14 +86,11 @@ int main(int argc, char *argv[])
{ {
#include "alphaControls.H" #include "alphaControls.H"
if (pimple.firstIter() || alphaOuterCorrectors) twoPhaseProperties.correct();
{
twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H" #include "alphaEqnSubCycle.H"
interface.correct(); interface.correct();
#include "zonePhaseVolumes.H" #include "zonePhaseVolumes.H"
}
#include "UEqn.H" #include "UEqn.H"

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-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -132,13 +132,10 @@ int main(int argc, char *argv[])
#include "alphaControls.H" #include "alphaControls.H"
if (pimple.firstIter() || alphaOuterCorrectors) twoPhaseProperties.correct();
{
twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H" #include "alphaEqnSubCycle.H"
interface.correct(); interface.correct();
}
#include "UEqn.H" #include "UEqn.H"

View file

@ -85,13 +85,10 @@ int main(int argc, char *argv[])
{ {
#include "alphaControls.H" #include "alphaControls.H"
if (pimple.firstIter() || alphaOuterCorrectors) twoPhaseProperties.correct();
{
twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H" #include "alphaEqnSubCycle.H"
interface.correct(); interface.correct();
}
#include "UEqn.H" #include "UEqn.H"

View file

@ -1,5 +1,3 @@
#include "alphaControls.H"
if (nAlphaSubCycles > 1) if (nAlphaSubCycles > 1)
{ {
dimensionedScalar totalDeltaT = runTime.deltaT(); dimensionedScalar totalDeltaT = runTime.deltaT();

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-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -79,15 +79,12 @@ int main(int argc, char *argv[])
{ {
#include "alphaControls.H" #include "alphaControls.H"
if (pimple.firstIter() || alphaOuterCorrectors) threePhaseProperties.correct();
{
threePhaseProperties.correct();
#include "alphaEqnsSubCycle.H" #include "alphaEqnsSubCycle.H"
interface.correct(); interface.correct();
#define twoPhaseProperties threePhaseProperties #define twoPhaseProperties threePhaseProperties
}
#include "UEqn.H" #include "UEqn.H"

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-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -88,13 +88,10 @@ int main(int argc, char *argv[])
{ {
#include "alphaControls.H" #include "alphaControls.H"
if (pimple.firstIter() || alphaOuterCorrectors) twoPhaseProperties.correct();
{
twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H" #include "alphaEqnSubCycle.H"
interface.correct(); interface.correct();
}
#include "UEqn.H" #include "UEqn.H"

View file

@ -154,13 +154,10 @@ int main(int argc, char *argv[])
dimensionedScalar("0", dimMass/dimTime, 0) dimensionedScalar("0", dimMass/dimTime, 0)
); );
if (pimple.firstIter() || alphaOuterCorrectors) twoPhaseProperties->correct();
{
twoPhaseProperties->correct();
#include "alphaEqnSubCycle.H" #include "alphaEqnSubCycle.H"
interface.correct(); interface.correct();
}
#include "UEqn.H" #include "UEqn.H"

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-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -100,13 +100,10 @@ int main(int argc, char *argv[])
dimensionedScalar("0", dimMass/dimTime, 0) dimensionedScalar("0", dimMass/dimTime, 0)
); );
if (pimple.firstIter() || alphaOuterCorrectors) twoPhaseProperties->correct();
{
twoPhaseProperties->correct();
#include "alphaEqnSubCycle.H" #include "alphaEqnSubCycle.H"
interface.correct(); interface.correct();
}
#include "UEqn.H" #include "UEqn.H"

View file

@ -23,12 +23,11 @@ volScalarField dragCoeff(fluid.dragCoeff());
+ phase1.turbulence().divDevReff(U1) + phase1.turbulence().divDevReff(U1)
== ==
- fvm::Sp(dragCoeff/rho1, U1) - fvm::Sp(dragCoeff/rho1, U1)
- alpha1*alpha2/rho1 - (
*(
liftForce liftForce
+ wallLubricationForce + wallLubricationForce
+ turbulentDispersionForce + turbulentDispersionForce
) )/rho1
- virtualMassCoeff/rho1 - virtualMassCoeff/rho1
*( *(
fvm::ddt(U1) fvm::ddt(U1)
@ -50,12 +49,11 @@ volScalarField dragCoeff(fluid.dragCoeff());
+ phase2.turbulence().divDevReff(U2) + phase2.turbulence().divDevReff(U2)
== ==
- fvm::Sp(dragCoeff/rho2, U2) - fvm::Sp(dragCoeff/rho2, U2)
+ alpha1*alpha2/rho2 + (
*(
liftForce liftForce
+ wallLubricationForce + wallLubricationForce
+ turbulentDispersionForce + turbulentDispersionForce
) )/rho2
- virtualMassCoeff/rho2 - virtualMassCoeff/rho2
*( *(
fvm::ddt(U2) fvm::ddt(U2)

View file

@ -107,13 +107,11 @@ Foam::tmp<Foam::volScalarField> Foam::dragModel::K() const
return return
0.75 0.75
*CdRe() *CdRe()
*max(pair_.dispersed(), residualAlpha_)
*swarmCorrection_->Cs() *swarmCorrection_->Cs()
*pair_.continuous().rho() *pair_.continuous().rho()
*pair_.continuous().nu() *pair_.continuous().nu()
/( /sqr(pair_.dispersed().d());
max(pair_.continuous(), residualAlpha_)
*sqr(pair_.dispersed().d())
);
} }

View file

@ -134,13 +134,8 @@ public:
virtual tmp<volScalarField> CdRe() const = 0; virtual tmp<volScalarField> CdRe() const = 0;
//- The drag function K used in the momentum equation //- The drag function K used in the momentum equation
// ddt(alpha1*rho1*U1) + ... = ... alpha1*alpha2*K*(U1-U2) // ddt(alpha1*rho1*U1) + ... = ... K*(U1-U2)
// ddt(alpha2*rho2*U2) + ... = ... alpha1*alpha2*K*(U2-U1) // ddt(alpha2*rho2*U2) + ... = ... K*(U2-U1)
// ********************************** NB! *****************************
// for numerical reasons alpha1 and alpha2 has been extracted from the
// drag function K, so you MUST divide K by alpha1*alpha2 when
// implemnting the drag function
// ********************************** NB! *****************************
virtual tmp<volScalarField> K() const; virtual tmp<volScalarField> K() const;
//- Dummy write for regIOobject //- Dummy write for regIOobject

View file

@ -64,7 +64,12 @@ Foam::heatTransferModels::RanzMarshall::K() const
{ {
volScalarField Nu(scalar(2) + 0.6*pair_.Re()*cbrt(pair_.Pr())); volScalarField Nu(scalar(2) + 0.6*pair_.Re()*cbrt(pair_.Pr()));
return 6.0*pair_.continuous().kappa()*Nu/sqr(pair_.dispersed().d()); return
6.0
*max(pair_.dispersed(), residualAlpha_)
*pair_.continuous().kappa()
*Nu
/sqr(pair_.dispersed().d());
} }

View file

@ -47,7 +47,7 @@ namespace heatTransferModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class RanzMarshall Declaration Class RanzMarshall Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class RanzMarshall class RanzMarshall

View file

@ -45,7 +45,8 @@ Foam::heatTransferModel::heatTransferModel
const phasePair& pair const phasePair& pair
) )
: :
pair_(pair) pair_(pair),
residualAlpha_("residualAlpha", dimless, dict.lookup("residualAlpha"))
{} {}

View file

@ -46,7 +46,7 @@ namespace Foam
class phasePair; class phasePair;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class heatTransferModel Declaration Class heatTransferModel Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class heatTransferModel class heatTransferModel
@ -58,6 +58,9 @@ protected:
//- Phase pair //- Phase pair
const phasePair& pair_; const phasePair& pair_;
//- Residual phase fraction
const dimensionedScalar residualAlpha_;
public: public:
@ -112,13 +115,8 @@ public:
// Member Functions // Member Functions
//- The heat transfer function K used in the enthalpy equation //- The heat transfer function K used in the enthalpy equation
// ddt(alpha1*rho1*ha) + ... = ... alpha1*alpha2*K*(Ta - Tb) // ddt(alpha1*rho1*ha) + ... = ... K*(Ta - Tb)
// ddt(alpha2*rho2*hb) + ... = ... alpha1*alpha2*K*(Tb - Ta) // ddt(alpha2*rho2*hb) + ... = ... K*(Tb - Ta)
// ********************************** NB!*****************************
// for numerical reasons alpha1 and alpha2 has been extracted from the
// heat transfer function K, so you MUST divide K by alpha1*alpha2 when
// implementing the heat transfer function
// ********************************** NB!*****************************
virtual tmp<volScalarField> K() const = 0; virtual tmp<volScalarField> K() const = 0;
}; };

View file

@ -62,6 +62,7 @@ Foam::tmp<Foam::volVectorField> Foam::liftModel::F() const
{ {
return return
Cl() Cl()
*pair_.dispersed()
*pair_.continuous().rho() *pair_.continuous().rho()
*( *(
pair_.Ur() ^ fvc::curl(pair_.continuous().U()) pair_.Ur() ^ fvc::curl(pair_.continuous().U())

View file

@ -85,6 +85,7 @@ Foam::turbulentDispersionModels::Gosman::F() const
return return
- 0.75 - 0.75
*drag.CdRe() *drag.CdRe()
*pair_.dispersed()
*pair_.continuous().nu() *pair_.continuous().nu()
*pair_.continuous().turbulence().nut() *pair_.continuous().turbulence().nut()
/( /(

View file

@ -75,6 +75,7 @@ F() const
{ {
return return
- Ctd_ - Ctd_
*pair_.dispersed()
*pair_.continuous().rho() *pair_.continuous().rho()
*pair_.continuous().turbulence().k() *pair_.continuous().turbulence().k()
*fvc::grad(pair_.dispersed()); *fvc::grad(pair_.dispersed());

View file

@ -47,7 +47,7 @@ namespace turbulentDispersionModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class noTurbulentDispersion Declaration Class noTurbulentDispersion Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class noTurbulentDispersion class noTurbulentDispersion

View file

@ -48,7 +48,7 @@ namespace virtualMassModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class constantVirtualMassCoefficient Declaration Class constantVirtualMassCoefficient Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class constantVirtualMassCoefficient class constantVirtualMassCoefficient

View file

@ -47,7 +47,7 @@ namespace virtualMassModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class noVirtualMass Declaration Class noVirtualMass Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class noVirtualMass class noVirtualMass
@ -80,6 +80,7 @@ public:
//- Virtual mass coefficient //- Virtual mass coefficient
virtual tmp<volScalarField> Cvm() const; virtual tmp<volScalarField> Cvm() const;
//- The virtual mass function K used in the momentum equation
virtual tmp<volScalarField> K() const; virtual tmp<volScalarField> K() const;
}; };

View file

@ -72,7 +72,7 @@ Foam::virtualMassModel::~virtualMassModel()
Foam::tmp<Foam::volScalarField> Foam::virtualMassModel::K() const Foam::tmp<Foam::volScalarField> Foam::virtualMassModel::K() const
{ {
return Cvm()*pair_.continuous().rho(); return Cvm()*pair_.dispersed()*pair_.continuous().rho();
} }

View file

@ -47,7 +47,7 @@ namespace Foam
class phasePair; class phasePair;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class virtualMassModel Declaration Class virtualMassModel Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class virtualMassModel class virtualMassModel
@ -120,13 +120,8 @@ public:
virtual tmp<volScalarField> Cvm() const = 0; virtual tmp<volScalarField> Cvm() const = 0;
//- The virtual mass function K used in the momentum equation //- The virtual mass function K used in the momentum equation
// ddt(alpha1*rho1*U1) + ... = ... alpha1*alpha2*K*(DU1_Dt - DU2_Dt) // ddt(alpha1*rho1*U1) + ... = ... K*(DU1_Dt - DU2_Dt)
// ddt(alpha2*rho2*U2) + ... = ... alpha1*alpha2*K*(DU1_Dt - DU2_Dt) // ddt(alpha2*rho2*U2) + ... = ... K*(DU1_Dt - DU2_Dt)
// ********************************** NB! *****************************
// for numerical reasons alpha1 and alpha2 has been extracted from the
// virtual mass function K, so you MUST divide K by alpha1*alpha2 when
// implemnting the virtual mass function
// ********************************** NB! *****************************
virtual tmp<volScalarField> K() const; virtual tmp<volScalarField> K() const;
// Dummy write for regIOobject // Dummy write for regIOobject

View file

@ -79,6 +79,7 @@ Foam::tmp<Foam::volVectorField> Foam::wallLubricationModels::Antal::F() const
dimensionedScalar("zero", dimless/dimLength, 0), dimensionedScalar("zero", dimless/dimLength, 0),
Cw1_/pair_.dispersed().d() + Cw2_/yWall_ Cw1_/pair_.dispersed().d() + Cw2_/yWall_
) )
*pair_.dispersed()
*pair_.continuous().rho() *pair_.continuous().rho()
*magSqr(Ur - (Ur & nWall)*nWall) *magSqr(Ur - (Ur & nWall)*nWall)
*nWall; *nWall;

View file

@ -47,7 +47,7 @@ namespace Foam
class phasePair; class phasePair;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class wallLubricationModel Declaration Class wallLubricationModel Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class wallLubricationModel class wallLubricationModel

View file

@ -163,8 +163,6 @@ Foam::BlendedInterfacialModel<modelType>::K() const
if (model_.valid() || model1In2_.valid() || model2In1_.valid()) if (model_.valid() || model1In2_.valid() || model2In1_.valid())
{ {
x() *= max(pair_.phase1()*pair_.phase2(), blending_.residualAlpha());
correctFixedFluxBCs(x()); correctFixedFluxBCs(x());
} }

View file

@ -40,8 +40,6 @@ Foam::blendingMethod::blendingMethod
( (
const dictionary& dict const dictionary& dict
) )
:
residualAlpha_("residualAlpha", dimless, dict.lookup("residualAlpha"))
{} {}
@ -51,12 +49,4 @@ Foam::blendingMethod::~blendingMethod()
{} {}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
const Foam::dimensionedScalar& Foam::blendingMethod::residualAlpha() const
{
return residualAlpha_;
}
// ************************************************************************* // // ************************************************************************* //

View file

@ -49,14 +49,6 @@ namespace Foam
class blendingMethod class blendingMethod
{ {
protected:
// Protected data
//- Residual phase fraction
const dimensionedScalar residualAlpha_;
public: public:
//- Runtime type information //- Runtime type information
@ -101,9 +93,6 @@ public:
// Member Functions // Member Functions
//- Residual phase fraction
const dimensionedScalar& residualAlpha() const;
//- Factor for first phase //- Factor for first phase
virtual tmp<volScalarField> f1 virtual tmp<volScalarField> f1
( (

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-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -571,7 +571,6 @@ void epsilonWallFunctionFvPatchScalarField::write(Ostream& os) const
{ {
fixedValueFvPatchField<scalar>::write(os); fixedValueFvPatchField<scalar>::write(os);
writeLocalEntries(os); writeLocalEntries(os);
writeEntry("value", os);
} }

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-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -587,7 +587,6 @@ void omegaWallFunctionFvPatchScalarField::write(Ostream& os) const
{ {
fixedValueFvPatchField<scalar>::write(os); fixedValueFvPatchField<scalar>::write(os);
writeLocalEntries(os); writeLocalEntries(os);
writeEntry("value", os);
} }

View file

@ -6,11 +6,6 @@ label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles")));
bool MULESCorr(alphaControls.lookupOrDefault<Switch>("MULESCorr", false)); bool MULESCorr(alphaControls.lookupOrDefault<Switch>("MULESCorr", false));
bool alphaOuterCorrectors
(
alphaControls.lookupOrDefault<Switch>("alphaOuterCorrectors", false)
);
// Apply the compression correction from the previous iteration // Apply the compression correction from the previous iteration
// Improves efficiency for steady-simulations but can only be applied // Improves efficiency for steady-simulations but can only be applied
// once the alpha field is reasonably steady, i.e. fully developed // once the alpha field is reasonably steady, i.e. fully developed

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) 2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,10 +25,10 @@ License
#include "pressureInletOutletVelocityFvPatchVectorField.H" #include "pressureInletOutletVelocityFvPatchVectorField.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::pressureInletOutletVelocityFvPatchVectorField:: Foam::pressureInletOutletVelocityFvPatchVectorField::
@ -38,14 +38,12 @@ pressureInletOutletVelocityFvPatchVectorField
const DimensionedField<vector, volMesh>& iF const DimensionedField<vector, volMesh>& iF
) )
: :
mixedFvPatchVectorField(p, iF), directionMixedFvPatchVectorField(p, iF),
phiName_("phi"), phiName_("phi")
rhoName_("rho"),
applyTangentialVelocity_(false)
{ {
refValue() = *this; refValue() = vector::zero;
refGrad() = vector::zero; refGrad() = vector::zero;
valueFraction() = 0.0; valueFraction() = symmTensor::zero;
} }
@ -58,12 +56,10 @@ pressureInletOutletVelocityFvPatchVectorField
const fvPatchFieldMapper& mapper const fvPatchFieldMapper& mapper
) )
: :
mixedFvPatchVectorField(ptf, p, iF, mapper), directionMixedFvPatchVectorField(ptf, p, iF, mapper),
phiName_(ptf.phiName_), phiName_(ptf.phiName_)
rhoName_(ptf.rhoName_),
applyTangentialVelocity_(ptf.applyTangentialVelocity_)
{ {
if (applyTangentialVelocity_) if (ptf.tangentialVelocity_.size())
{ {
tangentialVelocity_ = mapper(ptf.tangentialVelocity_); tangentialVelocity_ = mapper(ptf.tangentialVelocity_);
} }
@ -78,26 +74,25 @@ pressureInletOutletVelocityFvPatchVectorField
const dictionary& dict const dictionary& dict
) )
: :
mixedFvPatchVectorField(p, iF), directionMixedFvPatchVectorField(p, iF),
phiName_(dict.lookupOrDefault<word>("phi", "phi")), phiName_(dict.lookupOrDefault<word>("phi", "phi"))
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
applyTangentialVelocity_(false)
{ {
fvPatchVectorField::operator=(vectorField("value", dict, p.size())); fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
if (dict.found("tangentialVelocity")) if (dict.found("tangentialVelocity"))
{ {
applyTangentialVelocity_ = true;
setTangentialVelocity setTangentialVelocity
( (
vectorField("tangentialVelocity", dict, p.size()) vectorField("tangentialVelocity", dict, p.size())
); );
} }
else
{
refValue() = vector::zero;
}
refValue() = *this;
refGrad() = vector::zero; refGrad() = vector::zero;
valueFraction() = 0.0; valueFraction() = symmTensor::zero;
} }
@ -107,11 +102,9 @@ pressureInletOutletVelocityFvPatchVectorField
const pressureInletOutletVelocityFvPatchVectorField& pivpvf const pressureInletOutletVelocityFvPatchVectorField& pivpvf
) )
: :
mixedFvPatchVectorField(pivpvf), directionMixedFvPatchVectorField(pivpvf),
phiName_(pivpvf.phiName_), phiName_(pivpvf.phiName_),
rhoName_(pivpvf.rhoName_), tangentialVelocity_(pivpvf.tangentialVelocity_)
tangentialVelocity_(pivpvf.tangentialVelocity_),
applyTangentialVelocity_(pivpvf.applyTangentialVelocity_)
{} {}
@ -122,11 +115,9 @@ pressureInletOutletVelocityFvPatchVectorField
const DimensionedField<vector, volMesh>& iF const DimensionedField<vector, volMesh>& iF
) )
: :
mixedFvPatchVectorField(pivpvf, iF), directionMixedFvPatchVectorField(pivpvf, iF),
phiName_(pivpvf.phiName_), phiName_(pivpvf.phiName_),
rhoName_(pivpvf.rhoName_), tangentialVelocity_(pivpvf.tangentialVelocity_)
tangentialVelocity_(pivpvf.tangentialVelocity_),
applyTangentialVelocity_(pivpvf.applyTangentialVelocity_)
{} {}
@ -135,10 +126,9 @@ pressureInletOutletVelocityFvPatchVectorField
void Foam::pressureInletOutletVelocityFvPatchVectorField:: void Foam::pressureInletOutletVelocityFvPatchVectorField::
setTangentialVelocity(const vectorField& tangentialVelocity) setTangentialVelocity(const vectorField& tangentialVelocity)
{ {
applyTangentialVelocity_ = true;
tangentialVelocity_ = tangentialVelocity; tangentialVelocity_ = tangentialVelocity;
vectorField n(patch().nf()); const vectorField n(patch().nf());
tangentialVelocity_ -= n*(n & tangentialVelocity_); refValue() = tangentialVelocity_ - n*(n & tangentialVelocity_);
} }
@ -147,8 +137,8 @@ void Foam::pressureInletOutletVelocityFvPatchVectorField::autoMap
const fvPatchFieldMapper& m const fvPatchFieldMapper& m
) )
{ {
mixedFvPatchVectorField::autoMap(m); directionMixedFvPatchVectorField::autoMap(m);
if (applyTangentialVelocity_) if (tangentialVelocity_.size())
{ {
tangentialVelocity_.autoMap(m); tangentialVelocity_.autoMap(m);
} }
@ -161,9 +151,9 @@ void Foam::pressureInletOutletVelocityFvPatchVectorField::rmap
const labelList& addr const labelList& addr
) )
{ {
mixedFvPatchVectorField::rmap(ptf, addr); directionMixedFvPatchVectorField::rmap(ptf, addr);
if (applyTangentialVelocity_) if (tangentialVelocity_.size())
{ {
const pressureInletOutletVelocityFvPatchVectorField& tiptf = const pressureInletOutletVelocityFvPatchVectorField& tiptf =
refCast<const pressureInletOutletVelocityFvPatchVectorField>(ptf); refCast<const pressureInletOutletVelocityFvPatchVectorField>(ptf);
@ -180,67 +170,25 @@ void Foam::pressureInletOutletVelocityFvPatchVectorField::updateCoeffs()
return; return;
} }
const surfaceScalarField& phi =
db().lookupObject<surfaceScalarField>(phiName_);
const fvsPatchField<scalar>& phip = const fvsPatchField<scalar>& phip =
patch().patchField<surfaceScalarField, scalar>(phi); patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
vectorField n(patch().nf()); valueFraction() = neg(phip)*(I - sqr(patch().nf()));
const Field<scalar>& magSf = patch().magSf();
if (phi.dimensions() == dimVelocity*dimArea) directionMixedFvPatchVectorField::updateCoeffs();
{ directionMixedFvPatchVectorField::evaluate();
refValue() = n*phip/magSf;
}
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
const fvPatchField<scalar>& rhop =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
refValue() = n*phip/(rhop*magSf);
}
else
{
FatalErrorIn
(
"pressureInletOutletVelocityFvPatchVectorField::"
"updateCoeffs()"
) << "dimensions of phi are not correct" << nl
<< " on patch " << this->patch().name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< exit(FatalError);
}
if (applyTangentialVelocity_)
{
// Adjust the tangential velocity to conserve kinetic energy
// of the entrained fluid
// scalarField magSqrUt(magSqr(tangentialVelocity_));
// scalarField scale
// (
// sqrt(max(magSqrUt - magSqr(refValue()), scalar(0))/magSqrUt)
// );
// refValue() += scale*tangentialVelocity_;
refValue() += tangentialVelocity_;
}
valueFraction() = 1.0 - pos(phip);
mixedFvPatchVectorField::updateCoeffs();
} }
void Foam::pressureInletOutletVelocityFvPatchVectorField::write void Foam::pressureInletOutletVelocityFvPatchVectorField::write
( (
Ostream& os Ostream& os
) const )
const
{ {
fvPatchVectorField::write(os); fvPatchVectorField::write(os);
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_); writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); if (tangentialVelocity_.size())
if (applyTangentialVelocity_)
{ {
tangentialVelocity_.writeEntry("tangentialVelocity", os); tangentialVelocity_.writeEntry("tangentialVelocity", os);
} }
@ -255,7 +203,9 @@ void Foam::pressureInletOutletVelocityFvPatchVectorField::operator=
const fvPatchField<vector>& pvf const fvPatchField<vector>& pvf
) )
{ {
fvPatchField<vector>::operator=(pvf); tmp<vectorField> normalValue = transform(valueFraction(), refValue());
tmp<vectorField> transformGradValue = transform(I - valueFraction(), pvf);
fvPatchField<vector>::operator=(normalValue + transformGradValue);
} }

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) 2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,21 +25,21 @@ Class
Foam::pressureInletOutletVelocityFvPatchVectorField Foam::pressureInletOutletVelocityFvPatchVectorField
Group Group
grpInletBoundaryConditions grpOutletBoundaryConditions grpInletletBoundaryConditions grpOutletBoundaryConditions
Description Description
This velocity inlet/outlet boundary condition is applied to pressure This velocity inlet/outlet boundary condition is applied to pressure
boundaries where the pressure is specified. A zero-gradient condition is boundaries where the pressure is specified. A zero-gradient condition is
applied for outflow (as defined by the flux); for inflow, the velocity is applied for outflow (as defined by the flux); for inflow, the velocity is
obtained from the patch-face normal component of the internal-cell value and obtained from the patch-face normal component of the internal-cell value.
the tangential patch velocity can be optionally specified.
The tangential patch velocity can be optionally specified.
\heading Patch usage \heading Patch usage
\table \table
Property | Description | Required | Default value Property | Description | Required | Default value
phi | flux field name | no | phi phi | flux field name | no | phi
rho | density field name | no | rho
tangentialVelocity | tangential velocity field | no | tangentialVelocity | tangential velocity field | no |
\endtable \endtable
@ -49,7 +49,6 @@ Description
{ {
type pressureInletOutletVelocity; type pressureInletOutletVelocity;
phi phi; phi phi;
rho rho;
tangentialVelocity uniform (0 0 0); tangentialVelocity uniform (0 0 0);
value uniform 0; value uniform 0;
} }
@ -70,7 +69,7 @@ SourceFiles
#define pressureInletOutletVelocityFvPatchVectorField_H #define pressureInletOutletVelocityFvPatchVectorField_H
#include "fvPatchFields.H" #include "fvPatchFields.H"
#include "mixedFvPatchFields.H" #include "directionMixedFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -78,29 +77,21 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class pressureInletOutletVelocityFvPatchVectorField Declaration Class pressureInletOutletVelocityFvPatchVectorField Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class pressureInletOutletVelocityFvPatchVectorField class pressureInletOutletVelocityFvPatchVectorField
: :
public mixedFvPatchVectorField public directionMixedFvPatchVectorField
{ {
// Private data // Private data
//- Flux field name //- Flux field name
word phiName_; word phiName_;
//- Density field name
word rhoName_;
protected:
//- Optional tangential velocity component //- Optional tangential velocity component
vectorField tangentialVelocity_; vectorField tangentialVelocity_;
bool applyTangentialVelocity_;
public: public:
@ -117,17 +108,6 @@ public:
const DimensionedField<vector, volMesh>& const DimensionedField<vector, volMesh>&
); );
//- Construct by mapping given
// pressureInletOutletVelocityFvPatchVectorField
// onto a new patch
pressureInletOutletVelocityFvPatchVectorField
(
const pressureInletOutletVelocityFvPatchVectorField&,
const fvPatch&,
const DimensionedField<vector, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct from patch, internal field and dictionary //- Construct from patch, internal field and dictionary
pressureInletOutletVelocityFvPatchVectorField pressureInletOutletVelocityFvPatchVectorField
( (
@ -136,6 +116,16 @@ public:
const dictionary& const dictionary&
); );
//- Construct by mapping given
// pressureInletOutletVelocityFvPatchVectorField onto a new patch
pressureInletOutletVelocityFvPatchVectorField
(
const pressureInletOutletVelocityFvPatchVectorField&,
const fvPatch&,
const DimensionedField<vector, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy //- Construct as copy
pressureInletOutletVelocityFvPatchVectorField pressureInletOutletVelocityFvPatchVectorField
( (
@ -147,10 +137,7 @@ public:
{ {
return tmp<fvPatchVectorField> return tmp<fvPatchVectorField>
( (
new pressureInletOutletVelocityFvPatchVectorField new pressureInletOutletVelocityFvPatchVectorField(*this)
(
*this
)
); );
} }
@ -169,11 +156,7 @@ public:
{ {
return tmp<fvPatchVectorField> return tmp<fvPatchVectorField>
( (
new pressureInletOutletVelocityFvPatchVectorField new pressureInletOutletVelocityFvPatchVectorField(*this, iF)
(
*this,
iF
)
); );
} }
@ -194,18 +177,6 @@ public:
return phiName_; return phiName_;
} }
//- Return the name of rho
const word& rhoName() const
{
return rhoName_;
}
//- Return reference to the name of rho to allow adjustment
word& rhoName()
{
return rhoName_;
}
//- Return the tangential velocity //- Return the tangential velocity
const vectorField& tangentialVelocity() const const vectorField& tangentialVelocity() const
{ {

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-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,17 +33,17 @@ License
void Foam::rotatingPressureInletOutletVelocityFvPatchVectorField:: void Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::
calcTangentialVelocity() calcTangentialVelocity()
{ {
applyTangentialVelocity_ = true;
const scalar t = this->db().time().timeOutputValue(); const scalar t = this->db().time().timeOutputValue();
vector om = omega_->value(t); vector om = omega_->value(t);
vector axisHat = om/mag(om); vector axisHat = om/mag(om);
tangentialVelocity_ = const vectorField tangentialVelocity
(-om) ^ (patch().Cf() - axisHat*(axisHat & patch().Cf())); (
(-om) ^ (patch().Cf() - axisHat*(axisHat & patch().Cf()))
);
const vectorField n(patch().nf()); const vectorField n(patch().nf());
tangentialVelocity_ -= n*(n & tangentialVelocity_); refValue() = tangentialVelocity - n*(n & tangentialVelocity);
} }
@ -72,7 +72,9 @@ rotatingPressureInletOutletVelocityFvPatchVectorField
: :
pressureInletOutletVelocityFvPatchVectorField(ptf, p, iF, mapper), pressureInletOutletVelocityFvPatchVectorField(ptf, p, iF, mapper),
omega_(ptf.omega_().clone().ptr()) omega_(ptf.omega_().clone().ptr())
{} {
calcTangentialVelocity();
}
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField:: Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::
@ -85,7 +87,9 @@ rotatingPressureInletOutletVelocityFvPatchVectorField
: :
pressureInletOutletVelocityFvPatchVectorField(p, iF, dict), pressureInletOutletVelocityFvPatchVectorField(p, iF, dict),
omega_(DataEntry<vector>::New("omega", dict)) omega_(DataEntry<vector>::New("omega", dict))
{} {
calcTangentialVelocity();
}
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField:: Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::
@ -96,7 +100,9 @@ rotatingPressureInletOutletVelocityFvPatchVectorField
: :
pressureInletOutletVelocityFvPatchVectorField(rppvf), pressureInletOutletVelocityFvPatchVectorField(rppvf),
omega_(rppvf.omega_().clone().ptr()) omega_(rppvf.omega_().clone().ptr())
{} {
calcTangentialVelocity();
}
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField:: Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::
@ -108,24 +114,13 @@ rotatingPressureInletOutletVelocityFvPatchVectorField
: :
pressureInletOutletVelocityFvPatchVectorField(rppvf, iF), pressureInletOutletVelocityFvPatchVectorField(rppvf, iF),
omega_(rppvf.omega_().clone().ptr()) omega_(rppvf.omega_().clone().ptr())
{} {
calcTangentialVelocity();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::updateCoeffs()
{
if (updated())
{
return;
}
calcTangentialVelocity();
pressureInletOutletVelocityFvPatchVectorField::updateCoeffs();
}
void Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::write void Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::write
( (
Ostream& os Ostream& os

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-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -177,9 +177,6 @@ public:
// Member functions // Member functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write //- Write
virtual void write(Ostream&) const; virtual void write(Ostream&) const;
}; };

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-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -146,6 +146,13 @@ public:
const label i const label i
) = 0; ) = 0;
//- Return reaction rate of the specieI in reactionI
virtual tmp<DimensionedField<scalar, volMesh> > calculateRR
(
const label reactionI,
const label specieI
) const = 0;
// Chemistry solution // Chemistry solution

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-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -626,6 +626,88 @@ Foam::label Foam::chemistryModel<CompType, ThermoType>::nEqns() const
} }
template<class CompType, class ThermoType>
Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
Foam::chemistryModel<CompType, ThermoType>::calculateRR
(
const label reactionI,
const label specieI
) const
{
scalar pf, cf, pr, cr;
label lRef, rRef;
const volScalarField rho
(
IOobject
(
"rho",
this->time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->thermo().rho()
);
tmp<DimensionedField<scalar, volMesh> > tRR
(
new DimensionedField<scalar, volMesh>
(
IOobject
(
"RR",
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
this->mesh(),
dimensionedScalar("zero", dimMass/dimVolume/dimTime, 0.0)
)
);
DimensionedField<scalar, volMesh>& RR = tRR();
const scalarField& T = this->thermo().T();
const scalarField& p = this->thermo().p();
forAll(rho, celli)
{
const scalar rhoi = rho[celli];
const scalar Ti = T[celli];
const scalar pi = p[celli];
scalarField c(nSpecie_, 0.0);
for (label i=0; i<nSpecie_; i++)
{
const scalar Yi = Y_[i][celli];
c[i] = rhoi*Yi/specieThermo_[i].W();
}
const scalar w = omegaI
(
reactionI,
c,
Ti,
pi,
pf,
cf,
lRef,
pr,
cr,
rRef
);
RR[celli] = w*specieThermo_[specieI].W();
}
return tRR;
}
template<class CompType, class ThermoType> template<class CompType, class ThermoType>
void Foam::chemistryModel<CompType, ThermoType>::calculate() void Foam::chemistryModel<CompType, ThermoType>::calculate()
{ {

View file

@ -198,6 +198,13 @@ public:
const label i const label i
); );
//- Return reaction rate of the specieI in reactionI
virtual tmp<DimensionedField<scalar, volMesh> > calculateRR
(
const label reactionI,
const label specieI
) const;
//- Solve the reaction system for the given time step //- Solve the reaction system for the given time step
// and return the characteristic time // and return the characteristic time
virtual scalar solve(const scalar deltaT); virtual scalar solve(const scalar deltaT);

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) 2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -84,4 +84,27 @@ Foam::basicSolidChemistryModel::RR(const label i)
} }
Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
Foam::basicSolidChemistryModel::calculateRR
(
const label reactionI,
const label specieI
) const
{
notImplemented
(
"Foam::DimensionedField<Foam::scalar, Foam::volMesh>&"
"basicSolidChemistryModel::calculateRR(const label)"
);
return dynamic_cast<tmp<DimensionedField<scalar, volMesh> >&>
(
const_cast<DimensionedField<scalar, volMesh>& >
(
DimensionedField<scalar, volMesh>::null()
)
);
}
// ************************************************************************* // // ************************************************************************* //

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) 2013-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -133,6 +133,13 @@ public:
const label i const label i
) const = 0; ) const = 0;
//- Returns the reaction rate of the specieI in reactionI
virtual tmp<DimensionedField<scalar, volMesh> > calculateRR
(
const label reactionI,
const label specieI
) const;
//- Return sensible enthalpy for gas i [J/Kg] //- Return sensible enthalpy for gas i [J/Kg]
virtual tmp<volScalarField> gasHs virtual tmp<volScalarField> gasHs
( (

View file

@ -34,7 +34,7 @@ Description
The porous baffle introduces a pressure jump defined by: The porous baffle introduces a pressure jump defined by:
\f[ \f[
\Delta p = -(I \mu U + 0.5 D \rho |U|^2 )L \Delta p = -(D \mu U + 0.5 I \rho |U|^2 )L
\f] \f]
where where
@ -42,7 +42,7 @@ Description
\vartable \vartable
p | pressure [Pa] p | pressure [Pa]
\rho | density [kg/m3] \rho | density [kg/m3]
\mu | viscosity [Pa s] \mu | laminar viscosity [Pa s]
I | inertial coefficient I | inertial coefficient
D | Darcy coefficient D | Darcy coefficient
L | porous media length in the flow direction L | porous media length in the flow direction
@ -66,8 +66,8 @@ Description
type porousBafflePressure; type porousBafflePressure;
patchType cyclic; patchType cyclic;
jump uniform 0; jump uniform 0;
D 1000000; I 1000000;
I 0.001; D 0.001;
L 0.1; L 0.1;
value uniform 0; value uniform 0;
} }

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-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -76,9 +76,9 @@ void Foam::porousBafflePressureFvPatchField<Foam::scalar>::updateCoeffs()
"turbulenceModel" "turbulenceModel"
); );
const scalarField nuEffw = turbModel.nuEff()().boundaryField()[patchI]; const scalarField nu = turbModel.nu()().boundaryField()[patchI];
jump_ = -sign(Un)*(I_*nuEffw + D_*0.5*magUn)*magUn*length_; jump_ = -sign(Un)*(D_*nu + I_*0.5*magUn)*magUn*length_;
} }
else else
{ {
@ -88,14 +88,14 @@ void Foam::porousBafflePressureFvPatchField<Foam::scalar>::updateCoeffs()
"turbulenceModel" "turbulenceModel"
); );
const scalarField muEffw = turbModel.muEff()().boundaryField()[patchI]; const scalarField mu = turbModel.mu().boundaryField()[patchI];
const scalarField rhow = const scalarField rhow =
patch().lookupPatchField<volScalarField, scalar>("rho"); patch().lookupPatchField<volScalarField, scalar>("rho");
Un /= rhow; Un /= rhow;
jump_ = -sign(Un)*(I_*muEffw + D_*0.5*rhow*magUn)*magUn*length_; jump_ = -sign(Un)*(D_*mu + I_*0.5*rhow*magUn)*magUn*length_;
} }
if (debug) if (debug)

View file

@ -44,6 +44,7 @@ boundaryField
atmosphere atmosphere
{ {
type pressureInletOutletVelocity; type pressureInletOutletVelocity;
tangentialVelocity $internalField;
value uniform (0 0 0); value uniform (0 0 0);
} }

View file

@ -24,8 +24,6 @@ solvers
cAlpha 1; cAlpha 1;
icAlpha 0; icAlpha 0;
alphaOuterCorrectors yes;
MULESCorr yes; MULESCorr yes;
nLimiterIter 10; nLimiterIter 10;
alphaApplyPrevCorr yes; alphaApplyPrevCorr yes;

View file

@ -23,8 +23,6 @@ solvers
nAlphaSubCycles 1; nAlphaSubCycles 1;
cAlpha 1; cAlpha 1;
alphaOuterCorrectors yes;
MULESCorr yes; MULESCorr yes;
nLimiterIter 5; nLimiterIter 5;
alphaApplyPrevCorr true; alphaApplyPrevCorr true;

View file

@ -21,7 +21,6 @@ solvers
{ {
nAlphaCorr 2; nAlphaCorr 2;
nAlphaSubCycles 1; nAlphaSubCycles 1;
alphaOuterCorrectors yes;
cAlpha 1; cAlpha 1;
MULESCorr yes; MULESCorr yes;

View file

@ -21,7 +21,6 @@ solvers
{ {
nAlphaCorr 2; nAlphaCorr 2;
nAlphaSubCycles 1; nAlphaSubCycles 1;
alphaOuterCorrectors yes;
cAlpha 1; cAlpha 1;
MULESCorr yes; MULESCorr yes;

View file

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 | | \\ / O peration | Version: 2.3.x |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View file

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 | | \\ / O peration | Version: 2.3.x |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View file

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 | | \\ / O peration | Version: 2.3.x |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -28,7 +28,6 @@ boundaryField
Cmu 0.09; Cmu 0.09;
kappa 0.41; kappa 0.41;
E 9.8; E 9.8;
value uniform 0.1;
} }
rightWall rightWall
{ {
@ -37,7 +36,6 @@ boundaryField
Cmu 0.09; Cmu 0.09;
kappa 0.41; kappa 0.41;
E 9.8; E 9.8;
value uniform 0.1;
} }
lowerWall lowerWall
{ {
@ -46,7 +44,6 @@ boundaryField
Cmu 0.09; Cmu 0.09;
kappa 0.41; kappa 0.41;
E 9.8; E 9.8;
value uniform 0.1;
} }
atmosphere atmosphere
{ {

View file

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 | | \\ / O peration | Version: 2.3.x |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View file

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 | | \\ / O peration | Version: 2.3.x |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View file

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 | | \\ / O peration | Version: 2.3.x |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View file

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 | | \\ / O peration | Version: 2.3.x |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -59,7 +59,7 @@ boundaryField
jump uniform 0; jump uniform 0;
value uniform 0; value uniform 0;
D 1000; D 1000;
I 500; I 1000;
length 0.15; length 0.15;
} }
porous_half1 porous_half1
@ -68,7 +68,7 @@ boundaryField
patchType cyclic; patchType cyclic;
value uniform 0; value uniform 0;
D 1000; D 1000;
I 500; I 1000;
length 0.15; length 0.15;
} }
} }

View file

@ -21,7 +21,6 @@ solvers
{ {
nAlphaCorr 2; nAlphaCorr 2;
nAlphaSubCycles 1; nAlphaSubCycles 1;
alphaOuterCorrectors yes;
cAlpha 1; cAlpha 1;
MULESCorr yes; MULESCorr yes;

View file

@ -41,7 +41,6 @@ blending
default default
{ {
type linear; type linear;
residualAlpha 1e-6;
maxFullyDispersedAlpha.air 0.3; maxFullyDispersedAlpha.air 0.3;
maxPartlyDispersedAlpha.air 0.5; maxPartlyDispersedAlpha.air 0.5;
maxFullyDispersedAlpha.water 0.3; maxFullyDispersedAlpha.water 0.3;
@ -126,11 +125,13 @@ heatTransfer
(air in water) (air in water)
{ {
type RanzMarshall; type RanzMarshall;
residualAlpha 1e-6;
} }
(water in air) (water in air)
{ {
type RanzMarshall; type RanzMarshall;
residualAlpha 1e-6;
} }
); );

View file

@ -41,7 +41,6 @@ blending
default default
{ {
type linear; type linear;
residualAlpha 1e-6;
maxFullyDispersedAlpha.air 0.3; maxFullyDispersedAlpha.air 0.3;
maxPartlyDispersedAlpha.air 0.5; maxPartlyDispersedAlpha.air 0.5;
maxFullyDispersedAlpha.water 0.3; maxFullyDispersedAlpha.water 0.3;
@ -126,11 +125,13 @@ heatTransfer
(air in water) (air in water)
{ {
type RanzMarshall; type RanzMarshall;
residualAlpha 1e-6;
} }
(water in air) (water in air)
{ {
type RanzMarshall; type RanzMarshall;
residualAlpha 1e-6;
} }
); );

View file

@ -42,7 +42,6 @@ blending
default default
{ {
type none; type none;
residualAlpha 1e-3;
continuousPhase air; continuousPhase air;
} }
} }
@ -72,11 +71,6 @@ drag
virtualMass virtualMass
( (
(particles in air)
{
type constantCoefficient;
Cvm 0;
}
); );
heatTransfer heatTransfer
@ -84,6 +78,7 @@ heatTransfer
(particles in air) (particles in air)
{ {
type RanzMarshall; type RanzMarshall;
residualAlpha 1e-3;
} }
); );

View file

@ -41,7 +41,6 @@ blending
default default
{ {
type linear; type linear;
residualAlpha 1e-6;
maxFullyDispersedAlpha.air 0.3; maxFullyDispersedAlpha.air 0.3;
maxPartlyDispersedAlpha.air 0.5; maxPartlyDispersedAlpha.air 0.5;
maxFullyDispersedAlpha.water 0.3; maxFullyDispersedAlpha.water 0.3;
@ -126,11 +125,13 @@ heatTransfer
(air in water) (air in water)
{ {
type RanzMarshall; type RanzMarshall;
residualAlpha 1e-6;
} }
(water in air) (water in air)
{ {
type RanzMarshall; type RanzMarshall;
residualAlpha 1e-6;
} }
); );

View file

@ -62,7 +62,6 @@ blending
default default
{ {
type linear; type linear;
residualAlpha 1e-6;
maxFullyDispersedAlpha.air 0.3; maxFullyDispersedAlpha.air 0.3;
maxPartlyDispersedAlpha.air 0.5; maxPartlyDispersedAlpha.air 0.5;
maxFullyDispersedAlpha.water 0.3; maxFullyDispersedAlpha.water 0.3;
@ -147,11 +146,13 @@ heatTransfer
(air in water) (air in water)
{ {
type RanzMarshall; type RanzMarshall;
residualAlpha 1e-6;
} }
(water in air) (water in air)
{ {
type RanzMarshall; type RanzMarshall;
residualAlpha 1e-6;
} }
); );

View file

@ -42,7 +42,6 @@ blending
default default
{ {
type none; type none;
residualAlpha 1e-3;
continuousPhase air; continuousPhase air;
} }
} }
@ -84,6 +83,7 @@ heatTransfer
(particles in air) (particles in air)
{ {
type RanzMarshall; type RanzMarshall;
residualAlpha 1e-3;
} }
); );

View file

@ -41,7 +41,6 @@ blending
default default
{ {
type linear; type linear;
residualAlpha 1e-6;
maxFullyDispersedAlpha.air 0.3; maxFullyDispersedAlpha.air 0.3;
maxPartlyDispersedAlpha.air 0.5; maxPartlyDispersedAlpha.air 0.5;
maxFullyDispersedAlpha.water 0.3; maxFullyDispersedAlpha.water 0.3;
@ -126,11 +125,13 @@ heatTransfer
(air in water) (air in water)
{ {
type RanzMarshall; type RanzMarshall;
residualAlpha 1e-6;
} }
(water in air) (water in air)
{ {
type RanzMarshall; type RanzMarshall;
residualAlpha 1e-6;
} }
); );