reactingEulerFoam: Added phase transfer structure

An additional layer has been added into the phase system hierarchy which
facilitates the application of phase transfer modelling. These are
models which exchange mass between phases without the thermal coupling
that would be required to represent phase change. They can be thought of
as representation changes; e.g., between two phases representing
different droplet sizes of the same physical fluid.

To facilitate this, the heat transfer phase systems have been modified
and renamed and now both support mass transfer. The two sided version
is only required for derivations which support phase change.

The following changes to case settings have been made:

- The simplest instantiated phase systems have been renamed to
basicTwoPhaseSystem and basicMultiphaseSystem. The
heatAndMomentumTransfer*System entries in constant/phaseProperties files
will need updating accordingly.

- A phaseTransfer sub-model entry will be required in the
constant/phaseProperties file. This can be an empty list.

- The massTransfer switch in thermal phase change cases has been renamed
phaseTransfer, so as not to be confused with the mass transfer models
used by interface composition cases.

This work was supported by Georg Skillas and Zhen Li, at Evonik
This commit is contained in:
Will Bainbridge
2018-04-03 09:30:11 +01:00
parent f068c0935a
commit 85a9e17dd5
65 changed files with 1583 additions and 1025 deletions

View File

@ -74,4 +74,7 @@ wallDampingModels/linear/linearWallDamping.C
wallDampingModels/cosine/cosineWallDamping.C wallDampingModels/cosine/cosineWallDamping.C
wallDampingModels/sine/sineWallDamping.C wallDampingModels/sine/sineWallDamping.C
phaseTransferModels/phaseTransferModel/phaseTransferModel.C
phaseTransferModels/phaseTransferModel/newPhaseTransferModel.C
LIB = $(FOAM_LIBBIN)/libreactingEulerianInterfacialModels LIB = $(FOAM_LIBBIN)/libreactingEulerianInterfacialModels

View File

@ -0,0 +1,59 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "phaseTransferModel.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::phaseTransferModel> Foam::phaseTransferModel::New
(
const dictionary& dict,
const phasePair& pair
)
{
word phaseTransferModelType(dict.lookup("type"));
Info<< "Selecting phaseTransferModel for "
<< pair << ": " << phaseTransferModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(phaseTransferModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorInFunction
<< "Unknown phaseTransferModelType type "
<< phaseTransferModelType << endl << endl
<< "Valid phaseTransferModel types are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()(dict, pair);
}
// ************************************************************************* //

View File

@ -0,0 +1,61 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "phaseTransferModel.H"
#include "phasePair.H"
#include "BlendedInterfacialModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(phaseTransferModel, 0);
defineBlendedInterfacialModelTypeNameAndDebug(phaseTransferModel, 0);
defineRunTimeSelectionTable(phaseTransferModel, dictionary);
}
const Foam::dimensionSet Foam::phaseTransferModel::dimDmdt =
Foam::dimDensity/Foam::dimTime;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::phaseTransferModel::phaseTransferModel
(
const dictionary& dict,
const phasePair& pair
)
:
pair_(pair)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::phaseTransferModel::~phaseTransferModel()
{}
// ************************************************************************* //

View File

@ -0,0 +1,127 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::phaseTransferModel
Description
SourceFiles
phaseTransferModel.C
\*---------------------------------------------------------------------------*/
#ifndef phaseTransferModel_H
#define phaseTransferModel_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "volFields.H"
#include "dictionary.H"
#include "runTimeSelectionTables.H"
namespace Foam
{
class phasePair;
/*---------------------------------------------------------------------------*\
Class phaseTransferModel Declaration
\*---------------------------------------------------------------------------*/
class phaseTransferModel
{
protected:
// Protected data
//- Phase pair
const phasePair& pair_;
public:
//- Runtime type information
TypeName("phaseTransferModel");
// Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
phaseTransferModel,
dictionary,
(
const dictionary& dict,
const phasePair& pair
),
(dict, pair)
);
// Static data members
//- Mass transfer rate dimensions
static const dimensionSet dimDmdt;
// Constructors
//- Construct from a dictionary and a phase pair
phaseTransferModel
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~phaseTransferModel();
// Selectors
static autoPtr<phaseTransferModel> New
(
const dictionary& dict,
const phasePair& pair
);
// Member Functions
//- The mass transfer rate
virtual tmp<volScalarField> dmdt() const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -366,6 +366,14 @@ Foam::BlendedInterfacialModel<ModelType>::D() const
} }
template<class ModelType>
Foam::tmp<Foam::volScalarField>
Foam::BlendedInterfacialModel<ModelType>::dmdt() const
{
return evaluate(&ModelType::dmdt, "dmdt", ModelType::dimDmdt, false);
}
template<class ModelType> template<class ModelType>
bool Foam::BlendedInterfacialModel<ModelType>::writeData(Ostream& os) const bool Foam::BlendedInterfacialModel<ModelType>::writeData(Ostream& os) const
{ {

View File

@ -190,6 +190,9 @@ public:
//- Return the blended diffusivity //- Return the blended diffusivity
tmp<volScalarField> D() const; tmp<volScalarField> D() const;
//- Return the blended mass transfer rate
tmp<volScalarField> dmdt() const;
//- Dummy write for regIOobject //- Dummy write for regIOobject
bool writeData(Ostream& os) const; bool writeData(Ostream& os) const;
}; };

View File

