mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
reactingTwoPhaseEulerFoam: Construct MRF and fvOptions in phaseSystem
This commit is contained in:
@ -1,3 +0,0 @@
|
|||||||
IOMRFZoneList MRF(mesh);
|
|
||||||
MRF.correctBoundaryVelocity(U1);
|
|
||||||
MRF.correctBoundaryVelocity(U2);
|
|
||||||
@ -8,4 +8,5 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/fvOptions/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude
|
-I$(LIB_SRC)/meshTools/lnInclude
|
||||||
|
|||||||
@ -171,13 +171,10 @@ Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::dmdt
|
|||||||
|
|
||||||
template<class BasePhaseSystem>
|
template<class BasePhaseSystem>
|
||||||
Foam::autoPtr<Foam::phaseSystem::momentumTransferTable>
|
Foam::autoPtr<Foam::phaseSystem::momentumTransferTable>
|
||||||
Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::momentumTransfer
|
Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::momentumTransfer() const
|
||||||
(
|
|
||||||
IOMRFZoneList& MRF
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
autoPtr<phaseSystem::momentumTransferTable>
|
autoPtr<phaseSystem::momentumTransferTable>
|
||||||
eqnsPtr(BasePhaseSystem::momentumTransfer(MRF));
|
eqnsPtr(BasePhaseSystem::momentumTransfer());
|
||||||
|
|
||||||
phaseSystem::momentumTransferTable& eqns = eqnsPtr();
|
phaseSystem::momentumTransferTable& eqns = eqnsPtr();
|
||||||
|
|
||||||
|
|||||||
@ -142,10 +142,8 @@ public:
|
|||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Return the momentum transfer matrices
|
//- Return the momentum transfer matrices
|
||||||
virtual autoPtr<phaseSystem::momentumTransferTable> momentumTransfer
|
virtual autoPtr<phaseSystem::momentumTransferTable>
|
||||||
(
|
momentumTransfer() const;
|
||||||
IOMRFZoneList& mrfZones
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the heat transfer matrices
|
//- Return the heat transfer matrices
|
||||||
virtual autoPtr<phaseSystem::heatTransferTable>
|
virtual autoPtr<phaseSystem::heatTransferTable>
|
||||||
|
|||||||
@ -32,7 +32,6 @@ License
|
|||||||
#include "wallLubricationModel.H"
|
#include "wallLubricationModel.H"
|
||||||
#include "turbulentDispersionModel.H"
|
#include "turbulentDispersionModel.H"
|
||||||
|
|
||||||
#include "IOMRFZoneList.H"
|
|
||||||
#include "HashPtrTable.H"
|
#include "HashPtrTable.H"
|
||||||
|
|
||||||
#include "fvmDdt.H"
|
#include "fvmDdt.H"
|
||||||
@ -348,10 +347,7 @@ Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::D
|
|||||||
|
|
||||||
template<class BasePhaseSystem>
|
template<class BasePhaseSystem>
|
||||||
Foam::autoPtr<Foam::phaseSystem::momentumTransferTable>
|
Foam::autoPtr<Foam::phaseSystem::momentumTransferTable>
|
||||||
Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::momentumTransfer
|
Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::momentumTransfer() const
|
||||||
(
|
|
||||||
IOMRFZoneList& MRF
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
// Create a momentum transfer matrix for each phase
|
// Create a momentum transfer matrix for each phase
|
||||||
autoPtr<phaseSystem::momentumTransferTable> eqnsPtr
|
autoPtr<phaseSystem::momentumTransferTable> eqnsPtr
|
||||||
@ -452,7 +448,7 @@ Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::momentumTransfer
|
|||||||
- fvm::Sp(fvc::div(phi), U)
|
- fvm::Sp(fvc::div(phi), U)
|
||||||
- otherPhase->DUDt()
|
- otherPhase->DUDt()
|
||||||
)
|
)
|
||||||
- MRF.DDt(Vm, U - otherPhase->U());
|
- this->MRF_.DDt(Vm, U - otherPhase->U());
|
||||||
|
|
||||||
Swap(phase, otherPhase);
|
Swap(phase, otherPhase);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -171,10 +171,8 @@ public:
|
|||||||
virtual tmp<volScalarField> D(const phasePairKey& key) const;
|
virtual tmp<volScalarField> D(const phasePairKey& key) const;
|
||||||
|
|
||||||
//- Return the momentum transfer matrices
|
//- Return the momentum transfer matrices
|
||||||
virtual autoPtr<phaseSystem::momentumTransferTable> momentumTransfer
|
virtual autoPtr<phaseSystem::momentumTransferTable>
|
||||||
(
|
momentumTransfer() const;
|
||||||
IOMRFZoneList& mrfZones
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Read base phaseProperties dictionary
|
//- Read base phaseProperties dictionary
|
||||||
virtual bool read();
|
virtual bool read();
|
||||||
|
|||||||
@ -42,12 +42,10 @@ License
|
|||||||
|
|
||||||
template<class BasePhaseModel>
|
template<class BasePhaseModel>
|
||||||
Foam::tmp<Foam::surfaceScalarField>
|
Foam::tmp<Foam::surfaceScalarField>
|
||||||
Foam::MovingPhaseModel<BasePhaseModel>::generatePhi
|
Foam::MovingPhaseModel<BasePhaseModel>::phi(const volVectorField& U) const
|
||||||
(
|
|
||||||
const word& phiName,
|
|
||||||
const volVectorField& U
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
|
word phiName(IOobject::groupName("phi", this->name()));
|
||||||
|
|
||||||
IOobject phiHeader
|
IOobject phiHeader
|
||||||
(
|
(
|
||||||
phiName,
|
phiName,
|
||||||
@ -60,8 +58,7 @@ Foam::MovingPhaseModel<BasePhaseModel>::generatePhi
|
|||||||
{
|
{
|
||||||
Info<< "Reading face flux field " << phiName << endl;
|
Info<< "Reading face flux field " << phiName << endl;
|
||||||
|
|
||||||
return
|
return tmp<surfaceScalarField>
|
||||||
tmp<surfaceScalarField>
|
|
||||||
(
|
(
|
||||||
new surfaceScalarField
|
new surfaceScalarField
|
||||||
(
|
(
|
||||||
@ -142,14 +139,7 @@ Foam::MovingPhaseModel<BasePhaseModel>::MovingPhaseModel
|
|||||||
),
|
),
|
||||||
fluid.mesh()
|
fluid.mesh()
|
||||||
),
|
),
|
||||||
phi_
|
phi_(phi(U_)),
|
||||||
(
|
|
||||||
generatePhi
|
|
||||||
(
|
|
||||||
IOobject::groupName("phi", this->name()),
|
|
||||||
U_
|
|
||||||
)
|
|
||||||
),
|
|
||||||
alphaPhi_
|
alphaPhi_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -225,6 +215,8 @@ void Foam::MovingPhaseModel<BasePhaseModel>::correct()
|
|||||||
{
|
{
|
||||||
BasePhaseModel::correct();
|
BasePhaseModel::correct();
|
||||||
|
|
||||||
|
this->fluid().MRF().correctBoundaryVelocity(U_);
|
||||||
|
|
||||||
continuityError_ =
|
continuityError_ =
|
||||||
fvc::ddt(*this, this->thermo().rho()) + fvc::div(alphaRhoPhi_);
|
fvc::ddt(*this, this->thermo().rho()) + fvc::div(alphaRhoPhi_);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -91,12 +91,8 @@ class MovingPhaseModel
|
|||||||
|
|
||||||
// Private static member functions
|
// Private static member functions
|
||||||
|
|
||||||
//- Generate the flux field
|
//- Calculate and return the flux field
|
||||||
tmp<surfaceScalarField> generatePhi
|
tmp<surfaceScalarField> phi(const volVectorField& U) const;
|
||||||
(
|
|
||||||
const word& phiName,
|
|
||||||
const volVectorField& U
|
|
||||||
) const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -183,7 +183,10 @@ Foam::phaseSystem::phaseSystem
|
|||||||
),
|
),
|
||||||
mesh,
|
mesh,
|
||||||
dimensionedScalar("dpdt", dimPressure/dimTime, 0)
|
dimensionedScalar("dpdt", dimPressure/dimTime, 0)
|
||||||
)
|
),
|
||||||
|
|
||||||
|
MRF_(mesh_),
|
||||||
|
fvOptions_(mesh_)
|
||||||
{
|
{
|
||||||
// Blending methods
|
// Blending methods
|
||||||
forAllConstIter(dictionary, subDict("blending"), iter)
|
forAllConstIter(dictionary, subDict("blending"), iter)
|
||||||
|
|||||||
@ -41,6 +41,8 @@ SourceFiles
|
|||||||
#include "phaseModel.H"
|
#include "phaseModel.H"
|
||||||
#include "phasePair.H"
|
#include "phasePair.H"
|
||||||
#include "orderedPhasePair.H"
|
#include "orderedPhasePair.H"
|
||||||
|
#include "IOMRFZoneList.H"
|
||||||
|
#include "fvIOoptionList.H"
|
||||||
|
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "surfaceFields.H"
|
#include "surfaceFields.H"
|
||||||
@ -55,7 +57,6 @@ class blendingMethod;
|
|||||||
template <class modelType> class BlendedInterfacialModel;
|
template <class modelType> class BlendedInterfacialModel;
|
||||||
class surfaceTensionModel;
|
class surfaceTensionModel;
|
||||||
class aspectRatioModel;
|
class aspectRatioModel;
|
||||||
class IOMRFZoneList;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class phaseSystem Declaration
|
Class phaseSystem Declaration
|
||||||
@ -174,6 +175,12 @@ protected:
|
|||||||
//- Rate of change of pressure
|
//- Rate of change of pressure
|
||||||
volScalarField dpdt_;
|
volScalarField dpdt_;
|
||||||
|
|
||||||
|
//- Optional MRF zones
|
||||||
|
IOMRFZoneList MRF_;
|
||||||
|
|
||||||
|
//- Optional FV-options
|
||||||
|
fv::IOoptionList fvOptions_;
|
||||||
|
|
||||||
//- Blending methods
|
//- Blending methods
|
||||||
blendingMethodTable blendingMethods_;
|
blendingMethodTable blendingMethods_;
|
||||||
|
|
||||||
@ -316,10 +323,7 @@ public:
|
|||||||
virtual tmp<volScalarField> dmdt(const phasePairKey& key) const = 0;
|
virtual tmp<volScalarField> dmdt(const phasePairKey& key) const = 0;
|
||||||
|
|
||||||
//- Return the momentum transfer matrices
|
//- Return the momentum transfer matrices
|
||||||
virtual autoPtr<momentumTransferTable> momentumTransfer
|
virtual autoPtr<momentumTransferTable> momentumTransfer() const = 0;
|
||||||
(
|
|
||||||
IOMRFZoneList& MRF
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- Return the heat transfer matrices
|
//- Return the heat transfer matrices
|
||||||
virtual autoPtr<heatTransferTable> heatTransfer() const = 0;
|
virtual autoPtr<heatTransferTable> heatTransfer() const = 0;
|
||||||
@ -363,6 +367,12 @@ public:
|
|||||||
//- Access the rate of change of the pressure
|
//- Access the rate of change of the pressure
|
||||||
inline volScalarField& dpdt();
|
inline volScalarField& dpdt();
|
||||||
|
|
||||||
|
//- Return MRF zones
|
||||||
|
inline const IOMRFZoneList& MRF() const;
|
||||||
|
|
||||||
|
//- Optional FV-options
|
||||||
|
inline fv::IOoptionList& fvOptions();
|
||||||
|
|
||||||
//- Access a sub model between a phase pair
|
//- Access a sub model between a phase pair
|
||||||
template <class modelType>
|
template <class modelType>
|
||||||
const modelType& lookupSubModel(const phasePair& key) const;
|
const modelType& lookupSubModel(const phasePair& key) const;
|
||||||
|
|||||||
@ -55,4 +55,16 @@ inline Foam::volScalarField& Foam::phaseSystem::dpdt()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const Foam::IOMRFZoneList& Foam::phaseSystem::MRF() const
|
||||||
|
{
|
||||||
|
return MRF_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::fv::IOoptionList& Foam::phaseSystem::fvOptions()
|
||||||
|
{
|
||||||
|
return fvOptions_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -37,7 +37,6 @@ Description
|
|||||||
#include "twoPhaseSystem.H"
|
#include "twoPhaseSystem.H"
|
||||||
#include "PhaseCompressibleTurbulenceModel.H"
|
#include "PhaseCompressibleTurbulenceModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
#include "fvIOoptionList.H"
|
|
||||||
#include "fixedFluxPressureFvPatchScalarField.H"
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
#include "HashPtrTable.H"
|
#include "HashPtrTable.H"
|
||||||
|
|
||||||
@ -53,8 +52,6 @@ int main(int argc, char *argv[])
|
|||||||
pimpleControl pimple(mesh);
|
pimpleControl pimple(mesh);
|
||||||
|
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createMRF.H"
|
|
||||||
#include "createFvOptions.H"
|
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
#include "readTimeControls.H"
|
#include "readTimeControls.H"
|
||||||
#include "CourantNos.H"
|
#include "CourantNos.H"
|
||||||
@ -75,6 +72,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#include "pUf/createDDtU.H"
|
#include "pUf/createDDtU.H"
|
||||||
|
|
||||||
|
const IOMRFZoneList& MRF = fluid.MRF();
|
||||||
|
fv::IOoptionList& fvOptions = fluid.fvOptions();
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|||||||
@ -164,7 +164,7 @@ void Foam::MRFZoneList::addAcceleration
|
|||||||
Foam::tmp<Foam::volVectorField> Foam::MRFZoneList::DDt
|
Foam::tmp<Foam::volVectorField> Foam::MRFZoneList::DDt
|
||||||
(
|
(
|
||||||
const volVectorField& U
|
const volVectorField& U
|
||||||
)
|
) const
|
||||||
{
|
{
|
||||||
tmp<volVectorField> tacceleration
|
tmp<volVectorField> tacceleration
|
||||||
(
|
(
|
||||||
@ -195,7 +195,7 @@ Foam::tmp<Foam::volVectorField> Foam::MRFZoneList::DDt
|
|||||||
(
|
(
|
||||||
const volScalarField& rho,
|
const volScalarField& rho,
|
||||||
const volVectorField& U
|
const volVectorField& U
|
||||||
)
|
) const
|
||||||
{
|
{
|
||||||
return rho*DDt(U);
|
return rho*DDt(U);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -114,14 +114,14 @@ public:
|
|||||||
tmp<volVectorField> DDt
|
tmp<volVectorField> DDt
|
||||||
(
|
(
|
||||||
const volVectorField& U
|
const volVectorField& U
|
||||||
);
|
) const;
|
||||||
|
|
||||||
//- Return the frame acceleration
|
//- Return the frame acceleration
|
||||||
tmp<volVectorField> DDt
|
tmp<volVectorField> DDt
|
||||||
(
|
(
|
||||||
const volScalarField& rho,
|
const volScalarField& rho,
|
||||||
const volVectorField& U
|
const volVectorField& U
|
||||||
);
|
) const;
|
||||||
|
|
||||||
//- Make the given absolute velocity relative within the MRF region
|
//- Make the given absolute velocity relative within the MRF region
|
||||||
void makeRelative(volVectorField& U) const;
|
void makeRelative(volVectorField& U) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user