@ -1,324 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "HeatAndMassTransferPhaseSystem.H"
#include "BlendedInterfacialModel.H"
#include "heatTransferModel.H"
#include "massTransferModel.H"
#include "HashPtrTable.H"
#include "fvcDiv.H"
#include "fvmSup.H"
#include "fvMatrix.H"
#include "zeroGradientFvPatchFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BasePhaseSystem>
Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::
HeatAndMassTransferPhaseSystem
(
const fvMesh& mesh
)
:
BasePhaseSystem(mesh)
{
this->generatePairsAndSubModels
(
"heatTransfer",
heatTransferModels_
);
this->generatePairsAndSubModels
(
"massTransfer",
massTransferModels_
);
forAllConstIter
(
phaseSystem::phasePairTable,
this->phasePairs_,
phasePairIter
)
{
const phasePair& pair(phasePairIter());
if (pair.ordered())
{
continue;
}
if
(
heatTransferModels_.found(pair)
&& heatTransferModels_[pair][pair.first()].valid()
&& heatTransferModels_[pair][pair.second()].valid()
)
{
volScalarField H1(heatTransferModels_[pair][pair.first()]->K());
volScalarField H2(heatTransferModels_[pair][pair.second()]->K());
Tf_.insert
(
pair,
new volScalarField
(
IOobject
(
IOobject::groupName("Tf", pair.name()),
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
(
H1*pair.phase1().thermo().T()
+ H2*pair.phase2().thermo().T()
)
/max
(
H1 + H2,
dimensionedScalar
(
"small",
heatTransferModel::dimK,
small
)
),
zeroGradientFvPatchScalarField::typeName
)
);
Tf_[pair]->correctBoundaryConditions();
}
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class BasePhaseSystem>
Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::
~HeatAndMassTransferPhaseSystem()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class BasePhaseSystem>
Foam::autoPtr<Foam::phaseSystem::heatTransferTable>
Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::heatTransfer() const
{
autoPtr<phaseSystem::heatTransferTable> eqnsPtr
(
new phaseSystem::heatTransferTable()
);
phaseSystem::heatTransferTable& eqns = eqnsPtr();
forAll(this->phaseModels_, phasei)
{
const phaseModel& phase = this->phaseModels_[phasei];
eqns.insert
(
phase.name(),
new fvScalarMatrix(phase.thermo().he(), dimEnergy/dimTime)
);
}
// Heat transfer with the interface
forAllConstIter
(
heatTransferModelTable,
heatTransferModels_,
heatTransferModelIter
)
{
if
(
heatTransferModels_.found(heatTransferModelIter.key())
)
{
const phasePair& pair
(
this->phasePairs_[heatTransferModelIter.key()]
);
const volScalarField& Tf(*Tf_[pair]);
const volScalarField K1
(
heatTransferModelIter()[pair.first()]->K()
);
const volScalarField K2
(
heatTransferModelIter()[pair.second()]->K()
);
const volScalarField KEff
(
K1*K2
/max
(
K1 + K2,
dimensionedScalar("small", heatTransferModel::dimK, small)
)
);
const volScalarField* K = &K1;
const volScalarField* otherK = &K2;
forAllConstIter(phasePair, pair, iter)
{
const phaseModel& phase = iter();
const volScalarField& he(phase.thermo().he());
volScalarField Cpv(phase.thermo().Cpv());
*eqns[phase.name()] +=
(*K)*(Tf - phase.thermo().T())
+ KEff/Cpv*he - fvm::Sp(KEff/Cpv, he);
Swap(K, otherK);
}
}
}
return eqnsPtr;
}
template<class BasePhaseSystem>
Foam::autoPtr<Foam::phaseSystem::massTransferTable>
Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::massTransfer() const
{
// Create a mass transfer matrix for each species of each phase
autoPtr<phaseSystem::massTransferTable> eqnsPtr
(
new phaseSystem::massTransferTable()
);
phaseSystem::massTransferTable& eqns = eqnsPtr();
forAll(this->phaseModels_, phasei)
{
const phaseModel& phase = this->phaseModels_[phasei];
const PtrList<volScalarField>& Yi = phase.Y();
forAll(Yi, i)
{
eqns.insert
(
Yi[i].name(),
new fvScalarMatrix(Yi[i], dimMass/dimTime)
);
}
}
return eqnsPtr;
}
template<class BasePhaseSystem>
void Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::correctThermo()
{
phaseSystem::correctThermo();
forAllConstIter
(
phaseSystem::phasePairTable,
this->phasePairs_,
phasePairIter
)
{
if
(
this->heatTransferModels_.found(phasePairIter.key())
)
{
const phasePair& pair(phasePairIter());
if (pair.ordered())
{
continue;
}
const phaseModel& phase1 = pair.phase1();
const phaseModel& phase2 = pair.phase2();
const volScalarField& T1(phase1.thermo().T());
const volScalarField& T2(phase2.thermo().T());
volScalarField& Tf(*this->Tf_[pair]);
volScalarField H1
(
this->heatTransferModels_[pair][pair.first()]->K()
);
volScalarField H2
(
this->heatTransferModels_[pair][pair.second()]->K()
);
// Limit the H[12] to avoid /0
H1.max(small);
H2.max(small);
Tf = (H1*T1 + H2*T2)/(H1 + H2);
Info<< "Tf." << pair.name()
<< ": min = " << min(Tf.primitiveField())
<< ", mean = " << average(Tf.primitiveField())
<< ", max = " << max(Tf.primitiveField())
<< endl;
}
}
}
template<class BasePhaseSystem>
bool Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::read()
{
if (BasePhaseSystem::read())
{
bool readOK = true;
// Models ...
return readOK;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -25,6 +25,7 @@ License
#include "InterfaceCompositionPhaseChangePhaseSystem.H" #include "InterfaceCompositionPhaseChangePhaseSystem.H"
#include "interfaceCompositionModel.H" #include "interfaceCompositionModel.H"
#include "massTransferModel.H"
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
@ -65,6 +66,68 @@ InterfaceCompositionPhaseChangePhaseSystem
interfaceCompositionModels_ interfaceCompositionModels_
); );
this->generatePairsAndSubModels
(
"massTransfer",
massTransferModels_,
false
);
// Check that models have been specified in the correct combinations
forAllConstIter
(
interfaceCompositionModelTable,
interfaceCompositionModels_,
interfaceCompositionModelIter
)
{
const phasePair& pair =
this->phasePairs_[interfaceCompositionModelIter.key()];
if (!pair.ordered())
{
FatalErrorInFunction
<< "An interfacial composition model is specified for the "
<< "unordered " << pair << " pair. Composition models only "
<< "apply to ordered pairs. A entry for an "
<< phasePairKey("A", "B", true) << " pair means a model for "
<< "the A side of the A-B interface; i.e., \"A in the presence "
<< "of B\""
<< exit(FatalError);
}
const phasePairKey key(pair.phase1().name(), pair.phase2().name());
if (!massTransferModels_[key][pair.index(pair.phase1())].valid())
{
FatalErrorInFunction
<< "A species transfer model for the " << pair.phase1().name()
<< " side of the " << key << " pair is not specified. This is "
<< "required by the corresponding interface composition model."
<< exit(FatalError);
}
}
forAllConstIter
(
massTransferModelTable,
massTransferModels_,
massTransferModelIter
)
{
const phasePair& pair =
this->phasePairs_[massTransferModelIter.key()];
if (!this->heatTransferModels_.found(pair))
{
FatalErrorInFunction
<< "A Heat transfer model for " << pair << " pair is not "
<< "specified. This is required by the corresponding species "
<< "transfer model"
<< exit(FatalError);
}
}
// Generate mass transfer fields, set to zero
forAllConstIter forAllConstIter
( (
phaseSystem::phasePairTable, phaseSystem::phasePairTable,
@ -157,66 +220,6 @@ Foam::InterfaceCompositionPhaseChangePhaseSystem<BasePhaseSystem>::dmdts() const
} }
template<class BasePhaseSystem>
Foam::autoPtr<Foam::phaseSystem::heatTransferTable>
Foam::InterfaceCompositionPhaseChangePhaseSystem<BasePhaseSystem>::
heatTransfer() const
{
autoPtr<phaseSystem::heatTransferTable> eqnsPtr =
BasePhaseSystem::heatTransfer();
phaseSystem::heatTransferTable& eqns = eqnsPtr();
// Source term due to mass transfer
forAllConstIter
(
phaseSystem::phasePairTable,
this->phasePairs_,
phasePairIter
)
{
if
(
this->heatTransferModels_.found(phasePairIter.key())
)
{
const phasePair& pair(phasePairIter());
if (pair.ordered())
{
continue;
}
const phaseModel& phase1 = pair.phase1();
const phaseModel& phase2 = pair.phase2();
const volScalarField& he1(phase1.thermo().he());
const volScalarField& he2(phase2.thermo().he());
const volScalarField K1(phase1.K());
const volScalarField K2(phase2.K());
const volScalarField dmdt(this->dmdt(pair));
const volScalarField dmdt21(posPart(dmdt));
const volScalarField dmdt12(negPart(dmdt));
const volScalarField& Tf(*this->Tf_[pair]);
*eqns[phase1.name()] +=
dmdt21*(phase1.thermo().he(phase1.thermo().p(), Tf))
- fvm::Sp(dmdt21, he1)
+ dmdt21*(K2 - K1);
*eqns[phase2.name()] -=
dmdt12*(phase2.thermo().he(phase2.thermo().p(), Tf))
- fvm::Sp(dmdt12, he2)
+ dmdt12*(K1 - K2);
}
}
return eqnsPtr;
}
template<class BasePhaseSystem> template<class BasePhaseSystem>
Foam::autoPtr<Foam::phaseSystem::massTransferTable> Foam::autoPtr<Foam::phaseSystem::massTransferTable>
Foam::InterfaceCompositionPhaseChangePhaseSystem<BasePhaseSystem>:: Foam::InterfaceCompositionPhaseChangePhaseSystem<BasePhaseSystem>::
@ -262,10 +265,8 @@ massTransfer() const
interfaceCompositionModelIter() interfaceCompositionModelIter()
); );
const phasePair& pair const phasePair& pair =
( this->phasePairs_[interfaceCompositionModelIter.key()];
this->phasePairs_[interfaceCompositionModelIter.key()]
);
const phaseModel& phase = pair.phase1(); const phaseModel& phase = pair.phase1();
const phaseModel& otherPhase = pair.phase2(); const phaseModel& otherPhase = pair.phase2();
const phasePairKey key(phase.name(), otherPhase.name()); const phasePairKey key(phase.name(), otherPhase.name());
@ -279,7 +280,7 @@ massTransfer() const
const volScalarField K const volScalarField K
( (
this->massTransferModels_[key][phase.name()]->K() massTransferModels_[key][pair.index(phase)]->K()
); );
forAllConstIter forAllConstIter
@ -335,10 +336,8 @@ massTransfer() const
template<class BasePhaseSystem> template<class BasePhaseSystem>
void Foam::InterfaceCompositionPhaseChangePhaseSystem<BasePhaseSystem>:: void Foam::InterfaceCompositionPhaseChangePhaseSystem<BasePhaseSystem>::
correctThermo() correctInterfaceThermo()
{ {
phaseSystem::correctThermo();
// This loop solves for the interface temperatures, Tf, and updates the // This loop solves for the interface temperatures, Tf, and updates the
// interface composition models. // interface composition models.
// //
@ -353,23 +352,19 @@ correctThermo()
forAllConstIter forAllConstIter
( (
phaseSystem::phasePairTable, massTransferModelTable,
this->phasePairs_, massTransferModels_,
phasePairIter massTransferModelIter
) )
{ {
const phasePair& pair(phasePairIter()); const phasePair& pair =
this->phasePairs_[massTransferModelIter.key()];
if (pair.ordered())
{
continue;
}
const phasePairKey key12(pair.first(), pair.second(), true); const phasePairKey key12(pair.first(), pair.second(), true);
const phasePairKey key21(pair.second(), pair.first(), true); const phasePairKey key21(pair.second(), pair.first(), true);
volScalarField H1(this->heatTransferModels_[pair][pair.first()]->K()); volScalarField H1(this->heatTransferModels_[pair].first()->K());
volScalarField H2(this->heatTransferModels_[pair][pair.second()]->K()); volScalarField H2(this->heatTransferModels_[pair].second()->K());
dimensionedScalar HSmall("small", heatTransferModel::dimK, small); dimensionedScalar HSmall("small", heatTransferModel::dimK, small);
volScalarField mDotL volScalarField mDotL
@ -402,7 +397,7 @@ correctThermo()
{ {
this->interfaceCompositionModels_[key12]->addMDotL this->interfaceCompositionModels_[key12]->addMDotL
( (
this->massTransferModels_[pair][pair.first()]->K(), massTransferModelIter().first()->K(),
Tf, Tf,
mDotL, mDotL,
mDotLPrime mDotLPrime
@ -412,7 +407,7 @@ correctThermo()
{ {
this->interfaceCompositionModels_[key21]->addMDotL this->interfaceCompositionModels_[key21]->addMDotL
( (
this->massTransferModels_[pair][pair.second()]->K(), massTransferModelIter().second()->K(),
Tf, Tf,
mDotL, mDotL,
mDotLPrime mDotLPrime

View File

@ -48,6 +48,7 @@ namespace Foam
{ {
class interfaceCompositionModel; class interfaceCompositionModel;
class massTransferModel;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class InterfaceCompositionPhaseChangePhaseSystem Declaration Class InterfaceCompositionPhaseChangePhaseSystem Declaration
@ -69,6 +70,13 @@ protected:
phasePairKey::hash phasePairKey::hash
> interfaceCompositionModelTable; > interfaceCompositionModelTable;
typedef HashTable
<
Pair<autoPtr<BlendedInterfacialModel<massTransferModel>>>,
phasePairKey,
phasePairKey::hash
> massTransferModelTable;
typedef HashPtrTable<volScalarField, phasePairKey, phasePairKey::hash> typedef HashPtrTable<volScalarField, phasePairKey, phasePairKey::hash>
iDmdtTable; iDmdtTable;
@ -77,6 +85,9 @@ protected:
// Sub Models // Sub Models
//- Mass transfer models
massTransferModelTable massTransferModels_;
//- Interface composition models //- Interface composition models
interfaceCompositionModelTable interfaceCompositionModels_; interfaceCompositionModelTable interfaceCompositionModels_;
@ -113,14 +124,11 @@ public:
//- Return the mass transfer rates for each phase //- Return the mass transfer rates for each phase
virtual Xfer<PtrList<volScalarField>> dmdts() const; virtual Xfer<PtrList<volScalarField>> dmdts() const;
//- Return the heat transfer matrices
virtual autoPtr<phaseSystem::heatTransferTable> heatTransfer() const;
//- Return the mass transfer matrices //- Return the mass transfer matrices
virtual autoPtr<phaseSystem::massTransferTable> massTransfer() const; virtual autoPtr<phaseSystem::massTransferTable> massTransfer() const;
//- Correct the thermodynamics //- Correct the thermodynamics
virtual void correctThermo(); virtual void correctInterfaceThermo();
//- Read base phaseProperties dictionary //- Read base phaseProperties dictionary
virtual bool read(); virtual bool read();

View File

@ -23,27 +23,34 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "HeatTransferPhaseSystem.H" #include "OneResistanceHeatTransferPhaseSystem.H"
#include "fvmSup.H" #include "fvmSup.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BasePhaseSystem> template<class BasePhaseSystem>
Foam::HeatTransferPhaseSystem<BasePhaseSystem>::HeatTransferPhaseSystem Foam::OneResistanceHeatTransferPhaseSystem<BasePhaseSystem>::
OneResistanceHeatTransferPhaseSystem
( (
const fvMesh& mesh const fvMesh& mesh
) )
: :
BasePhaseSystem(mesh) BasePhaseSystem(mesh)
{ {
this->generatePairsAndSubModels("heatTransfer", heatTransferModels_); this->generatePairsAndSubModels
(
"heatTransfer",
heatTransferModels_,
false
);
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class BasePhaseSystem> template<class BasePhaseSystem>
Foam::HeatTransferPhaseSystem<BasePhaseSystem>::~HeatTransferPhaseSystem() Foam::OneResistanceHeatTransferPhaseSystem<BasePhaseSystem>::
~OneResistanceHeatTransferPhaseSystem()
{} {}
@ -51,7 +58,8 @@ Foam::HeatTransferPhaseSystem<BasePhaseSystem>::~HeatTransferPhaseSystem()
template<class BasePhaseSystem> template<class BasePhaseSystem>
Foam::autoPtr<Foam::phaseSystem::heatTransferTable> Foam::autoPtr<Foam::phaseSystem::heatTransferTable>
Foam::HeatTransferPhaseSystem<BasePhaseSystem>::heatTransfer() const Foam::OneResistanceHeatTransferPhaseSystem<BasePhaseSystem>::
heatTransfer() const
{ {
autoPtr<phaseSystem::heatTransferTable> eqnsPtr autoPtr<phaseSystem::heatTransferTable> eqnsPtr
( (
@ -71,6 +79,7 @@ Foam::HeatTransferPhaseSystem<BasePhaseSystem>::heatTransfer() const
); );
} }
// Heat transfer across the interface
forAllConstIter forAllConstIter
( (
heatTransferModelTable, heatTransferModelTable,
@ -96,25 +105,47 @@ Foam::HeatTransferPhaseSystem<BasePhaseSystem>::heatTransfer() const
} }
} }
return eqnsPtr; // Source term due to mass transfer
} forAllConstIter
template<class BasePhaseSystem>
Foam::autoPtr<Foam::phaseSystem::massTransferTable>
Foam::HeatTransferPhaseSystem<BasePhaseSystem>::massTransfer() const
{
autoPtr<phaseSystem::massTransferTable> eqnsPtr
( (
new phaseSystem::massTransferTable() phaseSystem::phasePairTable,
); this->phasePairs_,
phasePairIter
)
{
const phasePair& pair(phasePairIter());
if (pair.ordered())
{
continue;
}
const phaseModel& phase1 = pair.phase1();
const phaseModel& phase2 = pair.phase2();
const volScalarField& he1(phase1.thermo().he());
const volScalarField& he2(phase2.thermo().he());
const volScalarField K1(phase1.K());
const volScalarField K2(phase2.K());
const volScalarField dmdt(this->dmdt(pair));
const volScalarField dmdt21(posPart(dmdt));
const volScalarField dmdt12(negPart(dmdt));
*eqns[phase1.name()] +=
dmdt21*he2 - fvm::Sp(dmdt21, he1) + dmdt21*(K2 - K1);
*eqns[phase2.name()] -=
dmdt12*he1 - fvm::Sp(dmdt12, he2) + dmdt12*(K1 - K2);
}
return eqnsPtr; return eqnsPtr;
} }
template<class BasePhaseSystem> template<class BasePhaseSystem>
bool Foam::HeatTransferPhaseSystem<BasePhaseSystem>::read() bool Foam::OneResistanceHeatTransferPhaseSystem<BasePhaseSystem>::read()
{ {
if (BasePhaseSystem::read()) if (BasePhaseSystem::read())
{ {

View File

@ -22,18 +22,22 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::HeatTransferPhaseSystem Foam::OneResistanceHeatTransferPhaseSystem
Description Description
Class which models interfacial heat transfer between a number of phases. Class which models interfacial heat transfer between a number of phases. A
single heat transfer model is used for each interface.
See also
TwoResistanceHeatTransferPhaseSystem
SourceFiles SourceFiles
HeatTransferPhaseSystem.C OneResistanceHeatTransferPhaseSystem.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef HeatTransferPhaseSystem_H #ifndef OneResistanceHeatTransferPhaseSystem_H
#define HeatTransferPhaseSystem_H #define OneResistanceHeatTransferPhaseSystem_H
#include "phaseSystem.H" #include "phaseSystem.H"
@ -47,11 +51,11 @@ template<class modelType> class BlendedInterfacialModel;
class heatTransferModel; class heatTransferModel;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class HeatTransferPhaseSystem Declaration Class OneResistanceHeatTransferPhaseSystem Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class BasePhaseSystem> template<class BasePhaseSystem>
class HeatTransferPhaseSystem class OneResistanceHeatTransferPhaseSystem
: :
public BasePhaseSystem public BasePhaseSystem
{ {
@ -80,11 +84,11 @@ public:
// Constructors // Constructors
//- Construct from fvMesh //- Construct from fvMesh
HeatTransferPhaseSystem(const fvMesh&); OneResistanceHeatTransferPhaseSystem(const fvMesh&);
//- Destructor //- Destructor
virtual ~HeatTransferPhaseSystem(); virtual ~OneResistanceHeatTransferPhaseSystem();
// Member Functions // Member Functions
@ -92,9 +96,6 @@ public:
//- Return the heat transfer matrices //- Return the heat transfer matrices
virtual autoPtr<phaseSystem::heatTransferTable> heatTransfer() const; virtual autoPtr<phaseSystem::heatTransferTable> heatTransfer() const;
//- Return the mass transfer matrices
virtual autoPtr<phaseSystem::massTransferTable> massTransfer() const;
//- Read base phaseProperties dictionary //- Read base phaseProperties dictionary
virtual bool read(); virtual bool read();
}; };
@ -107,7 +108,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
#include "HeatTransferPhaseSystem.C" #include "OneResistanceHeatTransferPhaseSystem.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,244 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "PhaseTransferPhaseSystem.H"
#include "phaseTransferModel.H"
#include "fvmSup.H"
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
template<class BasePhaseSystem>
Foam::tmp<Foam::volScalarField>
Foam::PhaseTransferPhaseSystem<BasePhaseSystem>::rDmdt
(
const phasePairKey& key
) const
{
if (!rDmdt_.found(key))
{
return phaseSystem::dmdt(key);
}
const scalar rDmdtSign(Pair<word>::compare(rDmdt_.find(key).key(), key));
return rDmdtSign**rDmdt_[key];
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BasePhaseSystem>
Foam::PhaseTransferPhaseSystem<BasePhaseSystem>::PhaseTransferPhaseSystem
(
const fvMesh& mesh
)
:
BasePhaseSystem(mesh)
{
this->generatePairsAndSubModels
(
"phaseTransfer",
phaseTransferModels_,
false
);
forAllConstIter
(
phaseTransferModelTable,
phaseTransferModels_,
phaseTransferModelIter
)
{
this->rDmdt_.insert
(
phaseTransferModelIter.key(),
phaseSystem::dmdt(phaseTransferModelIter.key()).ptr()
);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class BasePhaseSystem>
Foam::PhaseTransferPhaseSystem<BasePhaseSystem>::
~PhaseTransferPhaseSystem()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class BasePhaseSystem>
Foam::tmp<Foam::volScalarField>
Foam::PhaseTransferPhaseSystem<BasePhaseSystem>::dmdt
(
const phasePairKey& key
) const
{
return BasePhaseSystem::dmdt(key) + this->rDmdt(key);
}
template<class BasePhaseSystem>
Foam::Xfer<Foam::PtrList<Foam::volScalarField>>
Foam::PhaseTransferPhaseSystem<BasePhaseSystem>::dmdts() const
{
PtrList<volScalarField> dmdts(BasePhaseSystem::dmdts());
forAllConstIter(rDmdtTable, rDmdt_, rDmdtIter)
{
const phasePair& pair = this->phasePairs_[rDmdtIter.key()];
const volScalarField& rDmdt = *rDmdtIter();
this->addField(pair.phase1(), "dmdt", rDmdt, dmdts);
this->addField(pair.phase2(), "dmdt", - rDmdt, dmdts);
}
return dmdts.xfer();
}
template<class BasePhaseSystem>
Foam::autoPtr<Foam::phaseSystem::massTransferTable>
Foam::PhaseTransferPhaseSystem<BasePhaseSystem>::massTransfer() const
{
// Create a mass transfer matrix for each species of each phase
autoPtr<phaseSystem::massTransferTable> eqnsPtr
(
new phaseSystem::massTransferTable()
);
phaseSystem::massTransferTable& eqns = eqnsPtr();
forAll(this->phaseModels_, phasei)
{
const phaseModel& phase = this->phaseModels_[phasei];
const PtrList<volScalarField>& Yi = phase.Y();
forAll(Yi, i)
{
eqns.insert
(
Yi[i].name(),
new fvScalarMatrix(Yi[i], dimMass/dimTime)
);
}
}
// Mass transfer across the interface
forAllConstIter
(
phaseTransferModelTable,
phaseTransferModels_,
phaseTransferModelIter
)
{
const phasePair& pair(this->phasePairs_[phaseTransferModelIter.key()]);
const phaseModel& phase = pair.phase1();
const phaseModel& otherPhase = pair.phase2();
const volScalarField dmdt(this->rDmdt(pair));
const volScalarField dmdt12(posPart(dmdt));
const volScalarField dmdt21(negPart(dmdt));
const PtrList<volScalarField>& Yi = phase.Y();
forAll(Yi, i)
{
const word name
(
IOobject::groupName(Yi[i].member(), phase.name())
);
const word otherName
(
IOobject::groupName(Yi[i].member(), otherPhase.name())
);
*eqns[name] +=
dmdt21*eqns[otherName]->psi()
- fvm::Sp(dmdt21, eqns[name]->psi());
*eqns[otherName] -=
dmdt12*eqns[name]->psi()
- fvm::Sp(dmdt12, eqns[otherName]->psi());
}
}
return eqnsPtr;
}
template<class BasePhaseSystem>
void Foam::PhaseTransferPhaseSystem<BasePhaseSystem>::correct()
{
BasePhaseSystem::correct();
forAllConstIter
(
phaseTransferModelTable,
phaseTransferModels_,
phaseTransferModelIter
)
{
*rDmdt_[phaseTransferModelIter.key()] =
dimensionedScalar("zero", dimDensity/dimTime, 0);
}
forAllConstIter
(
phaseTransferModelTable,
phaseTransferModels_,
phaseTransferModelIter
)
{
*rDmdt_[phaseTransferModelIter.key()] +=
phaseTransferModelIter()->dmdt();
}
}
template<class BasePhaseSystem>
bool Foam::PhaseTransferPhaseSystem<BasePhaseSystem>::read()
{
if (BasePhaseSystem::read())
{
bool readOK = true;
// Models ...
return readOK;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,135 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::MassTransferTransferPhaseSystem
Description
Class which models non-thermally-coupled mass transfers; i.e.,
representation changes, rather than phase changes.
SourceFiles
PhaseTransferPhaseSystem.C
\*---------------------------------------------------------------------------*/
#ifndef PhaseTransferPhaseSystem_H
#define PhaseTransferPhaseSystem_H
#include "phaseSystem.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class blendingMethod;
template<class modelType> class BlendedInterfacialModel;
class phaseTransferModel;
/*---------------------------------------------------------------------------*\
Class PhaseTransferPhaseSystem Declaration
\*---------------------------------------------------------------------------*/
template<class BasePhaseSystem>
class PhaseTransferPhaseSystem
:
public BasePhaseSystem
{
protected:
// Protected typedefs
typedef HashTable
<
autoPtr<BlendedInterfacialModel<phaseTransferModel>>,
phasePairKey,
phasePairKey::hash
> phaseTransferModelTable;
typedef HashPtrTable<volScalarField, phasePairKey, phasePairKey::hash>
rDmdtTable;
// Protected data
// Sub Models
//- Mass transfer models
phaseTransferModelTable phaseTransferModels_;
//- Mass transfer rates
rDmdtTable rDmdt_;
// Protected member functions
//- Return the representation mass transfer rate
virtual tmp<volScalarField> rDmdt(const phasePairKey& key) const;
public:
// Constructors
//- Construct from fvMesh
PhaseTransferPhaseSystem(const fvMesh&);
//- Destructor
virtual ~PhaseTransferPhaseSystem();
// Member Functions
//- Return the mass transfer rate for a pair
virtual tmp<volScalarField> dmdt(const phasePairKey& key) const;
//- Return the mass transfer rates for each phase
virtual Xfer<PtrList<volScalarField>> dmdts() const;
//- Return the mass transfer matrices
virtual autoPtr<phaseSystem::massTransferTable> massTransfer() const;
//- Correct the mass transfer rates
virtual void correct();
//- Read base phaseProperties dictionary
virtual bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "PhaseTransferPhaseSystem.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -166,45 +166,6 @@ Foam::PopulationBalancePhaseSystem<BasePhaseSystem>::dmdts() const
} }
template<class BasePhaseSystem>
Foam::autoPtr<Foam::phaseSystem::massTransferTable>
Foam::PopulationBalancePhaseSystem<BasePhaseSystem>::heatTransfer() const
{
autoPtr<phaseSystem::heatTransferTable> eqnsPtr =
BasePhaseSystem::heatTransfer();
phaseSystem::heatTransferTable& eqns = eqnsPtr();
// Source term due to mass trasfer
forAllConstIter
(
phaseSystem::phasePairTable,
this->phasePairs_,
phasePairIter
)
{
const phasePair& pair(phasePairIter());
if (pair.ordered())
{
continue;
}
const volScalarField& he1(pair.phase1().thermo().he());
const volScalarField& he2(pair.phase2().thermo().he());
const volScalarField dmdt(this->pDmdt(pair));
const volScalarField dmdt21(posPart(dmdt));
const volScalarField dmdt12(negPart(dmdt));
*eqns[pair.phase1().name()] += dmdt21*he2 - fvm::Sp(dmdt21, he1);
*eqns[pair.phase2().name()] -= dmdt12*he1 - fvm::Sp(dmdt12, he2);
}
return eqnsPtr;
}
template<class BasePhaseSystem> template<class BasePhaseSystem>
Foam::autoPtr<Foam::phaseSystem::massTransferTable> Foam::autoPtr<Foam::phaseSystem::massTransferTable>
Foam::PopulationBalancePhaseSystem<BasePhaseSystem>::massTransfer() const Foam::PopulationBalancePhaseSystem<BasePhaseSystem>::massTransfer() const

View File

@ -38,10 +38,7 @@ SourceFiles
#ifndef PopulationBalancePhaseSystem_H #ifndef PopulationBalancePhaseSystem_H
#define PopulationBalancePhaseSystem_H #define PopulationBalancePhaseSystem_H
#include "HeatAndMassTransferPhaseSystem.H" #include "phaseSystem.H"
#include "saturationModel.H"
#include "Switch.H"
#include "populationBalanceModel.H" #include "populationBalanceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -101,9 +98,6 @@ public:
//- Return the mass transfer rates for each phase //- Return the mass transfer rates for each phase
virtual Xfer<PtrList<volScalarField>> dmdts() const; virtual Xfer<PtrList<volScalarField>> dmdts() const;
//- Return the heat transfer matrices
virtual autoPtr<phaseSystem::heatTransferTable> heatTransfer() const;
//- Return the mass transfer matrices //- Return the mass transfer matrices
virtual autoPtr<phaseSystem::massTransferTable> massTransfer() const; virtual autoPtr<phaseSystem::massTransferTable> massTransfer() const;

View File

@ -81,7 +81,7 @@ ThermalPhaseChangePhaseSystem
( (
saturationModel::New(this->subDict("saturationModel"), mesh) saturationModel::New(this->subDict("saturationModel"), mesh)
), ),
massTransfer_(this->lookup("massTransfer")) phaseChange_(this->lookup("phaseChange"))
{ {
forAllConstIter forAllConstIter
@ -224,7 +224,7 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::heatTransfer() const
phaseSystem::heatTransferTable& eqns = eqnsPtr(); phaseSystem::heatTransferTable& eqns = eqnsPtr();
// Source term due to mass transfer // Add boundary term
forAllConstIter forAllConstIter
( (
phaseSystem::phasePairTable, phaseSystem::phasePairTable,
@ -232,10 +232,7 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::heatTransfer() const
phasePairIter phasePairIter
) )
{ {
if if (this->wMDotL_.found(phasePairIter.key()))
(
this->heatTransferModels_.found(phasePairIter.key())
)
{ {
const phasePair& pair(phasePairIter()); const phasePair& pair(phasePairIter());
@ -247,27 +244,6 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::heatTransfer() const
const phaseModel& phase1 = pair.phase1(); const phaseModel& phase1 = pair.phase1();
const phaseModel& phase2 = pair.phase2(); const phaseModel& phase2 = pair.phase2();
const volScalarField& he1(phase1.thermo().he());
const volScalarField& he2(phase2.thermo().he());
const volScalarField& K1(phase1.K());
const volScalarField& K2(phase2.K());
const volScalarField dmdt(this->dmdt(pair));
const volScalarField dmdt21(posPart(dmdt));
const volScalarField dmdt12(negPart(dmdt));
const volScalarField& Tf(*this->Tf_[pair]);
*eqns[phase1.name()] +=
dmdt21*(phase1.thermo().he(phase1.thermo().p(), Tf))
- fvm::Sp(dmdt21, he1)
+ dmdt21*(K2 - K1);
*eqns[phase2.name()] -=
dmdt12*(phase2.thermo().he(phase2.thermo().p(), Tf))
- fvm::Sp(dmdt12, he2)
+ dmdt12*(K1 - K2);
*eqns[phase1.name()] += negPart(*this->wMDotL_[pair]); *eqns[phase1.name()] += negPart(*this->wMDotL_[pair]);
*eqns[phase2.name()] -= posPart(*this->wMDotL_[pair]); *eqns[phase2.name()] -= posPart(*this->wMDotL_[pair]);
} }
@ -299,6 +275,7 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::massTransfer() const
{ {
continue; continue;
} }
const phaseModel& phase = pair.phase1(); const phaseModel& phase = pair.phase1();
const phaseModel& otherPhase = pair.phase2(); const phaseModel& otherPhase = pair.phase2();
@ -336,31 +313,23 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::massTransfer() const
template<class BasePhaseSystem> template<class BasePhaseSystem>
void Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctThermo() void
Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctInterfaceThermo()
{ {
typedef compressible::alphatPhaseChangeWallFunctionFvPatchScalarField typedef compressible::alphatPhaseChangeWallFunctionFvPatchScalarField
alphatPhaseChangeWallFunction; alphatPhaseChangeWallFunction;
phaseSystem::correctThermo();
forAllConstIter forAllConstIter
( (
phaseSystem::phasePairTable, typename BasePhaseSystem::heatTransferModelTable,
this->phasePairs_, this->heatTransferModels_,
phasePairIter heatTransferModelIter
) )
{ {
if const phasePair& pair
( (
this->heatTransferModels_.found(phasePairIter.key()) this->phasePairs_[heatTransferModelIter.key()]
) );
{
const phasePair& pair(phasePairIter());
if (pair.ordered())
{
continue;
}
const phaseModel& phase1 = pair.phase1(); const phaseModel& phase1 = pair.phase1();
const phaseModel& phase2 = pair.phase2(); const phaseModel& phase2 = pair.phase2();
@ -385,37 +354,22 @@ void Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctThermo()
volScalarField iDmdtNew(iDmdt); volScalarField iDmdtNew(iDmdt);
if (massTransfer_ ) if (phaseChange_)
{ {
volScalarField H1 volScalarField H1(heatTransferModelIter().first()->K(0));
( volScalarField H2(heatTransferModelIter().second()->K(0));
this->heatTransferModels_[pair][pair.first()]->K(0)
);
volScalarField H2
(
this->heatTransferModels_[pair][pair.second()]->K(0)
);
Tf = saturationModel_->Tsat(phase1.thermo().p()); Tf = saturationModel_->Tsat(phase1.thermo().p());
iDmdtNew = iDmdtNew = (H1*(Tf - T1) + H2*(Tf - T2))/L;
(H1*(Tf - T1) + H2*(Tf - T2))/L;
} }
else else
{ {
iDmdtNew == dimensionedScalar("0", iDmdt.dimensions(), 0); iDmdtNew == dimensionedScalar("0", iDmdt.dimensions(), 0);
} }
volScalarField H1 volScalarField H1(heatTransferModelIter().first()->K());
( volScalarField H2(heatTransferModelIter().second()->K());
this->heatTransferModels_[pair][pair.first()]->K()
);
volScalarField H2
(
this->heatTransferModels_[pair][pair.second()]->K()
);
// Limit the H[12] to avoid /0 // Limit the H[12] to avoid /0
H1.max(small); H1.max(small);
@ -432,7 +386,7 @@ void Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctThermo()
scalar iDmdtRelax(this->mesh().fieldRelaxationFactor("iDmdt")); scalar iDmdtRelax(this->mesh().fieldRelaxationFactor("iDmdt"));
iDmdt = (1 - iDmdtRelax)*iDmdt + iDmdtRelax*iDmdtNew; iDmdt = (1 - iDmdtRelax)*iDmdt + iDmdtRelax*iDmdtNew;
if (massTransfer_ ) if (phaseChange_)
{ {
Info<< "iDmdt." << pair.name() Info<< "iDmdt." << pair.name()
<< ": min = " << min(iDmdt.primitiveField()) << ": min = " << min(iDmdt.primitiveField())
@ -526,7 +480,6 @@ void Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctThermo()
<< endl; << endl;
} }
} }
}
} }

View File

@ -78,8 +78,8 @@ protected:
//- The saturation model used to evaluate Tsat = Tf //- The saturation model used to evaluate Tsat = Tf
autoPtr<saturationModel> saturationModel_; autoPtr<saturationModel> saturationModel_;
// Mass transfer enabled // Phase change enabled
Switch massTransfer_; Switch phaseChange_;
//- Interfacial Mass transfer rate //- Interfacial Mass transfer rate
iDmdtTable iDmdt_; iDmdtTable iDmdt_;
@ -129,8 +129,8 @@ public:
//- Return the mass transfer matrices //- Return the mass transfer matrices
virtual autoPtr<phaseSystem::massTransferTable> massTransfer() const; virtual autoPtr<phaseSystem::massTransferTable> massTransfer() const;
//- Correct the thermodynamics //- Correct the interface thermodynamics
virtual void correctThermo(); virtual void correctInterfaceThermo();
//- Read base phaseProperties dictionary //- Read base phaseProperties dictionary
virtual bool read(); virtual bool read();

View File

@ -0,0 +1,339 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "TwoResistanceHeatTransferPhaseSystem.H"
#include "BlendedInterfacialModel.H"
#include "heatTransferModel.H"
#include "HashPtrTable.H"
#include "fvcDiv.H"
#include "fvmSup.H"
#include "fvMatrix.H"
#include "zeroGradientFvPatchFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BasePhaseSystem>
Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>::
TwoResistanceHeatTransferPhaseSystem
(
const fvMesh& mesh
)
:
BasePhaseSystem(mesh)
{
this->generatePairsAndSubModels
(
"heatTransfer",
heatTransferModels_,
false
);
// Check that models have been specified on both sides of the interfaces
forAllConstIter
(
heatTransferModelTable,
heatTransferModels_,
heatTransferModelIter
)
{
const phasePair& pair = this->phasePairs_[heatTransferModelIter.key()];
if (!heatTransferModels_[pair].first().valid())
{
FatalErrorInFunction
<< "A heat transfer model for the " << pair.phase1().name()
<< " side of the " << pair << " pair is not specified"
<< exit(FatalError);
}
if (!heatTransferModels_[pair].second().valid())
{
FatalErrorInFunction
<< "A heat transfer model for the " << pair.phase2().name()
<< " side of the " << pair << " pair is not specified"
<< exit(FatalError);
}
}
// Calculate initial Tf-s as if there is no mass transfer
forAllConstIter
(
heatTransferModelTable,
heatTransferModels_,
heatTransferModelIter
)
{
const phasePair& pair = this->phasePairs_[heatTransferModelIter.key()];
const phaseModel& phase1 = pair.phase1();
const phaseModel& phase2 = pair.phase2();
const volScalarField& T1(phase1.thermo().T());
const volScalarField& T2(phase2.thermo().T());
volScalarField H1(heatTransferModels_[pair].first()->K());
volScalarField H2(heatTransferModels_[pair].second()->K());
dimensionedScalar HSmall("small", heatTransferModel::dimK, small);
Tf_.insert
(
pair,
new volScalarField
(
IOobject
(
IOobject::groupName("Tf", pair.name()),
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
(H1*T1 + H2*T2)/max(H1 + H2, HSmall)
)
);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class BasePhaseSystem>
Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>::
~TwoResistanceHeatTransferPhaseSystem()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class BasePhaseSystem>
Foam::autoPtr<Foam::phaseSystem::heatTransferTable>
Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>::
heatTransfer() const
{
autoPtr<phaseSystem::heatTransferTable> eqnsPtr
(
new phaseSystem::heatTransferTable()
);
phaseSystem::heatTransferTable& eqns = eqnsPtr();
forAll(this->phaseModels_, phasei)
{
const phaseModel& phase = this->phaseModels_[phasei];
eqns.insert
(
phase.name(),
new fvScalarMatrix(phase.thermo().he(), dimEnergy/dimTime)
);
}
// Heat transfer with the interface
forAllConstIter
(
heatTransferModelTable,
heatTransferModels_,
heatTransferModelIter
)
{
const phasePair& pair
(
this->phasePairs_[heatTransferModelIter.key()]
);
const volScalarField& Tf(*Tf_[pair]);
const Pair<tmp<volScalarField>> Ks
(
heatTransferModelIter().first()->K(),
heatTransferModelIter().second()->K()
);
const volScalarField KEff
(
Ks.first()()*Ks.second()()
/max
(
Ks.first()() + Ks.second()(),
dimensionedScalar("small", heatTransferModel::dimK, small)
)
);
forAllConstIter(phasePair, pair, iter)
{
const phaseModel& phase = iter();
const volScalarField& he(phase.thermo().he());
const volScalarField Cpv(phase.thermo().Cpv());
*eqns[phase.name()] +=
Ks[iter.index()]*(Tf - phase.thermo().T())
+ KEff/Cpv*he - fvm::Sp(KEff/Cpv, he);
}
}
// Source term due to mass transfer
forAllConstIter
(
phaseSystem::phasePairTable,
this->phasePairs_,
phasePairIter
)
{
const phasePair& pair(phasePairIter());
if (pair.ordered())
{
continue;
}
const phaseModel& phase1 = pair.phase1();
const phaseModel& phase2 = pair.phase2();
const volScalarField& he1(phase1.thermo().he());
const volScalarField& he2(phase2.thermo().he());
const volScalarField K1(phase1.K());
const volScalarField K2(phase2.K());
const volScalarField dmdt(this->dmdt(pair));
const volScalarField dmdt21(posPart(dmdt));
const volScalarField dmdt12(negPart(dmdt));
*eqns[phase1.name()] += - fvm::Sp(dmdt21, he1) + dmdt21*(K2 - K1);
*eqns[phase2.name()] -= - fvm::Sp(dmdt12, he2) + dmdt12*(K1 - K2);
if (this->heatTransferModels_.found(phasePairIter.key()))
{
const volScalarField& Tf(*Tf_[pair]);
*eqns[phase1.name()] +=
dmdt21*phase1.thermo().he(phase1.thermo().p(), Tf);
*eqns[phase2.name()] -=
dmdt12*phase2.thermo().he(phase2.thermo().p(), Tf);
}
else
{
*eqns[phase1.name()] += dmdt21*he2;
*eqns[phase2.name()] -= dmdt12*he1;
}
}
return eqnsPtr;
}
template<class BasePhaseSystem>
void Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>::
correctThermo()
{
phaseSystem::correctThermo();
correctInterfaceThermo();
}
template<class BasePhaseSystem>
void Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>::
correctInterfaceThermo()
{
forAllConstIter
(
heatTransferModelTable,
heatTransferModels_,
heatTransferModelIter
)
{
const phasePair& pair
(
this->phasePairs_[heatTransferModelIter.key()]
);
const phaseModel& phase1 = pair.phase1();
const phaseModel& phase2 = pair.phase2();
const volScalarField& p(phase1.thermo().p());
const volScalarField& T1(phase1.thermo().T());
const volScalarField& T2(phase2.thermo().T());
volScalarField& Tf(*this->Tf_[pair]);
const volScalarField L
(
phase1.thermo().he(p, Tf) - phase2.thermo().he(p, Tf)
);
const volScalarField dmdt(this->dmdt(pair));
volScalarField H1
(
this->heatTransferModels_[pair].first()->K()
);
volScalarField H2
(
this->heatTransferModels_[pair].second()->K()
);
// Limit the H[12] to avoid /0
H1.max(small);
H2.max(small);
Tf = (H1*T1 + H2*T2 + dmdt*L)/(H1 + H2);
Info<< "Tf." << pair.name()
<< ": min = " << min(Tf.primitiveField())
<< ", mean = " << average(Tf.primitiveField())
<< ", max = " << max(Tf.primitiveField())
<< endl;
}
}
template<class BasePhaseSystem>
bool Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>::read()
{
if (BasePhaseSystem::read())
{
bool readOK = true;
// Models ...
return readOK;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -22,20 +22,25 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::HeatAndMassTransferPhaseSystem Foam::TwoResistanceHeatTransferPhaseSystem
Description Description
Base class to support interfacial heat and mass transfer between a number Class which models interfacial heat transfer between a number of phases.
of phases. Can be used on its own to simulate flows without mass transfer Two heat transfer models are stored at each interface, one for each phase.
with two-resistance interfacial heat trasnfer. This permits definition of an interface temperature with which heat transfer
occurs. It also allows derived systems to define other thermodynamic
properties at the interface and therefore represent phase changes.
See also
OneResistanceHeatTransferPhaseSystem
SourceFiles SourceFiles
HeatAndMassTransferPhaseSystem.C TwoResistanceHeatTransferPhaseSystem.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef HeatAndMassTransferPhaseSystem_H #ifndef TwoResistanceHeatTransferPhaseSystem_H
#define HeatAndMassTransferPhaseSystem_H #define TwoResistanceHeatTransferPhaseSystem_H
#include "phaseSystem.H" #include "phaseSystem.H"
@ -49,14 +54,13 @@ class BlendedInterfacialModel;
class blendingMethod; class blendingMethod;
class heatTransferModel; class heatTransferModel;
class massTransferModel;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class HeatAndMassTransferPhaseSystem Declaration Class TwoResistanceHeatTransferPhaseSystem Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class BasePhaseSystem> template<class BasePhaseSystem>
class HeatAndMassTransferPhaseSystem class TwoResistanceHeatTransferPhaseSystem
: :
public BasePhaseSystem public BasePhaseSystem
{ {
@ -66,24 +70,11 @@ protected:
typedef HashTable typedef HashTable
< <
HashTable Pair<autoPtr<BlendedInterfacialModel<heatTransferModel>>>,
<
autoPtr<BlendedInterfacialModel<heatTransferModel>>
>,
phasePairKey, phasePairKey,
phasePairKey::hash phasePairKey::hash
> heatTransferModelTable; > heatTransferModelTable;
typedef HashTable
<
HashTable
<
autoPtr<BlendedInterfacialModel<massTransferModel>>
>,
phasePairKey,
phasePairKey::hash
> massTransferModelTable;
// Protected data // Protected data
@ -95,34 +86,30 @@ protected:
//- Heat transfer models //- Heat transfer models
heatTransferModelTable heatTransferModels_; heatTransferModelTable heatTransferModels_;
//- Mass transfer models
massTransferModelTable massTransferModels_;
public: public:
// Constructors // Constructors
//- Construct from fvMesh //- Construct from fvMesh
HeatAndMassTransferPhaseSystem(const fvMesh&); TwoResistanceHeatTransferPhaseSystem(const fvMesh&);
//- Destructor //- Destructor
virtual ~HeatAndMassTransferPhaseSystem(); virtual ~TwoResistanceHeatTransferPhaseSystem();
// Member Functions // Member Functions
//- Return the heat transfer matrices //- Return the heat transfer matrices
virtual autoPtr<phaseSystem::heatTransferTable> virtual autoPtr<phaseSystem::heatTransferTable> heatTransfer() const;
heatTransfer() const;
//- Return the mass transfer matrices
virtual autoPtr<phaseSystem::massTransferTable> massTransfer() const;
//- Correct the thermodynamics //- Correct the thermodynamics
virtual void correctThermo(); virtual void correctThermo();
//- Correct the interface thermodynamics
virtual void correctInterfaceThermo();
//- Read base phaseProperties dictionary //- Read base phaseProperties dictionary
virtual bool read(); virtual bool read();
}; };
@ -135,7 +122,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
#include "HeatAndMassTransferPhaseSystem.C" #include "TwoResistanceHeatTransferPhaseSystem.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -164,6 +164,10 @@ public:
// the given phase // the given phase
inline const phaseModel& otherPhase(const phaseModel& phase) const; inline const phaseModel& otherPhase(const phaseModel& phase) const;
//- Return the index of the given phase. Generates a FatalError if
// this phasePair does not contain the given phase
inline label index(const phaseModel& phase) const;
//- Return gravitation acceleration //- Return gravitation acceleration
inline const uniformDimensionedVectorField& g() const; inline const uniformDimensionedVectorField& g() const;
@ -192,6 +196,12 @@ public:
inline explicit const_iterator(const phasePair&); inline explicit const_iterator(const phasePair&);
// Access
//- Return the current index
inline label index() const;
// Member operators // Member operators
inline bool operator==(const const_iterator&) const; inline bool operator==(const const_iterator&) const;

View File

@ -67,6 +67,27 @@ inline const Foam::phaseModel& Foam::phasePair::otherPhase
} }
inline Foam::label Foam::phasePair::index(const phaseModel& phase) const
{
if (&phase1_ == &phase)
{
return 0;
}
else if (&phase2_ == &phase)
{
return 1;
}
else
{
FatalErrorInFunction
<< "this phasePair does not contain phase " << phase.name()
<< exit(FatalError);
return -1;
}
}
inline const Foam::uniformDimensionedVectorField& Foam::phasePair::g() const inline const Foam::uniformDimensionedVectorField& Foam::phasePair::g() const
{ {
return g_; return g_;
@ -92,6 +113,12 @@ inline Foam::phasePair::const_iterator::const_iterator(const phasePair& pair)
{} {}
inline Foam::label Foam::phasePair::const_iterator::index() const
{
return index_;
}
inline bool Foam::phasePair::const_iterator::operator== inline bool Foam::phasePair::const_iterator::operator==
( (
const const_iterator& iter const const_iterator& iter

View File

@ -214,20 +214,22 @@ protected:
autoPtr<BlendedInterfacialModel<modelType>>, autoPtr<BlendedInterfacialModel<modelType>>,
phasePairKey, phasePairKey,
phasePairKey::hash phasePairKey::hash
>& models >& models,
const bool correctFixedFluxBCs = true
); );
//- Generate pairs and per-phase sub-model tables //- Generate pairs and two-sided sub-model tables
template<class modelType> template<class modelType>
void generatePairsAndSubModels void generatePairsAndSubModels
( (
const word& modelName, const word& modelName,
HashTable HashTable
< <
HashTable<autoPtr<modelType>>, Pair<autoPtr<modelType>>,
phasePairKey, phasePairKey,
phasePairKey::hash phasePairKey::hash
>& models >& models,
const bool correctFixedFluxBCs = true
); );
//- Add the field to a phase-indexed list, with the given name, //- Add the field to a phase-indexed list, with the given name,

View File

@ -85,7 +85,8 @@ void Foam::phaseSystem::generatePairsAndSubModels
autoPtr<BlendedInterfacialModel<modelType>>, autoPtr<BlendedInterfacialModel<modelType>>,
phasePairKey, phasePairKey,
phasePairKey::hash phasePairKey::hash
>& models >& models,
const bool correctFixedFluxBCs
) )
{ {
typedef typedef
@ -127,7 +128,8 @@ void Foam::phaseSystem::generatePairsAndSubModels
blending, blending,
tempModels.found(key ) ? tempModels[key ] : noModel, tempModels.found(key ) ? tempModels[key ] : noModel,
tempModels.found(key1In2) ? tempModels[key1In2] : noModel, tempModels.found(key1In2) ? tempModels[key1In2] : noModel,
tempModels.found(key2In1) ? tempModels[key2In1] : noModel tempModels.found(key2In1) ? tempModels[key2In1] : noModel,
correctFixedFluxBCs
) )
) )
); );
@ -157,10 +159,11 @@ void Foam::phaseSystem::generatePairsAndSubModels
const word& modelName, const word& modelName,
HashTable HashTable
< <
HashTable<autoPtr<modelType>>, Pair<autoPtr<modelType>>,
phasePairKey, phasePairKey,
phasePairKey::hash phasePairKey::hash
>& models >& models,
const bool correctFixedFluxBCs
) )
{ {
typedef typedef
@ -169,31 +172,41 @@ void Foam::phaseSystem::generatePairsAndSubModels
forAll(phaseModels_, phasei) forAll(phaseModels_, phasei)
{ {
const phaseModel& phase = phaseModels_[phasei];
modelTypeTable tempModels; modelTypeTable tempModels;
generatePairsAndSubModels generatePairsAndSubModels
( (
IOobject::groupName(modelName, phaseModels_[phasei].name()), IOobject::groupName(modelName, phase.name()),
tempModels tempModels,
correctFixedFluxBCs
); );
forAllConstIter(typename modelTypeTable, tempModels, tempModelIter) forAllIter(typename modelTypeTable, tempModels, tempModelIter)
{ {
const phasePairKey key(tempModelIter.key()); const phasePairKey& key(tempModelIter.key());
if (!models.found(key)) if (!models.found(key))
{ {
models.insert models.insert
( (
key, key,
HashTable<autoPtr<modelType>>() Pair<autoPtr<modelType>>()
); );
} }
models[tempModelIter.key()].insert const phasePair& pair = phasePairs_[key];
(
phaseModels_[phasei].name(), if (!pair.contains(phase))
*tempModelIter {
); FatalErrorInFunction
<< "A two-sided " << modelType::typeName << " was "
<< "specified for the " << phase.name() << " side of the "
<< pair << " pair, but that phase is not part of that pair."
<< exit(FatalError);
}
models[key][pair.index(phase)] = tempModelIter().ptr();
} }
} }
} }

View File

@ -28,8 +28,9 @@ License
#include "phaseSystem.H" #include "phaseSystem.H"
#include "multiphaseSystem.H" #include "multiphaseSystem.H"
#include "MomentumTransferPhaseSystem.H" #include "MomentumTransferPhaseSystem.H"
#include "HeatTransferPhaseSystem.H" #include "OneResistanceHeatTransferPhaseSystem.H"
#include "HeatAndMassTransferPhaseSystem.H" #include "TwoResistanceHeatTransferPhaseSystem.H"
#include "PhaseTransferPhaseSystem.H"
#include "PopulationBalancePhaseSystem.H" #include "PopulationBalancePhaseSystem.H"
#include "InterfaceCompositionPhaseChangePhaseSystem.H" #include "InterfaceCompositionPhaseChangePhaseSystem.H"
#include "ThermalPhaseChangePhaseSystem.H" #include "ThermalPhaseChangePhaseSystem.H"
@ -39,43 +40,34 @@ License
namespace Foam namespace Foam
{ {
typedef typedef
HeatTransferPhaseSystem PhaseTransferPhaseSystem
<
OneResistanceHeatTransferPhaseSystem
< <
MomentumTransferPhaseSystem<multiphaseSystem> MomentumTransferPhaseSystem<multiphaseSystem>
> >
heatAndMomentumTransferMultiphaseSystem; >
basicMultiphaseSystem;
addNamedToRunTimeSelectionTable addNamedToRunTimeSelectionTable
( (
multiphaseSystem, multiphaseSystem,
heatAndMomentumTransferMultiphaseSystem, basicMultiphaseSystem,
dictionary, dictionary,
heatAndMomentumTransferMultiphaseSystem basicMultiphaseSystem
);
typedef
HeatAndMassTransferPhaseSystem
<
MomentumTransferPhaseSystem<multiphaseSystem>
>
heatAndMassTransferMultiphaseSystem;
addNamedToRunTimeSelectionTable
(
multiphaseSystem,
heatAndMassTransferMultiphaseSystem,
dictionary,
heatAndMassTransferMultiphaseSystem
); );
typedef typedef
InterfaceCompositionPhaseChangePhaseSystem InterfaceCompositionPhaseChangePhaseSystem
< <
HeatAndMassTransferPhaseSystem PhaseTransferPhaseSystem
<
TwoResistanceHeatTransferPhaseSystem
< <
MomentumTransferPhaseSystem<multiphaseSystem> MomentumTransferPhaseSystem<multiphaseSystem>
> >
> >
>
interfaceCompositionPhaseChangeMultiphaseSystem; interfaceCompositionPhaseChangeMultiphaseSystem;
addNamedToRunTimeSelectionTable addNamedToRunTimeSelectionTable
@ -89,11 +81,14 @@ namespace Foam
typedef typedef
ThermalPhaseChangePhaseSystem ThermalPhaseChangePhaseSystem
< <
HeatAndMassTransferPhaseSystem PhaseTransferPhaseSystem
<
TwoResistanceHeatTransferPhaseSystem
< <
MomentumTransferPhaseSystem<multiphaseSystem> MomentumTransferPhaseSystem<multiphaseSystem>
> >
> >
>
thermalPhaseChangeMultiphaseSystem; thermalPhaseChangeMultiphaseSystem;
addNamedToRunTimeSelectionTable addNamedToRunTimeSelectionTable
@ -105,14 +100,16 @@ namespace Foam
); );
typedef typedef
PopulationBalancePhaseSystem PopulationBalancePhaseSystem
< <
HeatAndMassTransferPhaseSystem PhaseTransferPhaseSystem
<
OneResistanceHeatTransferPhaseSystem
< <
MomentumTransferPhaseSystem<multiphaseSystem> MomentumTransferPhaseSystem<multiphaseSystem>
> >
> >
>
populationBalanceMultiphaseSystem; populationBalanceMultiphaseSystem;
addNamedToRunTimeSelectionTable addNamedToRunTimeSelectionTable
@ -128,12 +125,15 @@ namespace Foam
< <
PopulationBalancePhaseSystem PopulationBalancePhaseSystem
< <
HeatAndMassTransferPhaseSystem PhaseTransferPhaseSystem
<
TwoResistanceHeatTransferPhaseSystem
< <
MomentumTransferPhaseSystem<multiphaseSystem> MomentumTransferPhaseSystem<multiphaseSystem>
> >
> >
> >
>
thermalPhaseChangePopulationBalanceMultiphaseSystem; thermalPhaseChangePopulationBalanceMultiphaseSystem;
addNamedToRunTimeSelectionTable addNamedToRunTimeSelectionTable

View File

@ -28,8 +28,9 @@ License
#include "phaseSystem.H" #include "phaseSystem.H"
#include "twoPhaseSystem.H" #include "twoPhaseSystem.H"
#include "MomentumTransferPhaseSystem.H" #include "MomentumTransferPhaseSystem.H"
#include "HeatTransferPhaseSystem.H" #include "OneResistanceHeatTransferPhaseSystem.H"
#include "HeatAndMassTransferPhaseSystem.H" #include "TwoResistanceHeatTransferPhaseSystem.H"
#include "PhaseTransferPhaseSystem.H"
#include "PopulationBalancePhaseSystem.H" #include "PopulationBalancePhaseSystem.H"
#include "InterfaceCompositionPhaseChangePhaseSystem.H" #include "InterfaceCompositionPhaseChangePhaseSystem.H"
#include "ThermalPhaseChangePhaseSystem.H" #include "ThermalPhaseChangePhaseSystem.H"
@ -39,43 +40,34 @@ License
namespace Foam namespace Foam
{ {
typedef typedef
HeatTransferPhaseSystem PhaseTransferPhaseSystem
<
OneResistanceHeatTransferPhaseSystem
< <
MomentumTransferPhaseSystem<twoPhaseSystem> MomentumTransferPhaseSystem<twoPhaseSystem>
> >
heatAndMomentumTransferTwoPhaseSystem; >
basicTwoPhaseSystem;
addNamedToRunTimeSelectionTable addNamedToRunTimeSelectionTable
( (
twoPhaseSystem, twoPhaseSystem,
heatAndMomentumTransferTwoPhaseSystem, basicTwoPhaseSystem,
dictionary, dictionary,
heatAndMomentumTransferTwoPhaseSystem basicTwoPhaseSystem
);
typedef
HeatAndMassTransferPhaseSystem
<
MomentumTransferPhaseSystem<twoPhaseSystem>
>
heatAndMassTransferTwoPhaseSystem;
addNamedToRunTimeSelectionTable
(
twoPhaseSystem,
heatAndMassTransferTwoPhaseSystem,
dictionary,
heatAndMassTransferTwoPhaseSystem
); );
typedef typedef
InterfaceCompositionPhaseChangePhaseSystem InterfaceCompositionPhaseChangePhaseSystem
< <
HeatAndMassTransferPhaseSystem PhaseTransferPhaseSystem
<
TwoResistanceHeatTransferPhaseSystem
< <
MomentumTransferPhaseSystem<twoPhaseSystem> MomentumTransferPhaseSystem<twoPhaseSystem>
> >
> >
>
interfaceCompositionPhaseChangeTwoPhaseSystem; interfaceCompositionPhaseChangeTwoPhaseSystem;
addNamedToRunTimeSelectionTable addNamedToRunTimeSelectionTable
@ -89,11 +81,14 @@ namespace Foam
typedef typedef
ThermalPhaseChangePhaseSystem ThermalPhaseChangePhaseSystem
< <
HeatAndMassTransferPhaseSystem PhaseTransferPhaseSystem
<
TwoResistanceHeatTransferPhaseSystem
< <
MomentumTransferPhaseSystem<twoPhaseSystem> MomentumTransferPhaseSystem<twoPhaseSystem>
> >
> >
>
thermalPhaseChangeTwoPhaseSystem; thermalPhaseChangeTwoPhaseSystem;
addNamedToRunTimeSelectionTable addNamedToRunTimeSelectionTable
@ -107,11 +102,14 @@ namespace Foam
typedef typedef
PopulationBalancePhaseSystem PopulationBalancePhaseSystem
< <
HeatAndMassTransferPhaseSystem PhaseTransferPhaseSystem
<
OneResistanceHeatTransferPhaseSystem
< <
MomentumTransferPhaseSystem<twoPhaseSystem> MomentumTransferPhaseSystem<twoPhaseSystem>
> >
> >
>
populationBalanceTwoPhaseSystem; populationBalanceTwoPhaseSystem;
addNamedToRunTimeSelectionTable addNamedToRunTimeSelectionTable
@ -127,12 +125,15 @@ namespace Foam
< <
PopulationBalancePhaseSystem PopulationBalancePhaseSystem
< <
HeatAndMassTransferPhaseSystem PhaseTransferPhaseSystem
<
TwoResistanceHeatTransferPhaseSystem
< <
MomentumTransferPhaseSystem<twoPhaseSystem> MomentumTransferPhaseSystem<twoPhaseSystem>
> >
> >
> >
>
thermalPhaseChangePopulationBalanceTwoPhaseSystem; thermalPhaseChangePopulationBalanceTwoPhaseSystem;
addNamedToRunTimeSelectionTable addNamedToRunTimeSelectionTable

View File

@ -168,28 +168,10 @@ drag
virtualMass virtualMass
(); ();
heatTransfer.air1 heatTransfer
(); ();
heatTransfer.air2 phaseTransfer
();
heatTransfer.air3
();
heatTransfer.water
();
massTransfer.air1
();
massTransfer.air2
();
massTransfer.air3
();
massTransfer.water
(); ();
lift lift

View File

@ -169,28 +169,10 @@ drag
virtualMass virtualMass
(); ();
heatTransfer.air1 heatTransfer
(); ();
heatTransfer.air2 phaseTransfer
();
heatTransfer.air3
();
heatTransfer.water
();
massTransfer.air1
();
massTransfer.air2
();
massTransfer.air3
();
massTransfer.water
(); ();
lift lift

View File

@ -210,28 +210,10 @@ drag
virtualMass virtualMass
(); ();
heatTransfer.air1 heatTransfer
(); ();
heatTransfer.air2 phaseTransfer
();
heatTransfer.air3
();
heatTransfer.water
();
massTransfer.air1
();
massTransfer.air2
();
massTransfer.air3
();
massTransfer.water
(); ();
lift lift

View File

@ -174,28 +174,10 @@ drag
virtualMass virtualMass
(); ();
heatTransfer.air1 heatTransfer
(); ();
heatTransfer.air2 phaseTransfer
();
heatTransfer.air3
();
heatTransfer.water
();
massTransfer.air1
();
massTransfer.air2
();
massTransfer.air3
();
massTransfer.water
(); ();
lift lift

View File

@ -141,16 +141,10 @@ drag
virtualMass virtualMass
(); ();
heatTransfer.air heatTransfer
(); ();
heatTransfer.water phaseTransfer
();
massTransfer.air
();
massTransfer.water
(); ();
lift lift

View File

@ -135,16 +135,10 @@ drag
virtualMass virtualMass
(); ();
heatTransfer.air heatTransfer
(); ();
heatTransfer.water phaseTransfer
();
massTransfer.air
();
massTransfer.water
(); ();
lift lift

View File

@ -19,7 +19,7 @@ type thermalPhaseChangeMultiphaseSystem;
phases (gas liquid); phases (gas liquid);
massTransfer on; phaseChange on;
gas gas
{ {
@ -143,10 +143,7 @@ heatTransfer.liquid
} }
); );
massTransfer.gas phaseTransfer
();
massTransfer.liquid
(); ();
lift lift

View File

@ -19,7 +19,7 @@ type thermalPhaseChangeMultiphaseSystem;
phases (gas gas2 liquid); phases (gas gas2 liquid);
massTransfer on; phaseChange on;
gas gas
{ {
@ -203,13 +203,7 @@ heatTransfer.liquid
} }
); );
massTransfer.gas phaseTransfer
();
massTransfer.gas2
();
massTransfer.liquid
(); ();
lift lift

View File

@ -15,7 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type heatAndMomentumTransferMultiphaseSystem; type basicMultiphaseSystem;
phases (air water solid); phases (air water solid);
@ -191,6 +191,9 @@ virtualMass
heatTransfer heatTransfer
(); ();
phaseTransfer
();
lift lift
(); ();

View File

@ -15,7 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type heatAndMomentumTransferMultiphaseSystem; type basicMultiphaseSystem;
phases (air water); phases (air water);
@ -159,6 +159,9 @@ heatTransfer
} }
); );
phaseTransfer
();
lift lift
(); ();

View File

@ -15,7 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type heatAndMomentumTransferMultiphaseSystem; type basicMultiphaseSystem;
phases (air1 air2 water); phases (air1 air2 water);
@ -302,6 +302,9 @@ heatTransfer
} }
); );
phaseTransfer
();
lift lift
(); ();

View File

@ -334,97 +334,48 @@ virtualMass
} }
); );
heatTransfer.air1 heatTransfer
( (
(air1 in water) (air1 in water)
{ {
type spherical; type RanzMarshall;
residualAlpha 1e-3; residualAlpha 1e-4;
} }
(water in air1) (water in air1)
{ {
type RanzMarshall; type RanzMarshall;
residualAlpha 1e-3; residualAlpha 1e-4;
}
(air1 in air2)
{
type spherical;
residualAlpha 1e-3;
}
(air2 in air1)
{
type spherical;
residualAlpha 1e-3;
}
);
heatTransfer.air2
(
(air2 in water)
{
type spherical;
residualAlpha 1e-3;
}
(water in air2)
{
type RanzMarshall;
residualAlpha 1e-3;
}
(air1 in air2)
{
type spherical;
residualAlpha 1e-3;
}
(air2 in air1)
{
type spherical;
residualAlpha 1e-3;
}
);
heatTransfer.water
(
(air1 in water)
{
type RanzMarshall;
residualAlpha 1e-3;
}
(water in air1)
{
type spherical;
residualAlpha 1e-3;
} }
(air2 in water) (air2 in water)
{ {
type RanzMarshall; type RanzMarshall;
residualAlpha 1e-3; residualAlpha 1e-4;
} }
(water in air2) (water in air2)
{ {
type spherical; type RanzMarshall;
residualAlpha 1e-3; residualAlpha 1e-4;
}
(air1 in air2)
{
type RanzMarshall;
residualAlpha 1e-4;
}
(air2 in air1)
{
type RanzMarshall;
residualAlpha 1e-4;
} }
); );
massTransfer.air1 phaseTransfer
(); ();
massTransfer.air2
();
massTransfer.water
();
lift lift
(); ();

View File

@ -15,7 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type heatAndMomentumTransferMultiphaseSystem; type basicMultiphaseSystem;
phases (water oil mercury air); phases (water oil mercury air);
@ -456,6 +456,9 @@ heatTransfer
} }
); );
phaseTransfer
();
lift lift
(); ();

View File

@ -15,7 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type heatAndMomentumTransferMultiphaseSystem; type basicMultiphaseSystem;
phases (air water solid); phases (air water solid);
@ -176,6 +176,9 @@ virtualMass
heatTransfer heatTransfer
(); ();
phaseTransfer
();
lift lift
(); ();

View File

@ -15,7 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type heatAndMomentumTransferTwoPhaseSystem; type basicTwoPhaseSystem;
phases (air water); phases (air water);
@ -153,6 +153,10 @@ heatTransfer
} }
); );
phaseTransfer
(
);
lift lift
( (
); );

View File

@ -15,7 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type heatAndMomentumTransferTwoPhaseSystem; type basicTwoPhaseSystem;
phases (solids gas); phases (solids gas);
@ -100,6 +100,10 @@ heatTransfer
} }
); );
phaseTransfer
(
);
lift lift
( (
); );

View File

@ -15,7 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type heatAndMomentumTransferTwoPhaseSystem; type basicTwoPhaseSystem;
phases (air water); phases (air water);
@ -153,6 +153,10 @@ heatTransfer
} }
); );
phaseTransfer
(
);
lift lift
( (
); );

View File

@ -196,6 +196,10 @@ massTransfer.liquid
( (
); );
phaseTransfer
(
);
lift lift
( (
); );

View File

@ -201,41 +201,22 @@ virtualMass
} }
); );
heatTransfer.air heatTransfer
( (
(air in water) (air in water)
{ {
type spherical; type RanzMarshall;
residualAlpha 1e-3; residualAlpha 1e-4;
} }
(water in air) (water in air)
{ {
type RanzMarshall; type RanzMarshall;
residualAlpha 1e-3; residualAlpha 1e-4;
} }
); );
heatTransfer.water phaseTransfer
(
(air in water)
{
type RanzMarshall;
residualAlpha 1e-3;
}
(water in air)
{
type spherical;
residualAlpha 1e-3;
}
);
massTransfer.air
(
);
massTransfer.water
( (
); );

View File

@ -15,7 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type heatAndMomentumTransferTwoPhaseSystem; type basicTwoPhaseSystem;
phases (particles air); phases (particles air);
@ -95,6 +95,10 @@ heatTransfer
} }
); );
phaseTransfer
(
);
lift lift
( (
); );

View File

@ -19,7 +19,7 @@ type thermalPhaseChangeTwoPhaseSystem;
phases (gas liquid); phases (gas liquid);
massTransfer on; phaseChange on;
gas gas
{ {
@ -126,10 +126,7 @@ heatTransfer.liquid
} }
); );
massTransfer.gas phaseTransfer
();
massTransfer.liquid
(); ();
lift lift

View File

@ -19,7 +19,7 @@ type thermalPhaseChangeTwoPhaseSystem;
phases (gas liquid); phases (gas liquid);
massTransfer on; phaseChange on;
gas gas
{ {
@ -118,11 +118,9 @@ heatTransfer.liquid
} }
); );
massTransfer.gas phaseTransfer
(); (
);
massTransfer.liquid
();
lift lift
(); ();

View File

@ -19,7 +19,7 @@ type thermalPhaseChangeTwoPhaseSystem;
phases (gas liquid); phases (gas liquid);
massTransfer on; phaseChange on;
gas gas
{ {
@ -169,10 +169,7 @@ heatTransfer.liquid
} }
); );
massTransfer.gas phaseTransfer
();
massTransfer.liquid
(); ();
lift lift

View File

@ -19,7 +19,7 @@ type thermalPhaseChangePopulationBalanceTwoPhaseSystem;
phases (gas liquid); phases (gas liquid);
massTransfer on; phaseChange on;
populationBalances (bubbles); populationBalances (bubbles);
@ -188,10 +188,7 @@ heatTransfer.liquid
} }
); );
massTransfer.gas phaseTransfer
();
massTransfer.liquid
(); ();
lift lift

View File

@ -15,7 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type heatAndMomentumTransferTwoPhaseSystem; type basicTwoPhaseSystem;
phases (air water); phases (air water);
@ -156,6 +156,10 @@ heatTransfer
} }
); );
phaseTransfer
(
);
lift lift
( (
); );

View File

@ -207,6 +207,10 @@ massTransfer.liquid
} }
); );
phaseTransfer
(
);
lift lift
( (
); );

View File

@ -216,6 +216,10 @@ massTransfer.liquid
} }
); );
phaseTransfer
(
);
lift lift
( (
); );

View File

@ -15,7 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type heatAndMomentumTransferTwoPhaseSystem; type basicTwoPhaseSystem;
phases (air water); phases (air water);
@ -176,6 +176,10 @@ heatTransfer
} }
); );
phaseTransfer
(
);
lift lift
( (
); );

View File

@ -15,7 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type heatAndMomentumTransferTwoPhaseSystem; type basicTwoPhaseSystem;
phases (particles air); phases (particles air);
@ -97,6 +97,10 @@ heatTransfer
} }
); );
phaseTransfer
(
);
lift lift
( (
); );

View File

@ -15,7 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type heatAndMomentumTransferTwoPhaseSystem; type basicTwoPhaseSystem;
phases (air water); phases (air water);
@ -154,6 +154,10 @@ heatTransfer
} }
); );
phaseTransfer
(
);
lift lift
( (
); );

View File

@ -15,7 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type heatAndMomentumTransferTwoPhaseSystem; type basicTwoPhaseSystem;
phases (air water); phases (air water);
@ -153,6 +153,10 @@ heatTransfer
} }
); );
phaseTransfer
(
);
lift lift
( (
); );

View File

@ -19,7 +19,7 @@ type thermalPhaseChangeTwoPhaseSystem;
phases (steam water); phases (steam water);
massTransfer on; phaseChange on;
steam steam
{ {
@ -126,10 +126,7 @@ heatTransfer.water
} }
); );
massTransfer.steam phaseTransfer
();
massTransfer.water
(); ();
lift lift

View File

@ -136,6 +136,10 @@ heatTransfer
} }
); );
phaseTransfer
(
);
lift lift
( (
); );

View File

@ -136,6 +136,10 @@ heatTransfer
} }
); );
phaseTransfer
(
);
lift lift
( (
); );

View File

@ -88,6 +88,10 @@ heatTransfer
} }
); );
phaseTransfer
(
);
lift lift
( (
); );

View File

@ -137,6 +137,10 @@ heatTransfer
} }
); );
phaseTransfer
(
);
lift lift
( (
); );

View File

@ -157,6 +157,10 @@ heatTransfer
} }
); );
phaseTransfer
(
);
lift lift
( (
); );

View File

@ -89,6 +89,10 @@ heatTransfer
} }
); );
phaseTransfer
(
);
lift lift
( (
); );

View File

@ -137,6 +137,10 @@ heatTransfer
} }
); );
phaseTransfer
(
);
lift lift
( (
); );

View File

@ -136,6 +136,10 @@ heatTransfer
} }
); );
phaseTransfer
(
);
lift lift
( (
); );