Deleted multiphaseEulerFoam: Replaced by the multiphaseEuler solver module
This commit is contained in:
@ -10,5 +10,6 @@ wmake $targetType isothermalFluid
|
|||||||
wmake $targetType fluid
|
wmake $targetType fluid
|
||||||
wmake $targetType multicomponentFluid
|
wmake $targetType multicomponentFluid
|
||||||
compressibleVoF/Allwmake $targetType $*
|
compressibleVoF/Allwmake $targetType $*
|
||||||
|
multiphaseEuler/Allwmake $targetType $*
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -25,7 +25,6 @@ License
|
|||||||
|
|
||||||
#include "compressibleVoF.H"
|
#include "compressibleVoF.H"
|
||||||
#include "localEulerDdtScheme.H"
|
#include "localEulerDdtScheme.H"
|
||||||
#include "hydrostaticInitialisation.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -297,14 +296,6 @@ Foam::scalar Foam::solvers::compressibleVoF::maxDeltaT() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::solvers::compressibleVoF::prePredictor()
|
|
||||||
{
|
|
||||||
fvModels().correct();
|
|
||||||
alphaPredictor();
|
|
||||||
turbulence.correctPhasePhi();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::solvers::compressibleVoF::preSolve()
|
void Foam::solvers::compressibleVoF::preSolve()
|
||||||
{
|
{
|
||||||
// Read the controls
|
// Read the controls
|
||||||
@ -339,6 +330,14 @@ void Foam::solvers::compressibleVoF::preSolve()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::solvers::compressibleVoF::prePredictor()
|
||||||
|
{
|
||||||
|
fvModels().correct();
|
||||||
|
alphaPredictor();
|
||||||
|
turbulence.correctPhasePhi();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::solvers::compressibleVoF::momentumTransportCorrector()
|
void Foam::solvers::compressibleVoF::momentumTransportCorrector()
|
||||||
{
|
{
|
||||||
if (pimple.transportCorr())
|
if (pimple.transportCorr())
|
||||||
|
|||||||
@ -79,12 +79,6 @@ class fluidSolver
|
|||||||
scalar cumulativeContErr;
|
scalar cumulativeContErr;
|
||||||
|
|
||||||
|
|
||||||
// Cached Courant numbers for time-step control
|
|
||||||
|
|
||||||
//- Current maximum Courant number
|
|
||||||
scalar CoNum;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Correct the cached Courant numbers
|
//- Correct the cached Courant numbers
|
||||||
@ -101,6 +95,9 @@ protected:
|
|||||||
//- Switch to correct the flux after mesh change
|
//- Switch to correct the flux after mesh change
|
||||||
bool correctPhi;
|
bool correctPhi;
|
||||||
|
|
||||||
|
//- Current maximum Courant number for time-step control
|
||||||
|
scalar CoNum;
|
||||||
|
|
||||||
//- Read controls
|
//- Read controls
|
||||||
void read();
|
void read();
|
||||||
|
|
||||||
@ -135,7 +132,7 @@ protected:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("incompresssibleFluid");
|
TypeName("fluidSolver");
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|||||||
@ -1,13 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
cd ${0%/*} || exit 1 # Run from this directory
|
|
||||||
|
|
||||||
wclean libso phaseSystems
|
|
||||||
wclean libso interfacialModels
|
|
||||||
wclean libso interfacialCompositionModels
|
|
||||||
wclean libso multiphaseCompressibleMomentumTransportModels
|
|
||||||
wclean libso multiphaseReactions
|
|
||||||
multiphaseEulerFoam/Allwclean
|
|
||||||
wclean libso fvModels
|
|
||||||
wclean libso functionObjects
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
cd ${0%/*} || exit 1 # Run from this directory
|
|
||||||
|
|
||||||
# Parse arguments for library compilation
|
|
||||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
|
||||||
|
|
||||||
wmake $targetType phaseSystems
|
|
||||||
wmake $targetType interfacialModels
|
|
||||||
wmake $targetType interfacialCompositionModels
|
|
||||||
wmake $targetType multiphaseCompressibleMomentumTransportModels
|
|
||||||
wmake $targetType multiphaseReactions
|
|
||||||
multiphaseEulerFoam/Allwmake $targetType $*
|
|
||||||
wmake $targetType fvModels
|
|
||||||
wmake $targetType functionObjects
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
populationBalanceMoments/populationBalanceMoments.C
|
|
||||||
populationBalanceSizeDistribution/populationBalanceSizeDistribution.C
|
|
||||||
phaseForces/phaseForces.C
|
|
||||||
phaseMap/phaseMap.C
|
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libmultiphaseEulerFoamFunctionObjects
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
EXE_INC = \
|
|
||||||
-I../phaseSystems/lnInclude \
|
|
||||||
-I../interfacialModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/physicalProperties/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
|
||||||
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/MomentumTransportModels/phaseCompressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
|
||||||
-I$(LIB_SRC)/fileFormats/lnInclude \
|
|
||||||
-I$(LIB_SRC)/functionObjects/field/lnInclude \
|
|
||||||
-I$(LIB_SRC)/sampling/lnInclude
|
|
||||||
|
|
||||||
LIB_LIBS = \
|
|
||||||
-lphaseSystem \
|
|
||||||
-lmultiphaseSystems \
|
|
||||||
-leulerianInterfacialModels \
|
|
||||||
-leulerianInterfacialCompositionModels \
|
|
||||||
-lmultiphaseMomentumTransportModels \
|
|
||||||
-lmultiphaseReactions \
|
|
||||||
-lmultiphaseProperties \
|
|
||||||
-lphaseFluidThermophysicalTransportModels \
|
|
||||||
-lphaseFluidMulticomponentThermophysicalTransportModels \
|
|
||||||
-lfiniteVolume \
|
|
||||||
-lmeshTools \
|
|
||||||
-lfileFormats \
|
|
||||||
-lfieldFunctionObjects
|
|
||||||
@ -1,303 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2018-2022 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 "phaseForces.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "fvcGrad.H"
|
|
||||||
#include "dragModel.H"
|
|
||||||
#include "virtualMassModel.H"
|
|
||||||
#include "liftModel.H"
|
|
||||||
#include "wallLubricationModel.H"
|
|
||||||
#include "turbulentDispersionModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace functionObjects
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(phaseForces, 0);
|
|
||||||
addToRunTimeSelectionTable(functionObject, phaseForces, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::functionObjects::phaseForces::phaseForces
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const Time& runTime,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fvMeshFunctionObject(name, runTime, dict),
|
|
||||||
phase_
|
|
||||||
(
|
|
||||||
mesh_.lookupObject<phaseModel>
|
|
||||||
(
|
|
||||||
IOobject::groupName("alpha", dict.lookup("phase"))
|
|
||||||
)
|
|
||||||
),
|
|
||||||
fluid_(mesh_.lookupObject<phaseSystem>(phaseSystem::propertiesName))
|
|
||||||
{
|
|
||||||
read(dict);
|
|
||||||
|
|
||||||
forAll(fluid_.phases(), phasei)
|
|
||||||
{
|
|
||||||
const phaseModel& otherPhase = fluid_.phases()[phasei];
|
|
||||||
|
|
||||||
if (&otherPhase == &phase_) continue;
|
|
||||||
|
|
||||||
const phaseInterface interface(phase_, otherPhase);
|
|
||||||
|
|
||||||
if (fluid_.foundInterfacialModel<blendedDragModel>(interface))
|
|
||||||
{
|
|
||||||
forceFields_.insert
|
|
||||||
(
|
|
||||||
dragModel::typeName,
|
|
||||||
new volVectorField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
IOobject::groupName("dragForce", phase_.name()),
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimensionedVector(dimForce/dimVolume, Zero)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fluid_.foundInterfacialModel<blendedVirtualMassModel>(interface))
|
|
||||||
{
|
|
||||||
forceFields_.insert
|
|
||||||
(
|
|
||||||
virtualMassModel::typeName,
|
|
||||||
new volVectorField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
IOobject::groupName
|
|
||||||
(
|
|
||||||
"virtualMassForce",
|
|
||||||
phase_.name()
|
|
||||||
),
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimensionedVector(dimForce/dimVolume, Zero)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fluid_.foundInterfacialModel<blendedLiftModel>(interface))
|
|
||||||
{
|
|
||||||
forceFields_.insert
|
|
||||||
(
|
|
||||||
liftModel::typeName,
|
|
||||||
new volVectorField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
IOobject::groupName("liftForce", phase_.name()),
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimensionedVector(dimForce/dimVolume, Zero)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if
|
|
||||||
(
|
|
||||||
fluid_.foundInterfacialModel
|
|
||||||
<blendedWallLubricationModel>(interface)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
forceFields_.insert
|
|
||||||
(
|
|
||||||
wallLubricationModel::typeName,
|
|
||||||
new volVectorField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
IOobject::groupName
|
|
||||||
(
|
|
||||||
"wallLubricationForce",
|
|
||||||
phase_.name()
|
|
||||||
),
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimensionedVector(dimForce/dimVolume, Zero)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if
|
|
||||||
(
|
|
||||||
fluid_.foundInterfacialModel
|
|
||||||
<blendedTurbulentDispersionModel>(interface)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
forceFields_.insert
|
|
||||||
(
|
|
||||||
turbulentDispersionModel::typeName,
|
|
||||||
new volVectorField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
IOobject::groupName
|
|
||||||
(
|
|
||||||
"turbulentDispersionForce",
|
|
||||||
phase_.name()
|
|
||||||
),
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimensionedVector(dimForce/dimVolume, Zero)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::functionObjects::phaseForces::~phaseForces()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
bool Foam::functionObjects::phaseForces::read(const dictionary& dict)
|
|
||||||
{
|
|
||||||
fvMeshFunctionObject::read(dict);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::phaseForces::execute()
|
|
||||||
{
|
|
||||||
// Zero the force fields
|
|
||||||
forAllConstIter
|
|
||||||
(
|
|
||||||
HashPtrTable<volVectorField>,
|
|
||||||
forceFields_,
|
|
||||||
forceFieldIter
|
|
||||||
)
|
|
||||||
{
|
|
||||||
*forceFieldIter() = Zero;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add the forces from all the interfaces which contain this phase
|
|
||||||
forAll(fluid_.phases(), phasei)
|
|
||||||
{
|
|
||||||
const phaseModel& otherPhase = fluid_.phases()[phasei];
|
|
||||||
|
|
||||||
if (&otherPhase == &phase_) continue;
|
|
||||||
|
|
||||||
const phaseInterface interface(phase_, otherPhase);
|
|
||||||
|
|
||||||
if (fluid_.foundInterfacialModel<blendedDragModel>(interface))
|
|
||||||
{
|
|
||||||
*forceFields_[dragModel::typeName] +=
|
|
||||||
fluid_.lookupInterfacialModel<blendedDragModel>(interface).K()
|
|
||||||
*(otherPhase.U() - phase_.U());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fluid_.foundInterfacialModel<blendedVirtualMassModel>(interface))
|
|
||||||
{
|
|
||||||
*forceFields_[virtualMassModel::typeName] +=
|
|
||||||
fluid_.lookupInterfacialModel
|
|
||||||
<blendedVirtualMassModel>(interface).K()
|
|
||||||
*(otherPhase.DUDt() - phase_.DUDt());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fluid_.foundInterfacialModel<blendedLiftModel>(interface))
|
|
||||||
{
|
|
||||||
*forceFields_[liftModel::typeName] +=
|
|
||||||
(&interface.phase1() == &phase_ ? -1 : +1)
|
|
||||||
*fluid_.lookupInterfacialModel<blendedLiftModel>(interface).F();
|
|
||||||
}
|
|
||||||
|
|
||||||
if
|
|
||||||
(
|
|
||||||
fluid_.foundInterfacialModel
|
|
||||||
<blendedWallLubricationModel>(interface)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
*forceFields_[wallLubricationModel::typeName] +=
|
|
||||||
(&interface.phase1() == &phase_ ? -1 : +1)
|
|
||||||
*fluid_.lookupInterfacialModel
|
|
||||||
<blendedWallLubricationModel>(interface).F();
|
|
||||||
}
|
|
||||||
|
|
||||||
if
|
|
||||||
(
|
|
||||||
fluid_.foundInterfacialModel
|
|
||||||
<blendedTurbulentDispersionModel>(interface)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
*forceFields_[turbulentDispersionModel::typeName] +=
|
|
||||||
fluid_.lookupInterfacialModel
|
|
||||||
<blendedTurbulentDispersionModel>(interface).D()
|
|
||||||
*fvc::grad
|
|
||||||
(
|
|
||||||
otherPhase
|
|
||||||
/max(phase_ + otherPhase, otherPhase.residualAlpha())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::phaseForces::write()
|
|
||||||
{
|
|
||||||
forAllConstIter
|
|
||||||
(
|
|
||||||
HashPtrTable<volVectorField>,
|
|
||||||
forceFields_,
|
|
||||||
forceFieldIter
|
|
||||||
)
|
|
||||||
{
|
|
||||||
writeObject(forceFieldIter()->name());
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,160 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2018-2022 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::functionObjects::phaseForces
|
|
||||||
|
|
||||||
Description
|
|
||||||
This functionObject calculates and outputs the blended interfacial forces
|
|
||||||
acting on a given phase, i.e. drag, virtual mass, lift, wall-lubrication and
|
|
||||||
turbulent dispersion. Note that it works only in run-time processing mode
|
|
||||||
and in combination with the multiphaseEulerFoam solver.
|
|
||||||
|
|
||||||
For a simulation involving more than two phases, the accumulated force is
|
|
||||||
calculated by looping over all interfaces involving that phase. The fields
|
|
||||||
are stored in the database so that they can be processed further, e.g. with
|
|
||||||
the fieldAveraging functionObject.
|
|
||||||
|
|
||||||
Example of function object specification:
|
|
||||||
\verbatim
|
|
||||||
phaseForces.water
|
|
||||||
{
|
|
||||||
type phaseForces;
|
|
||||||
|
|
||||||
libs ("libmultiphaseEulerFoamFunctionObjects.so");
|
|
||||||
|
|
||||||
phase water;
|
|
||||||
}
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
Usage
|
|
||||||
\table
|
|
||||||
Property | Description | Required | Default value
|
|
||||||
type | type name: phaseForces | yes |
|
|
||||||
phase | Name of evaluated phase | yes |
|
|
||||||
\endtable
|
|
||||||
|
|
||||||
See also
|
|
||||||
Foam::BlendedInterfacialModel
|
|
||||||
Foam::functionObjects::fvMeshFunctionObject
|
|
||||||
Foam::functionObject
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
phaseForces.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef functionObjects_phaseForces_H
|
|
||||||
#define functionObjects_phaseForces_H
|
|
||||||
|
|
||||||
#include "fvMeshFunctionObject.H"
|
|
||||||
#include "phaseSystem.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace functionObjects
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class phaseForces Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class phaseForces
|
|
||||||
:
|
|
||||||
public fvMeshFunctionObject
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Protected data
|
|
||||||
|
|
||||||
//- Force fields
|
|
||||||
HashPtrTable<volVectorField> forceFields_;
|
|
||||||
|
|
||||||
//- Phase for which forces are evaluated
|
|
||||||
const phaseModel& phase_;
|
|
||||||
|
|
||||||
//- Constant access to phaseSystem
|
|
||||||
const phaseSystem& fluid_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("phaseForces");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from Time and dictionary
|
|
||||||
phaseForces
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const Time& runTime,
|
|
||||||
const dictionary&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construction
|
|
||||||
phaseForces(const phaseForces&) = delete;
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~phaseForces();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Read the input data
|
|
||||||
virtual bool read(const dictionary& dict);
|
|
||||||
|
|
||||||
//- Return the list of fields required
|
|
||||||
virtual wordList fields() const
|
|
||||||
{
|
|
||||||
return wordList::null();
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Calculate the force fields
|
|
||||||
virtual bool execute();
|
|
||||||
|
|
||||||
//- Write the force fields
|
|
||||||
virtual bool write();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const phaseForces&) = delete;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace functionObjects
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,102 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2020-2022 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 "phaseMap.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace functionObjects
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(phaseMap, 0);
|
|
||||||
addToRunTimeSelectionTable(functionObject, phaseMap, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::functionObjects::phaseMap::phaseMap
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const Time& runTime,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fvMeshFunctionObject(name, runTime, dict),
|
|
||||||
phases_
|
|
||||||
(
|
|
||||||
mesh_.lookupObject<phaseSystem>(phaseSystem::propertiesName).phases()
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::functionObjects::phaseMap::~phaseMap()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
bool Foam::functionObjects::phaseMap::execute()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::phaseMap::write()
|
|
||||||
{
|
|
||||||
volScalarField phaseMap
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
IOobject::groupName(phases_[0].member(), "map"),
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimensionedScalar(dimless, 0)
|
|
||||||
);
|
|
||||||
|
|
||||||
scalar level = 0;
|
|
||||||
|
|
||||||
forAll(phases_, i)
|
|
||||||
{
|
|
||||||
phaseMap += level*phases_[i];
|
|
||||||
level += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
phaseMap.write();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,141 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2020-2021 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::functionObjects::phaseMap
|
|
||||||
|
|
||||||
Description
|
|
||||||
This functionObject writes the phase-fraction map field alpha.map with
|
|
||||||
incremental value ranges for each phase
|
|
||||||
e.g., with values 0 for water, 1 for air, 2 for oil etc.
|
|
||||||
|
|
||||||
Example of function object specification:
|
|
||||||
\verbatim
|
|
||||||
phaseMap
|
|
||||||
{
|
|
||||||
type phaseMap;
|
|
||||||
libs ("libmultiphaseEulerFoamFunctionObjects.so");
|
|
||||||
writeControl writeTime;
|
|
||||||
}
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
Usage
|
|
||||||
\table
|
|
||||||
Property | Description | Required | Default value
|
|
||||||
type | type name: phaseMap | yes |
|
|
||||||
\endtable
|
|
||||||
|
|
||||||
See also
|
|
||||||
Foam::functionObjects::fvMeshFunctionObject
|
|
||||||
Foam::functionObject
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
phaseMap.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef functionObjects_phaseMap_H
|
|
||||||
#define functionObjects_phaseMap_H
|
|
||||||
|
|
||||||
#include "fvMeshFunctionObject.H"
|
|
||||||
#include "phaseSystem.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace functionObjects
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class phaseMap Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class phaseMap
|
|
||||||
:
|
|
||||||
public fvMeshFunctionObject
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Protected data
|
|
||||||
|
|
||||||
//- Constant access to phases
|
|
||||||
const phaseSystem::phaseModelList& phases_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("phaseMap");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from Time and dictionary
|
|
||||||
phaseMap
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const Time& runTime,
|
|
||||||
const dictionary&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construction
|
|
||||||
phaseMap(const phaseMap&) = delete;
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~phaseMap();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return the list of fields required
|
|
||||||
virtual wordList fields() const
|
|
||||||
{
|
|
||||||
return wordList::null();
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Calculate the force fields
|
|
||||||
virtual bool execute();
|
|
||||||
|
|
||||||
//- Write the force fields
|
|
||||||
virtual bool write();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const phaseMap&) = delete;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace functionObjects
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,983 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2022 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 "populationBalanceMoments.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace functionObjects
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(populationBalanceMoments, 0);
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
functionObject,
|
|
||||||
populationBalanceMoments,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
template<>
|
|
||||||
const char* NamedEnum
|
|
||||||
<
|
|
||||||
Foam::functionObjects::populationBalanceMoments::momentType,
|
|
||||||
4
|
|
||||||
>::names[] = {"integerMoment", "mean", "variance", "stdDev"};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::NamedEnum
|
|
||||||
<
|
|
||||||
Foam::functionObjects::populationBalanceMoments::momentType,
|
|
||||||
4
|
|
||||||
>
|
|
||||||
Foam::functionObjects::populationBalanceMoments::momentTypeNames_;
|
|
||||||
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
template<>
|
|
||||||
const char* NamedEnum
|
|
||||||
<
|
|
||||||
Foam::functionObjects::populationBalanceMoments::coordinateType,
|
|
||||||
3
|
|
||||||
>::names[] = {"volume", "area", "diameter"};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::NamedEnum
|
|
||||||
<
|
|
||||||
Foam::functionObjects::populationBalanceMoments::coordinateType,
|
|
||||||
3
|
|
||||||
>
|
|
||||||
Foam::functionObjects::populationBalanceMoments::coordinateTypeNames_;
|
|
||||||
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
template<>
|
|
||||||
const char* NamedEnum
|
|
||||||
<
|
|
||||||
Foam::functionObjects::populationBalanceMoments::weightType,
|
|
||||||
3
|
|
||||||
>::names[] =
|
|
||||||
{
|
|
||||||
"numberConcentration",
|
|
||||||
"volumeConcentration",
|
|
||||||
"areaConcentration"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::NamedEnum
|
|
||||||
<
|
|
||||||
Foam::functionObjects::populationBalanceMoments::weightType,
|
|
||||||
3
|
|
||||||
>
|
|
||||||
Foam::functionObjects::populationBalanceMoments::weightTypeNames_;
|
|
||||||
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
template<>
|
|
||||||
const char* NamedEnum
|
|
||||||
<
|
|
||||||
Foam::functionObjects::populationBalanceMoments::meanType,
|
|
||||||
3
|
|
||||||
>::names[] = {"arithmetic", "geometric", "notApplicable"};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::NamedEnum
|
|
||||||
<
|
|
||||||
Foam::functionObjects::populationBalanceMoments::meanType,
|
|
||||||
3
|
|
||||||
>
|
|
||||||
Foam::functionObjects::populationBalanceMoments::meanTypeNames_;
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::word
|
|
||||||
Foam::functionObjects::populationBalanceMoments::coordinateTypeSymbolicName()
|
|
||||||
{
|
|
||||||
word coordinateTypeSymbolicName(word::null);
|
|
||||||
|
|
||||||
switch (coordinateType_)
|
|
||||||
{
|
|
||||||
case coordinateType::volume:
|
|
||||||
{
|
|
||||||
coordinateTypeSymbolicName = "v";
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::area:
|
|
||||||
{
|
|
||||||
coordinateTypeSymbolicName = "a";
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::diameter:
|
|
||||||
{
|
|
||||||
coordinateTypeSymbolicName = "d";
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return coordinateTypeSymbolicName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::word
|
|
||||||
Foam::functionObjects::populationBalanceMoments::weightTypeSymbolicName()
|
|
||||||
{
|
|
||||||
word weightTypeSymbolicName(word::null);
|
|
||||||
|
|
||||||
switch (weightType_)
|
|
||||||
{
|
|
||||||
case weightType::numberConcentration:
|
|
||||||
{
|
|
||||||
weightTypeSymbolicName = "N";
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case weightType::volumeConcentration:
|
|
||||||
{
|
|
||||||
weightTypeSymbolicName = "V";
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case weightType::areaConcentration:
|
|
||||||
{
|
|
||||||
weightTypeSymbolicName = "A";
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return weightTypeSymbolicName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::word Foam::functionObjects::populationBalanceMoments::defaultFldName()
|
|
||||||
{
|
|
||||||
word meanName
|
|
||||||
(
|
|
||||||
meanType_ == meanType::geometric
|
|
||||||
? word(meanTypeNames_[meanType_]).capitalise()
|
|
||||||
: word("")
|
|
||||||
);
|
|
||||||
|
|
||||||
return
|
|
||||||
word
|
|
||||||
(
|
|
||||||
IOobject::groupName
|
|
||||||
(
|
|
||||||
"weighted"
|
|
||||||
+ meanName
|
|
||||||
+ word(momentTypeNames_[momentType_]).capitalise()
|
|
||||||
+ "("
|
|
||||||
+ weightTypeSymbolicName()
|
|
||||||
+ ","
|
|
||||||
+ coordinateTypeSymbolicName()
|
|
||||||
+ ")",
|
|
||||||
popBal_.name()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::word
|
|
||||||
Foam::functionObjects::populationBalanceMoments::integerMomentFldName()
|
|
||||||
{
|
|
||||||
return
|
|
||||||
word
|
|
||||||
(
|
|
||||||
IOobject::groupName
|
|
||||||
(
|
|
||||||
word(momentTypeNames_[momentType_])
|
|
||||||
+ Foam::name(order_)
|
|
||||||
+ "("
|
|
||||||
+ weightTypeSymbolicName()
|
|
||||||
+ ","
|
|
||||||
+ coordinateTypeSymbolicName()
|
|
||||||
+ ")",
|
|
||||||
popBal_.name()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::functionObjects::populationBalanceMoments::setDimensions
|
|
||||||
(
|
|
||||||
volScalarField& fld,
|
|
||||||
momentType momType
|
|
||||||
)
|
|
||||||
{
|
|
||||||
switch (momType)
|
|
||||||
{
|
|
||||||
case momentType::integerMoment:
|
|
||||||
{
|
|
||||||
switch (coordinateType_)
|
|
||||||
{
|
|
||||||
case coordinateType::volume:
|
|
||||||
{
|
|
||||||
fld.dimensions().reset
|
|
||||||
(
|
|
||||||
pow(dimVolume, order_)/dimVolume
|
|
||||||
);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::area:
|
|
||||||
{
|
|
||||||
fld.dimensions().reset
|
|
||||||
(
|
|
||||||
pow(dimArea, order_)/dimVolume
|
|
||||||
);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::diameter:
|
|
||||||
{
|
|
||||||
fld.dimensions().reset
|
|
||||||
(
|
|
||||||
pow(dimLength, order_)/dimVolume
|
|
||||||
);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (weightType_)
|
|
||||||
{
|
|
||||||
case weightType::volumeConcentration:
|
|
||||||
{
|
|
||||||
fld.dimensions().reset(fld.dimensions()*dimVolume);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case weightType::areaConcentration:
|
|
||||||
{
|
|
||||||
fld.dimensions().reset(fld.dimensions()*dimArea);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case momentType::mean:
|
|
||||||
{
|
|
||||||
switch (coordinateType_)
|
|
||||||
{
|
|
||||||
case coordinateType::volume:
|
|
||||||
{
|
|
||||||
fld.dimensions().reset(dimVolume);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::area:
|
|
||||||
{
|
|
||||||
fld.dimensions().reset(dimArea);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::diameter:
|
|
||||||
{
|
|
||||||
fld.dimensions().reset(dimLength);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case momentType::variance:
|
|
||||||
{
|
|
||||||
switch (coordinateType_)
|
|
||||||
{
|
|
||||||
case coordinateType::volume:
|
|
||||||
{
|
|
||||||
fld.dimensions().reset(sqr(dimVolume));
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::area:
|
|
||||||
{
|
|
||||||
fld.dimensions().reset(sqr(dimArea));
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::diameter:
|
|
||||||
{
|
|
||||||
fld.dimensions().reset(sqr(dimLength));
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (meanType_ == meanType::geometric)
|
|
||||||
{
|
|
||||||
fld.dimensions().reset(dimless);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case momentType::stdDev:
|
|
||||||
{
|
|
||||||
switch (coordinateType_)
|
|
||||||
{
|
|
||||||
case coordinateType::volume:
|
|
||||||
{
|
|
||||||
fld.dimensions().reset(dimVolume);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::area:
|
|
||||||
{
|
|
||||||
fld.dimensions().reset(dimArea);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::diameter:
|
|
||||||
{
|
|
||||||
fld.dimensions().reset(dimLength);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (meanType_ == meanType::geometric)
|
|
||||||
{
|
|
||||||
fld.dimensions().reset(dimless);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::functionObjects::populationBalanceMoments::totalConcentration()
|
|
||||||
{
|
|
||||||
tmp<volScalarField> tTotalConcentration
|
|
||||||
(
|
|
||||||
volScalarField::New
|
|
||||||
(
|
|
||||||
"totalConcentration",
|
|
||||||
mesh_,
|
|
||||||
dimensionedScalar(inv(dimVolume), Zero)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField& totalConcentration = tTotalConcentration.ref();
|
|
||||||
|
|
||||||
switch (weightType_)
|
|
||||||
{
|
|
||||||
case weightType::volumeConcentration:
|
|
||||||
{
|
|
||||||
totalConcentration.dimensions().reset
|
|
||||||
(
|
|
||||||
totalConcentration.dimensions()*dimVolume
|
|
||||||
);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case weightType::areaConcentration:
|
|
||||||
{
|
|
||||||
totalConcentration.dimensions().reset
|
|
||||||
(
|
|
||||||
totalConcentration.dimensions()*dimArea
|
|
||||||
);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(popBal_.sizeGroups(), i)
|
|
||||||
{
|
|
||||||
const Foam::diameterModels::sizeGroup& fi = popBal_.sizeGroups()[i];
|
|
||||||
|
|
||||||
switch (weightType_)
|
|
||||||
{
|
|
||||||
case weightType::numberConcentration:
|
|
||||||
{
|
|
||||||
totalConcentration += fi*fi.phase()/fi.x();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case weightType::volumeConcentration:
|
|
||||||
{
|
|
||||||
totalConcentration += fi*fi.phase();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case weightType::areaConcentration:
|
|
||||||
{
|
|
||||||
totalConcentration += fi.a()*fi*fi.phase()/fi.x();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return tTotalConcentration;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::functionObjects::populationBalanceMoments::mean()
|
|
||||||
{
|
|
||||||
tmp<volScalarField> tMean
|
|
||||||
(
|
|
||||||
volScalarField::New
|
|
||||||
(
|
|
||||||
"mean",
|
|
||||||
mesh_,
|
|
||||||
dimensionedScalar(dimless, Zero)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField& mean = tMean.ref();
|
|
||||||
|
|
||||||
setDimensions(mean, momentType::mean);
|
|
||||||
|
|
||||||
volScalarField totalConcentration(this->totalConcentration());
|
|
||||||
|
|
||||||
forAll(popBal_.sizeGroups(), i)
|
|
||||||
{
|
|
||||||
const Foam::diameterModels::sizeGroup& fi = popBal_.sizeGroups()[i];
|
|
||||||
|
|
||||||
volScalarField concentration(fi*fi.phase()/fi.x());
|
|
||||||
|
|
||||||
switch (weightType_)
|
|
||||||
{
|
|
||||||
case weightType::volumeConcentration:
|
|
||||||
{
|
|
||||||
concentration *= fi.x();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case weightType::areaConcentration:
|
|
||||||
{
|
|
||||||
concentration *= fi.a();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (meanType_)
|
|
||||||
{
|
|
||||||
case meanType::geometric:
|
|
||||||
{
|
|
||||||
mean.dimensions().reset(dimless);
|
|
||||||
|
|
||||||
switch (coordinateType_)
|
|
||||||
{
|
|
||||||
case coordinateType::volume:
|
|
||||||
{
|
|
||||||
dimensionedScalar unitVolume(dimVolume, 1);
|
|
||||||
|
|
||||||
mean +=
|
|
||||||
Foam::log(fi.x()/unitVolume)
|
|
||||||
*concentration/totalConcentration;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::area:
|
|
||||||
{
|
|
||||||
dimensionedScalar unitArea(dimArea, 1);
|
|
||||||
|
|
||||||
mean +=
|
|
||||||
Foam::log(fi.a()/unitArea)
|
|
||||||
*concentration/totalConcentration;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::diameter:
|
|
||||||
{
|
|
||||||
dimensionedScalar unitLength(dimLength, 1);
|
|
||||||
|
|
||||||
mean +=
|
|
||||||
Foam::log(fi.d()/unitLength)
|
|
||||||
*concentration/totalConcentration;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
switch (coordinateType_)
|
|
||||||
{
|
|
||||||
case coordinateType::volume:
|
|
||||||
{
|
|
||||||
mean += fi.x()*concentration/totalConcentration;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::area:
|
|
||||||
{
|
|
||||||
mean += fi.a()*concentration/totalConcentration;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::diameter:
|
|
||||||
{
|
|
||||||
mean += fi.d()*concentration/totalConcentration;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (meanType_ == meanType::geometric)
|
|
||||||
{
|
|
||||||
mean = exp(mean);
|
|
||||||
|
|
||||||
setDimensions(mean, momentType::mean);
|
|
||||||
}
|
|
||||||
|
|
||||||
return tMean;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::functionObjects::populationBalanceMoments::variance()
|
|
||||||
{
|
|
||||||
tmp<volScalarField> tVariance
|
|
||||||
(
|
|
||||||
volScalarField::New
|
|
||||||
(
|
|
||||||
"variance",
|
|
||||||
mesh_,
|
|
||||||
dimensionedScalar(dimless, Zero)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField& variance = tVariance.ref();
|
|
||||||
|
|
||||||
setDimensions(variance, momentType::variance);
|
|
||||||
|
|
||||||
volScalarField totalConcentration(this->totalConcentration());
|
|
||||||
volScalarField mean(this->mean());
|
|
||||||
|
|
||||||
forAll(popBal_.sizeGroups(), i)
|
|
||||||
{
|
|
||||||
const Foam::diameterModels::sizeGroup& fi = popBal_.sizeGroups()[i];
|
|
||||||
|
|
||||||
volScalarField concentration(fi*fi.phase()/fi.x());
|
|
||||||
|
|
||||||
switch (weightType_)
|
|
||||||
{
|
|
||||||
case weightType::volumeConcentration:
|
|
||||||
{
|
|
||||||
concentration *= fi.x();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case weightType::areaConcentration:
|
|
||||||
{
|
|
||||||
concentration *= fi.a();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (meanType_)
|
|
||||||
{
|
|
||||||
case meanType::geometric:
|
|
||||||
{
|
|
||||||
switch (coordinateType_)
|
|
||||||
{
|
|
||||||
case coordinateType::volume:
|
|
||||||
{
|
|
||||||
variance +=
|
|
||||||
sqr(Foam::log(fi.x()/mean))
|
|
||||||
*concentration/totalConcentration;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::area:
|
|
||||||
{
|
|
||||||
variance +=
|
|
||||||
sqr(Foam::log(fi.a()/mean))
|
|
||||||
*concentration/totalConcentration;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::diameter:
|
|
||||||
{
|
|
||||||
variance +=
|
|
||||||
sqr(Foam::log(fi.d()/mean))
|
|
||||||
*concentration/totalConcentration;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
switch (coordinateType_)
|
|
||||||
{
|
|
||||||
case coordinateType::volume:
|
|
||||||
{
|
|
||||||
variance +=
|
|
||||||
sqr(fi.x() - mean)*concentration/totalConcentration;
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::area:
|
|
||||||
{
|
|
||||||
variance +=
|
|
||||||
sqr(fi.a() - mean)*concentration/totalConcentration;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::diameter:
|
|
||||||
{
|
|
||||||
variance +=
|
|
||||||
sqr(fi.d() - mean)*concentration/totalConcentration;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return tVariance;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::functionObjects::populationBalanceMoments::stdDev()
|
|
||||||
{
|
|
||||||
switch (meanType_)
|
|
||||||
{
|
|
||||||
case meanType::geometric:
|
|
||||||
{
|
|
||||||
return exp(sqrt(this->variance()));
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
return sqrt(this->variance());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::functionObjects::populationBalanceMoments::populationBalanceMoments
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const Time& runTime,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fvMeshFunctionObject(name, runTime, dict),
|
|
||||||
popBal_
|
|
||||||
(
|
|
||||||
obr_.lookupObject<Foam::diameterModels::populationBalanceModel>
|
|
||||||
(
|
|
||||||
dict.lookup("populationBalance")
|
|
||||||
)
|
|
||||||
),
|
|
||||||
momentType_(momentTypeNames_.read(dict.lookup("momentType"))),
|
|
||||||
coordinateType_(coordinateTypeNames_.read(dict.lookup("coordinateType"))),
|
|
||||||
weightType_
|
|
||||||
(
|
|
||||||
dict.found("weightType")
|
|
||||||
? weightTypeNames_.read(dict.lookup("weightType"))
|
|
||||||
: weightType::numberConcentration
|
|
||||||
),
|
|
||||||
meanType_(meanType::notApplicable),
|
|
||||||
order_(-1),
|
|
||||||
fldPtr_(nullptr)
|
|
||||||
{
|
|
||||||
read(dict);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::functionObjects::populationBalanceMoments::~populationBalanceMoments()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
bool
|
|
||||||
Foam::functionObjects::populationBalanceMoments::read(const dictionary& dict)
|
|
||||||
{
|
|
||||||
fvMeshFunctionObject::read(dict);
|
|
||||||
|
|
||||||
switch (momentType_)
|
|
||||||
{
|
|
||||||
case momentType::integerMoment:
|
|
||||||
{
|
|
||||||
order_ = dict.lookup<int>("order");
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
meanType_ =
|
|
||||||
dict.found("meanType")
|
|
||||||
? meanTypeNames_.read(dict.lookup("meanType"))
|
|
||||||
: meanType::arithmetic;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (momentType_)
|
|
||||||
{
|
|
||||||
case momentType::integerMoment:
|
|
||||||
{
|
|
||||||
fldPtr_.set
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
this->integerMomentFldName(),
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimensionedScalar(dimless, Zero)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField& integerMoment = fldPtr_();
|
|
||||||
|
|
||||||
setDimensions(integerMoment, momentType::integerMoment);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case momentType::mean:
|
|
||||||
{
|
|
||||||
fldPtr_.set
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
this->defaultFldName(),
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
this->mean()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case momentType::variance:
|
|
||||||
{
|
|
||||||
fldPtr_.set
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
this->defaultFldName(),
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
this->variance()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case momentType::stdDev:
|
|
||||||
{
|
|
||||||
fldPtr_.set
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
this->defaultFldName(),
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
this->stdDev()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::populationBalanceMoments::execute()
|
|
||||||
{
|
|
||||||
switch (momentType_)
|
|
||||||
{
|
|
||||||
case momentType::integerMoment:
|
|
||||||
{
|
|
||||||
volScalarField& integerMoment = fldPtr_();
|
|
||||||
|
|
||||||
integerMoment = Zero;
|
|
||||||
|
|
||||||
forAll(popBal_.sizeGroups(), i)
|
|
||||||
{
|
|
||||||
const Foam::diameterModels::sizeGroup& fi =
|
|
||||||
popBal_.sizeGroups()[i];
|
|
||||||
|
|
||||||
volScalarField concentration(fi*fi.phase()/fi.x());
|
|
||||||
|
|
||||||
switch (weightType_)
|
|
||||||
{
|
|
||||||
case weightType::volumeConcentration:
|
|
||||||
{
|
|
||||||
concentration *= fi.x();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case weightType::areaConcentration:
|
|
||||||
{
|
|
||||||
concentration *= fi.a();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (coordinateType_)
|
|
||||||
{
|
|
||||||
case coordinateType::volume:
|
|
||||||
{
|
|
||||||
integerMoment +=
|
|
||||||
pow(fi.x(), order_)*concentration;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::area:
|
|
||||||
{
|
|
||||||
integerMoment +=
|
|
||||||
pow(fi.a(), order_)*concentration;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::diameter:
|
|
||||||
{
|
|
||||||
integerMoment +=
|
|
||||||
pow(fi.d(), order_)*concentration;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case momentType::mean:
|
|
||||||
{
|
|
||||||
fldPtr_() = this->mean();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case momentType::variance:
|
|
||||||
{
|
|
||||||
fldPtr_() = this->variance();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case momentType::stdDev:
|
|
||||||
{
|
|
||||||
fldPtr_() = sqrt(this->variance());
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::populationBalanceMoments::write()
|
|
||||||
{
|
|
||||||
writeObject(fldPtr_->name());
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,258 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2022 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::functionObjects::populationBalanceMoments
|
|
||||||
|
|
||||||
Description
|
|
||||||
Calculates and writes out integral (integer moments) or mean properties
|
|
||||||
(mean, variance, standard deviation) of a size distribution determined by a
|
|
||||||
population balance model. Requires solver post-processing.
|
|
||||||
|
|
||||||
The following function object specification for example returns the first
|
|
||||||
moment of the volume-based number density function which is equivalent to
|
|
||||||
the phase fraction of the particulate phase:
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
populationBalanceMoments
|
|
||||||
{
|
|
||||||
type populationBalanceMoments;
|
|
||||||
libs ("libmultiphaseEulerFoamFunctionObjects.so");
|
|
||||||
executeControl timeStep;
|
|
||||||
writeControl writeTime;
|
|
||||||
populationBalance bubbles;
|
|
||||||
momentType integerMoment;
|
|
||||||
coordinateType volume;
|
|
||||||
order 1;
|
|
||||||
}
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
Usage
|
|
||||||
\table
|
|
||||||
Property | Description | Required | Default
|
|
||||||
populationBalance | population balance name | yes |
|
|
||||||
momentType | desired moment of the distribution\\
|
|
||||||
| yes |
|
|
||||||
coordinateType | particle property | yes |
|
|
||||||
weightType | number/volume/area concentration\\
|
|
||||||
| no\\
|
|
||||||
| numberConcentration
|
|
||||||
order | order of integer moment | for integer moments |
|
|
||||||
meanType | arithmetic or geometric | for non-integer moments\\
|
|
||||||
| arithmetic
|
|
||||||
\endtable
|
|
||||||
|
|
||||||
See also
|
|
||||||
Foam::diameterModels::populationBalanceModel
|
|
||||||
Foam::functionObjects::fvMeshFunctionObject
|
|
||||||
Foam::functionObject
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
populationBalanceMoments.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef functionObjects_populationBalanceMoments_H
|
|
||||||
#define functionObjects_populationBalanceMoments_H
|
|
||||||
|
|
||||||
#include "fvMeshFunctionObject.H"
|
|
||||||
#include "populationBalanceModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace functionObjects
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class populationBalanceMoments Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class populationBalanceMoments
|
|
||||||
:
|
|
||||||
public fvMeshFunctionObject
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Enumeration for the moment types
|
|
||||||
enum class momentType
|
|
||||||
{
|
|
||||||
integerMoment,
|
|
||||||
mean,
|
|
||||||
variance,
|
|
||||||
stdDev
|
|
||||||
};
|
|
||||||
|
|
||||||
//- Names of the moment types
|
|
||||||
static const NamedEnum<momentType, 4> momentTypeNames_;
|
|
||||||
|
|
||||||
//- Enumeration for the coordinate types
|
|
||||||
enum class coordinateType
|
|
||||||
{
|
|
||||||
volume,
|
|
||||||
area,
|
|
||||||
diameter
|
|
||||||
};
|
|
||||||
|
|
||||||
//- Names of the coordinate types
|
|
||||||
static const NamedEnum<coordinateType, 3> coordinateTypeNames_;
|
|
||||||
|
|
||||||
//- Enumeration for the weight types
|
|
||||||
enum class weightType
|
|
||||||
{
|
|
||||||
numberConcentration,
|
|
||||||
volumeConcentration,
|
|
||||||
areaConcentration
|
|
||||||
};
|
|
||||||
|
|
||||||
//- Names of the weight types
|
|
||||||
static const NamedEnum<weightType, 3> weightTypeNames_;
|
|
||||||
|
|
||||||
//- Enumeration for the mean types
|
|
||||||
enum class meanType
|
|
||||||
{
|
|
||||||
arithmetic,
|
|
||||||
geometric,
|
|
||||||
notApplicable
|
|
||||||
};
|
|
||||||
|
|
||||||
//- Names of the mean types
|
|
||||||
static const NamedEnum<meanType, 3> meanTypeNames_;
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Reference to population balance
|
|
||||||
const Foam::diameterModels::populationBalanceModel& popBal_;
|
|
||||||
|
|
||||||
//- Moment type
|
|
||||||
momentType momentType_;
|
|
||||||
|
|
||||||
//- Coordinate type
|
|
||||||
coordinateType coordinateType_;
|
|
||||||
|
|
||||||
//- Weight type
|
|
||||||
weightType weightType_;
|
|
||||||
|
|
||||||
//- Mean type
|
|
||||||
meanType meanType_;
|
|
||||||
|
|
||||||
//- Integer moment order
|
|
||||||
int order_;
|
|
||||||
|
|
||||||
//- Result field
|
|
||||||
autoPtr<volScalarField> fldPtr_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Coordinate type symbolic name for shorter field names
|
|
||||||
word coordinateTypeSymbolicName();
|
|
||||||
|
|
||||||
//- Weight type symbolic name for shorter field names
|
|
||||||
word weightTypeSymbolicName();
|
|
||||||
|
|
||||||
//- Default field name
|
|
||||||
word defaultFldName();
|
|
||||||
|
|
||||||
//- Integer moment field name
|
|
||||||
word integerMomentFldName();
|
|
||||||
|
|
||||||
//- Set dimensions
|
|
||||||
void setDimensions(volScalarField& fld, momentType momType);
|
|
||||||
|
|
||||||
//- Total concentration
|
|
||||||
tmp<volScalarField> totalConcentration();
|
|
||||||
|
|
||||||
//- Mean value
|
|
||||||
tmp<volScalarField> mean();
|
|
||||||
|
|
||||||
//- Variance
|
|
||||||
tmp<volScalarField> variance();
|
|
||||||
|
|
||||||
//- Standard deviation
|
|
||||||
tmp<volScalarField> stdDev();
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("populationBalanceMoments");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from Time and dictionary
|
|
||||||
populationBalanceMoments
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const Time& runTime,
|
|
||||||
const dictionary&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construction
|
|
||||||
populationBalanceMoments(const populationBalanceMoments&) = delete;
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~populationBalanceMoments();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Read the data
|
|
||||||
virtual bool read(const dictionary&);
|
|
||||||
|
|
||||||
//- Return the list of fields required
|
|
||||||
virtual wordList fields() const
|
|
||||||
{
|
|
||||||
return wordList::null();
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Calculate the moment fields
|
|
||||||
virtual bool execute();
|
|
||||||
|
|
||||||
//- Write the moment fields
|
|
||||||
virtual bool write();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const populationBalanceMoments&) = delete;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace functionObjects
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,664 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2017-2022 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 "populationBalanceSizeDistribution.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace functionObjects
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(populationBalanceSizeDistribution, 0);
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
functionObject,
|
|
||||||
populationBalanceSizeDistribution,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template<>
|
|
||||||
const char*
|
|
||||||
Foam::NamedEnum
|
|
||||||
<
|
|
||||||
Foam::functionObjects::populationBalanceSizeDistribution::functionType,
|
|
||||||
6
|
|
||||||
>::names[] =
|
|
||||||
{
|
|
||||||
"numberConcentration",
|
|
||||||
"numberDensity",
|
|
||||||
"volumeConcentration",
|
|
||||||
"volumeDensity",
|
|
||||||
"areaConcentration",
|
|
||||||
"areaDensity"
|
|
||||||
};
|
|
||||||
|
|
||||||
const Foam::NamedEnum
|
|
||||||
<
|
|
||||||
Foam::functionObjects::populationBalanceSizeDistribution::functionType,
|
|
||||||
6
|
|
||||||
> Foam::functionObjects::populationBalanceSizeDistribution::functionTypeNames_;
|
|
||||||
|
|
||||||
template<>
|
|
||||||
const char*
|
|
||||||
Foam::NamedEnum
|
|
||||||
<
|
|
||||||
Foam::functionObjects::populationBalanceSizeDistribution::coordinateType,
|
|
||||||
4
|
|
||||||
>::names[] =
|
|
||||||
{
|
|
||||||
"volume",
|
|
||||||
"area",
|
|
||||||
"diameter",
|
|
||||||
"projectedAreaDiameter"
|
|
||||||
};
|
|
||||||
|
|
||||||
const Foam::NamedEnum
|
|
||||||
<
|
|
||||||
Foam::functionObjects::populationBalanceSizeDistribution::coordinateType,
|
|
||||||
4
|
|
||||||
> Foam::functionObjects::populationBalanceSizeDistribution::
|
|
||||||
coordinateTypeNames_;
|
|
||||||
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
template<>
|
|
||||||
const char* NamedEnum
|
|
||||||
<
|
|
||||||
Foam::functionObjects::populationBalanceSizeDistribution::weightType,
|
|
||||||
4
|
|
||||||
>::names[] =
|
|
||||||
{
|
|
||||||
"numberConcentration",
|
|
||||||
"volumeConcentration",
|
|
||||||
"areaConcentration",
|
|
||||||
"cellVolume"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::NamedEnum
|
|
||||||
<
|
|
||||||
Foam::functionObjects::populationBalanceSizeDistribution::weightType,
|
|
||||||
4
|
|
||||||
>
|
|
||||||
Foam::functionObjects::populationBalanceSizeDistribution::weightTypeNames_;
|
|
||||||
|
|
||||||
using Foam::constant::mathematical::pi;
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::word
|
|
||||||
Foam::functionObjects::populationBalanceSizeDistribution::
|
|
||||||
functionTypeSymbolicName()
|
|
||||||
{
|
|
||||||
word functionTypeSymbolicName(word::null);
|
|
||||||
|
|
||||||
switch (functionType_)
|
|
||||||
{
|
|
||||||
case functionType::numberConcentration:
|
|
||||||
{
|
|
||||||
functionTypeSymbolicName = "N";
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case functionType::numberDensity:
|
|
||||||
{
|
|
||||||
functionTypeSymbolicName = "n";
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case functionType::volumeConcentration:
|
|
||||||
{
|
|
||||||
functionTypeSymbolicName = "V";
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case functionType::volumeDensity:
|
|
||||||
{
|
|
||||||
functionTypeSymbolicName = "v";
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case functionType::areaConcentration:
|
|
||||||
{
|
|
||||||
functionTypeSymbolicName = "A";
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case functionType::areaDensity:
|
|
||||||
{
|
|
||||||
functionTypeSymbolicName = "a";
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return functionTypeSymbolicName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::word
|
|
||||||
Foam::functionObjects::populationBalanceSizeDistribution::
|
|
||||||
coordinateTypeSymbolicName
|
|
||||||
(
|
|
||||||
const coordinateType& cType
|
|
||||||
)
|
|
||||||
{
|
|
||||||
word coordinateTypeSymbolicName(word::null);
|
|
||||||
|
|
||||||
switch (cType)
|
|
||||||
{
|
|
||||||
case coordinateType::volume:
|
|
||||||
{
|
|
||||||
coordinateTypeSymbolicName = "v";
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::area:
|
|
||||||
{
|
|
||||||
coordinateTypeSymbolicName = "a";
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::diameter:
|
|
||||||
{
|
|
||||||
coordinateTypeSymbolicName = "d";
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::projectedAreaDiameter:
|
|
||||||
{
|
|
||||||
coordinateTypeSymbolicName = "dPa";
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return coordinateTypeSymbolicName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField>
|
|
||||||
Foam::functionObjects::populationBalanceSizeDistribution::filterField
|
|
||||||
(
|
|
||||||
const scalarField& field
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (isNull(cellIDs()))
|
|
||||||
{
|
|
||||||
return field;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return tmp<scalarField>(new scalarField(field, cellIDs()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar
|
|
||||||
Foam::functionObjects::populationBalanceSizeDistribution::averageCoordinateValue
|
|
||||||
(
|
|
||||||
const Foam::diameterModels::sizeGroup& fi,
|
|
||||||
const coordinateType& cType
|
|
||||||
)
|
|
||||||
{
|
|
||||||
scalar averageCoordinateValue(Zero);
|
|
||||||
|
|
||||||
switch (cType)
|
|
||||||
{
|
|
||||||
case coordinateType::volume:
|
|
||||||
{
|
|
||||||
averageCoordinateValue = fi.x().value();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::area:
|
|
||||||
{
|
|
||||||
averageCoordinateValue =
|
|
||||||
weightedAverage(fi.a(), fi);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::diameter:
|
|
||||||
{
|
|
||||||
averageCoordinateValue =
|
|
||||||
weightedAverage(fi.d(), fi);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case coordinateType::projectedAreaDiameter:
|
|
||||||
{
|
|
||||||
averageCoordinateValue =
|
|
||||||
weightedAverage(sqrt(fi.a()/pi), fi);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return averageCoordinateValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar
|
|
||||||
Foam::functionObjects::populationBalanceSizeDistribution::weightedAverage
|
|
||||||
(
|
|
||||||
const Foam::scalarField& fld,
|
|
||||||
const Foam::diameterModels::sizeGroup& fi
|
|
||||||
)
|
|
||||||
{
|
|
||||||
scalar weightedAverage(Zero);
|
|
||||||
|
|
||||||
switch (weightType_)
|
|
||||||
{
|
|
||||||
case weightType::numberConcentration:
|
|
||||||
{
|
|
||||||
scalarField Ni(filterField(fi*fi.phase()/fi.x().value()));
|
|
||||||
|
|
||||||
if (gSum(Ni) == 0)
|
|
||||||
{
|
|
||||||
weightedAverage =
|
|
||||||
gSum(filterField(mesh_.V()*fld))/this->V();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
weightedAverage =
|
|
||||||
gSum(Ni*filterField(fld))/gSum(Ni);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case weightType::volumeConcentration:
|
|
||||||
{
|
|
||||||
scalarField Vi(filterField(fi*fi.phase()));
|
|
||||||
|
|
||||||
if (gSum(Vi) == 0)
|
|
||||||
{
|
|
||||||
weightedAverage =
|
|
||||||
gSum(filterField(mesh_.V()*fld))/this->V();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
weightedAverage =
|
|
||||||
gSum(Vi*filterField(fld))/gSum(Vi);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case weightType::areaConcentration:
|
|
||||||
{
|
|
||||||
scalarField Ai(filterField(fi.a().ref()*fi.phase()));
|
|
||||||
|
|
||||||
if (gSum(Ai) == 0)
|
|
||||||
{
|
|
||||||
weightedAverage =
|
|
||||||
gSum(filterField(mesh_.V()*fld))/this->V();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
weightedAverage =
|
|
||||||
gSum(Ai*filterField(fld))/gSum(Ai);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case weightType::cellVolume:
|
|
||||||
{
|
|
||||||
weightedAverage =
|
|
||||||
gSum(filterField(mesh_.V()*fld))/this->V();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return weightedAverage;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::functionObjects::populationBalanceSizeDistribution::
|
|
||||||
populationBalanceSizeDistribution
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const Time& runTime,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fvMeshFunctionObject(name, runTime, dict),
|
|
||||||
volRegion(fvMeshFunctionObject::mesh_, dict),
|
|
||||||
file_(obr_, name),
|
|
||||||
mesh_(fvMeshFunctionObject::mesh_),
|
|
||||||
popBal_
|
|
||||||
(
|
|
||||||
obr_.lookupObject<Foam::diameterModels::populationBalanceModel>
|
|
||||||
(
|
|
||||||
dict.lookup("populationBalance")
|
|
||||||
)
|
|
||||||
),
|
|
||||||
functionType_(functionTypeNames_.read(dict.lookup("functionType"))),
|
|
||||||
coordinateType_(coordinateTypeNames_.read(dict.lookup("coordinateType"))),
|
|
||||||
allCoordinates_
|
|
||||||
(
|
|
||||||
dict.lookupOrDefault<Switch>("allCoordinates", false)
|
|
||||||
),
|
|
||||||
normalise_(dict.lookupOrDefault<Switch>("normalise", false)),
|
|
||||||
logTransform_
|
|
||||||
(
|
|
||||||
dict.lookupOrDefaultBackwardsCompatible<Switch>
|
|
||||||
(
|
|
||||||
{"logTransform", "geometric"},
|
|
||||||
false
|
|
||||||
)
|
|
||||||
),
|
|
||||||
weightType_
|
|
||||||
(
|
|
||||||
dict.found("weightType")
|
|
||||||
? weightTypeNames_.read(dict.lookup("weightType"))
|
|
||||||
: weightType::numberConcentration
|
|
||||||
),
|
|
||||||
formatterPtr_(nullptr)
|
|
||||||
{
|
|
||||||
read(dict);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::functionObjects::populationBalanceSizeDistribution::
|
|
||||||
~populationBalanceSizeDistribution()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
bool Foam::functionObjects::populationBalanceSizeDistribution::read
|
|
||||||
(
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
{
|
|
||||||
Log << type() << " " << name() << ":" << nl;
|
|
||||||
|
|
||||||
fvMeshFunctionObject::read(dict);
|
|
||||||
|
|
||||||
formatterPtr_ = setWriter::New(dict.lookup("setFormat"), dict);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::populationBalanceSizeDistribution::execute()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::populationBalanceSizeDistribution::write()
|
|
||||||
{
|
|
||||||
Log << type() << " " << name() << " write:" << nl;
|
|
||||||
|
|
||||||
const UPtrList<diameterModels::sizeGroup>& sizeGroups =
|
|
||||||
popBal_.sizeGroups();
|
|
||||||
|
|
||||||
scalarField coordinateValues(sizeGroups.size());
|
|
||||||
scalarField boundaryValues(sizeGroups.size() + 1);
|
|
||||||
scalarField resultValues(sizeGroups.size());
|
|
||||||
|
|
||||||
forAll(sizeGroups, i)
|
|
||||||
{
|
|
||||||
const diameterModels::sizeGroup& fi = sizeGroups[i];
|
|
||||||
|
|
||||||
coordinateValues[i] = averageCoordinateValue(fi, coordinateType_);
|
|
||||||
}
|
|
||||||
|
|
||||||
if
|
|
||||||
(
|
|
||||||
functionType_ == functionType::numberDensity
|
|
||||||
|| functionType_ == functionType::volumeDensity
|
|
||||||
|| functionType_ == functionType::areaDensity
|
|
||||||
)
|
|
||||||
{
|
|
||||||
boundaryValues.first() = coordinateValues.first();
|
|
||||||
boundaryValues.last() = coordinateValues.last();
|
|
||||||
|
|
||||||
for (label i = 1; i < boundaryValues.size() - 1; i++)
|
|
||||||
{
|
|
||||||
boundaryValues[i] =
|
|
||||||
0.5*(coordinateValues[i] + coordinateValues[i-1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (logTransform_)
|
|
||||||
{
|
|
||||||
boundaryValues = Foam::log(boundaryValues);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (functionType_)
|
|
||||||
{
|
|
||||||
case functionType::numberConcentration:
|
|
||||||
{
|
|
||||||
forAll(sizeGroups, i)
|
|
||||||
{
|
|
||||||
const diameterModels::sizeGroup& fi = sizeGroups[i];
|
|
||||||
|
|
||||||
resultValues[i] =
|
|
||||||
gSum(filterField(mesh_.V()*fi*fi.phase()/fi.x()))/this->V();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (normalise_ && sum(resultValues) != 0)
|
|
||||||
{
|
|
||||||
resultValues /= sum(resultValues);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case functionType::numberDensity:
|
|
||||||
{
|
|
||||||
forAll(sizeGroups, i)
|
|
||||||
{
|
|
||||||
const diameterModels::sizeGroup& fi = sizeGroups[i];
|
|
||||||
|
|
||||||
resultValues[i] =
|
|
||||||
gSum(filterField(mesh_.V()*fi*fi.phase()/fi.x()))/this->V();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (normalise_ && sum(resultValues) != 0)
|
|
||||||
{
|
|
||||||
resultValues /= sum(resultValues);
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(resultValues, i)
|
|
||||||
{
|
|
||||||
resultValues[i] /= (boundaryValues[i+1] - boundaryValues[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case functionType::volumeConcentration:
|
|
||||||
{
|
|
||||||
forAll(sizeGroups, i)
|
|
||||||
{
|
|
||||||
const diameterModels::sizeGroup& fi = sizeGroups[i];
|
|
||||||
|
|
||||||
resultValues[i] =
|
|
||||||
gSum(filterField(mesh_.V()*fi*fi.phase()))/this->V();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (normalise_ && sum(resultValues) != 0)
|
|
||||||
{
|
|
||||||
resultValues /= sum(resultValues);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case functionType::volumeDensity:
|
|
||||||
{
|
|
||||||
forAll(sizeGroups, i)
|
|
||||||
{
|
|
||||||
const diameterModels::sizeGroup& fi = sizeGroups[i];
|
|
||||||
|
|
||||||
resultValues[i] =
|
|
||||||
gSum(filterField(mesh_.V()*fi*fi.phase()))/this->V();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (normalise_ && sum(resultValues) != 0)
|
|
||||||
{
|
|
||||||
resultValues /= sum(resultValues);
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(resultValues, i)
|
|
||||||
{
|
|
||||||
resultValues[i] /= (boundaryValues[i+1] - boundaryValues[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case functionType::areaConcentration:
|
|
||||||
{
|
|
||||||
forAll(sizeGroups, i)
|
|
||||||
{
|
|
||||||
const diameterModels::sizeGroup& fi = sizeGroups[i];
|
|
||||||
|
|
||||||
resultValues[i] =
|
|
||||||
gSum
|
|
||||||
(
|
|
||||||
filterField(mesh_.V()*fi.a().ref()*fi*fi.phase()/fi.x())
|
|
||||||
)
|
|
||||||
/this->V();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (normalise_ && sum(resultValues) != 0)
|
|
||||||
{
|
|
||||||
resultValues /= sum(resultValues);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case functionType::areaDensity:
|
|
||||||
{
|
|
||||||
forAll(sizeGroups, i)
|
|
||||||
{
|
|
||||||
const diameterModels::sizeGroup& fi = sizeGroups[i];
|
|
||||||
|
|
||||||
resultValues[i] =
|
|
||||||
gSum
|
|
||||||
(
|
|
||||||
filterField(mesh_.V()*fi.a().ref()*fi*fi.phase()/fi.x())
|
|
||||||
)
|
|
||||||
/this->V();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (normalise_ && sum(resultValues) != 0)
|
|
||||||
{
|
|
||||||
resultValues /= sum(resultValues);
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(resultValues, i)
|
|
||||||
{
|
|
||||||
resultValues[i] /= (boundaryValues[i+1] - boundaryValues[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (allCoordinates_)
|
|
||||||
{
|
|
||||||
wordList otherCoordinateSymbolicNames(coordinateTypeNames_.size());
|
|
||||||
PtrList<scalarField> otherCoordinateValues(coordinateTypeNames_.size());
|
|
||||||
typedef NamedEnum<coordinateType, 4> namedEnumCoordinateType;
|
|
||||||
|
|
||||||
forAllConstIter(namedEnumCoordinateType, coordinateTypeNames_, iter)
|
|
||||||
{
|
|
||||||
const coordinateType cType = coordinateTypeNames_[iter.key()];
|
|
||||||
|
|
||||||
otherCoordinateSymbolicNames[cType] =
|
|
||||||
coordinateTypeSymbolicName(cType);
|
|
||||||
|
|
||||||
otherCoordinateValues.set
|
|
||||||
(
|
|
||||||
cType,
|
|
||||||
new scalarField(popBal_.sizeGroups().size())
|
|
||||||
);
|
|
||||||
|
|
||||||
forAll(sizeGroups, i)
|
|
||||||
{
|
|
||||||
const diameterModels::sizeGroup& fi = sizeGroups[i];
|
|
||||||
|
|
||||||
otherCoordinateValues[cType][i] =
|
|
||||||
averageCoordinateValue(fi, cType);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Pstream::master())
|
|
||||||
{
|
|
||||||
formatterPtr_->write
|
|
||||||
(
|
|
||||||
file_.baseTimeDir(),
|
|
||||||
name(),
|
|
||||||
coordSet
|
|
||||||
(
|
|
||||||
true,
|
|
||||||
coordinateTypeSymbolicName(coordinateType_),
|
|
||||||
coordinateValues
|
|
||||||
),
|
|
||||||
functionTypeSymbolicName(),
|
|
||||||
resultValues,
|
|
||||||
otherCoordinateSymbolicNames,
|
|
||||||
otherCoordinateValues
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (Pstream::master())
|
|
||||||
{
|
|
||||||
formatterPtr_->write
|
|
||||||
(
|
|
||||||
file_.baseTimeDir(),
|
|
||||||
name(),
|
|
||||||
coordSet
|
|
||||||
(
|
|
||||||
true,
|
|
||||||
coordinateTypeSymbolicName(coordinateType_),
|
|
||||||
coordinateValues
|
|
||||||
),
|
|
||||||
functionTypeSymbolicName(),
|
|
||||||
resultValues
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,268 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2017-2022 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::functionObjects::populationBalanceSizeDistribution
|
|
||||||
|
|
||||||
Description
|
|
||||||
Writes out the size distribution determined by a population balance model,
|
|
||||||
either for the entire domain or a cell zone. Requires solver post-
|
|
||||||
processing.
|
|
||||||
|
|
||||||
The following function object specification for example returns the volume-
|
|
||||||
based number density function:
|
|
||||||
|
|
||||||
Example of function object specification:
|
|
||||||
\verbatim
|
|
||||||
numberDensity
|
|
||||||
{
|
|
||||||
type populationBalanceSizeDistribution;
|
|
||||||
libs ("libmultiphaseEulerFoamFunctionObjects.so");
|
|
||||||
writeControl writeTime;
|
|
||||||
populationBalance bubbles;
|
|
||||||
functionType numberDensity;
|
|
||||||
coordinateType volume;
|
|
||||||
setFormat raw;
|
|
||||||
}
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
Usage
|
|
||||||
\table
|
|
||||||
Property | Description | Required | Default
|
|
||||||
populationBalance | population balance name | yes |
|
|
||||||
functionType | function type | yes |
|
|
||||||
coordinateType | particle property | yes |
|
|
||||||
allCoordinates | write all coordinate values | no | false
|
|
||||||
normalise | divide by total concentration | no | false
|
|
||||||
logTransform | class width based on log of coordinate\\
|
|
||||||
| no | false
|
|
||||||
weightType | weighting in case of field-dependent particle\\
|
|
||||||
properties | no\\
|
|
||||||
| numberConcentration
|
|
||||||
regionType | cellZone or all | no | all
|
|
||||||
name | name of cellZone if required | no |
|
|
||||||
setFormat | output format | yes |
|
|
||||||
\endtable
|
|
||||||
|
|
||||||
See also
|
|
||||||
Foam::diameterModels::populationBalanceModel
|
|
||||||
Foam::functionObjects::fvMeshFunctionObject
|
|
||||||
Foam::functionObjects::volRegion
|
|
||||||
Foam::functionObject
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
populationBalanceSizeDistribution.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef populationBalanceSizeDistribution_H
|
|
||||||
#define populationBalanceSizeDistribution_H
|
|
||||||
|
|
||||||
#include "fvMeshFunctionObject.H"
|
|
||||||
#include "volRegion.H"
|
|
||||||
#include "populationBalanceModel.H"
|
|
||||||
#include "writeFile.H"
|
|
||||||
#include "setWriter.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace functionObjects
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class populationBalanceSizeDistribution Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class populationBalanceSizeDistribution
|
|
||||||
:
|
|
||||||
public fvMeshFunctionObject,
|
|
||||||
public volRegion
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Public Data Types
|
|
||||||
|
|
||||||
//- Function type enumeration
|
|
||||||
enum functionType
|
|
||||||
{
|
|
||||||
numberConcentration,
|
|
||||||
numberDensity,
|
|
||||||
volumeConcentration,
|
|
||||||
volumeDensity,
|
|
||||||
areaConcentration,
|
|
||||||
areaDensity
|
|
||||||
};
|
|
||||||
|
|
||||||
//- Function type names
|
|
||||||
static const NamedEnum<functionType, 6> functionTypeNames_;
|
|
||||||
|
|
||||||
//- Coordinate type enumeration
|
|
||||||
enum coordinateType
|
|
||||||
{
|
|
||||||
volume,
|
|
||||||
area,
|
|
||||||
diameter,
|
|
||||||
projectedAreaDiameter
|
|
||||||
};
|
|
||||||
|
|
||||||
//- Coordinate type names
|
|
||||||
static const NamedEnum<coordinateType, 4> coordinateTypeNames_;
|
|
||||||
|
|
||||||
//- Enumeration for the weight types
|
|
||||||
enum class weightType
|
|
||||||
{
|
|
||||||
numberConcentration,
|
|
||||||
volumeConcentration,
|
|
||||||
areaConcentration,
|
|
||||||
cellVolume
|
|
||||||
};
|
|
||||||
|
|
||||||
//- Names of the weight types
|
|
||||||
static const NamedEnum<weightType, 4> weightTypeNames_;
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Write file
|
|
||||||
writeFile file_;
|
|
||||||
|
|
||||||
//- Reference to mesh
|
|
||||||
const fvMesh& mesh_;
|
|
||||||
|
|
||||||
//- Reference to population balance
|
|
||||||
const Foam::diameterModels::populationBalanceModel& popBal_;
|
|
||||||
|
|
||||||
//- Function type
|
|
||||||
functionType functionType_;
|
|
||||||
|
|
||||||
//- Coordinate type
|
|
||||||
coordinateType coordinateType_;
|
|
||||||
|
|
||||||
//- Add values for all coordinate types to output
|
|
||||||
Switch allCoordinates_;
|
|
||||||
|
|
||||||
//- Normalise result through division by sum
|
|
||||||
Switch normalise_;
|
|
||||||
|
|
||||||
//- Log transform
|
|
||||||
Switch logTransform_;
|
|
||||||
|
|
||||||
//- Weight types, relevant if particle properties are field dependent
|
|
||||||
weightType weightType_;
|
|
||||||
|
|
||||||
//- Set formatter
|
|
||||||
autoPtr<setWriter> formatterPtr_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Function type symbolic name for shorter file header
|
|
||||||
word functionTypeSymbolicName();
|
|
||||||
|
|
||||||
//- Coordinate type symbolic name for shorter file header
|
|
||||||
word coordinateTypeSymbolicName(const coordinateType& cType);
|
|
||||||
|
|
||||||
//- Filter a field according to cellIds
|
|
||||||
tmp<scalarField> filterField(const scalarField& field) const;
|
|
||||||
|
|
||||||
//- Field averaged coordinate value
|
|
||||||
scalar averageCoordinateValue
|
|
||||||
(
|
|
||||||
const diameterModels::sizeGroup& fi,
|
|
||||||
const coordinateType& cType
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Weighted average
|
|
||||||
scalar weightedAverage
|
|
||||||
(
|
|
||||||
const scalarField& fld,
|
|
||||||
const diameterModels::sizeGroup& fi
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("populationBalanceSizeDistribution");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from Time and dictionary
|
|
||||||
populationBalanceSizeDistribution
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const Time& runTime,
|
|
||||||
const dictionary& dict
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construction
|
|
||||||
populationBalanceSizeDistribution
|
|
||||||
(
|
|
||||||
const populationBalanceSizeDistribution&
|
|
||||||
) = delete;
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~populationBalanceSizeDistribution();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return the list of fields required
|
|
||||||
virtual wordList fields() const
|
|
||||||
{
|
|
||||||
return wordList::null();
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Read the populationBalanceSizeDistribution data
|
|
||||||
virtual bool read(const dictionary&);
|
|
||||||
|
|
||||||
//- Execute, currently does nothing
|
|
||||||
virtual bool execute();
|
|
||||||
|
|
||||||
//- Calculate and write the size distribution
|
|
||||||
virtual bool write();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const populationBalanceSizeDistribution&) = delete;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace functionObjects
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
phaseTurbulenceStabilisation/phaseTurbulenceStabilisation.C
|
|
||||||
interfaceTurbulenceDamping/interfaceTurbulenceDamping.C
|
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libmultiphaseEulerFoamFvModels
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
EXE_INC = \
|
|
||||||
-I../phaseSystems/lnInclude \
|
|
||||||
-I$(LIB_SRC)/physicalProperties/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
|
||||||
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/MomentumTransportModels/phaseCompressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude
|
|
||||||
|
|
||||||
LIB_LIBS = \
|
|
||||||
-lphaseSystem \
|
|
||||||
-lmultiphaseSystems \
|
|
||||||
-leulerianInterfacialModels \
|
|
||||||
-leulerianInterfacialCompositionModels \
|
|
||||||
-lmultiphaseMomentumTransportModels \
|
|
||||||
-lmultiphaseReactions \
|
|
||||||
-lmultiphaseProperties \
|
|
||||||
-lphaseFluidThermophysicalTransportModels \
|
|
||||||
-lphaseFluidMulticomponentThermophysicalTransportModels \
|
|
||||||
-lfiniteVolume \
|
|
||||||
-lfvModels \
|
|
||||||
-lmeshTools
|
|
||||||
@ -1,321 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2022 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 "interfaceTurbulenceDamping.H"
|
|
||||||
#include "surfaceInterpolate.H"
|
|
||||||
#include "fvcGrad.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace fv
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(interfaceTurbulenceDamping, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
fvModel,
|
|
||||||
interfaceTurbulenceDamping,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField::Internal>
|
|
||||||
Foam::fv::interfaceTurbulenceDamping::interfaceFraction
|
|
||||||
(
|
|
||||||
const volScalarField& alpha
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
const fvMesh& mesh = this->mesh();
|
|
||||||
|
|
||||||
tmp<volScalarField::Internal> tA
|
|
||||||
(
|
|
||||||
volScalarField::Internal::New
|
|
||||||
(
|
|
||||||
"A",
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar(dimless, 0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
volScalarField::Internal& A = tA.ref();
|
|
||||||
|
|
||||||
const surfaceVectorField& Sf = mesh.Sf();
|
|
||||||
const labelUList& own = mesh.owner();
|
|
||||||
const labelUList& nei = mesh.neighbour();
|
|
||||||
|
|
||||||
const surfaceScalarField alphaf(fvc::interpolate(alpha));
|
|
||||||
|
|
||||||
const volVectorField gradAlpha(fvc::grad(alpha));
|
|
||||||
const volVectorField::Internal n
|
|
||||||
(
|
|
||||||
gradAlpha()/(mag(gradAlpha()) + phase_.fluid().deltaN())
|
|
||||||
);
|
|
||||||
|
|
||||||
const scalarField& ialpha = alpha;
|
|
||||||
const scalarField& ialphaf = alphaf;
|
|
||||||
scalarField sumnSf(mesh.nCells(), 0);
|
|
||||||
|
|
||||||
forAll(own, facei)
|
|
||||||
{
|
|
||||||
{
|
|
||||||
const scalar nSf(mag(n[own[facei]] & Sf[facei]));
|
|
||||||
A[own[facei]] += nSf*(ialphaf[facei] - ialpha[own[facei]]);
|
|
||||||
sumnSf[own[facei]] += nSf;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const scalar nSf(mag(n[nei[facei]] & Sf[facei]));
|
|
||||||
A[nei[facei]] += nSf*(ialphaf[facei] - ialpha[nei[facei]]);
|
|
||||||
sumnSf[nei[facei]] += nSf;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(mesh.boundary(), patchi)
|
|
||||||
{
|
|
||||||
const labelUList& own = mesh.boundary()[patchi].faceCells();
|
|
||||||
const fvsPatchScalarField& palphaf = alphaf.boundaryField()[patchi];
|
|
||||||
|
|
||||||
forAll(mesh.boundary()[patchi], facei)
|
|
||||||
{
|
|
||||||
const scalar nSf(mag(n[own[facei]] & Sf[facei]));
|
|
||||||
A[own[facei]] += nSf*(palphaf[facei] - ialpha[own[facei]]);
|
|
||||||
sumnSf[own[facei]] += nSf;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
scalarField& a = A.field();
|
|
||||||
forAll(a, i)
|
|
||||||
{
|
|
||||||
if (sumnSf[i] > small)
|
|
||||||
{
|
|
||||||
a[i] = 2*mag(a[i])/sumnSf[i];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
a[i] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return tA;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class RhoType>
|
|
||||||
void Foam::fv::interfaceTurbulenceDamping::addRhoSup
|
|
||||||
(
|
|
||||||
const RhoType& rho,
|
|
||||||
fvMatrix<scalar>& eqn,
|
|
||||||
const word& fieldName
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< type() << ": applying source to " << eqn.psi().name() << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
const phaseSystem::phaseModelPartialList& movingPhases =
|
|
||||||
phase_.fluid().movingPhases();
|
|
||||||
|
|
||||||
volScalarField::Internal aSqrnu
|
|
||||||
(
|
|
||||||
movingPhases[0]*sqr(movingPhases[0].thermo().nu()()())
|
|
||||||
);
|
|
||||||
|
|
||||||
for (label phasei=1; phasei<movingPhases.size(); phasei++)
|
|
||||||
{
|
|
||||||
aSqrnu +=
|
|
||||||
movingPhases[phasei]*sqr(movingPhases[phasei].thermo().nu()()());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fieldName == "epsilon")
|
|
||||||
{
|
|
||||||
eqn += rho*interfaceFraction(phase_)*C2_*aSqrnu*turbulence_.k()()
|
|
||||||
/pow4(delta_);
|
|
||||||
}
|
|
||||||
else if (fieldName == "omega")
|
|
||||||
{
|
|
||||||
eqn += rho*interfaceFraction(phase_)*beta_*aSqrnu
|
|
||||||
/(sqr(betaStar_)*pow4(delta_));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Support for field " << fieldName << " is not implemented"
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::fv::interfaceTurbulenceDamping::interfaceTurbulenceDamping
|
|
||||||
(
|
|
||||||
const word& sourceName,
|
|
||||||
const word& modelType,
|
|
||||||
const dictionary& dict,
|
|
||||||
const fvMesh& mesh
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fvModel(sourceName, modelType, dict, mesh),
|
|
||||||
phaseName_(dict.lookup("phase")),
|
|
||||||
delta_("delta", dimLength, dict),
|
|
||||||
phase_
|
|
||||||
(
|
|
||||||
mesh.lookupObject<phaseModel>(IOobject::groupName("alpha", phaseName_))
|
|
||||||
),
|
|
||||||
turbulence_
|
|
||||||
(
|
|
||||||
mesh.lookupType<phaseCompressible::momentumTransportModel>(phaseName_)
|
|
||||||
),
|
|
||||||
C2_("C2", dimless, 0),
|
|
||||||
betaStar_("betaStar", dimless, 0),
|
|
||||||
beta_("beta", dimless, 0)
|
|
||||||
{
|
|
||||||
const word epsilonName(IOobject::groupName("epsilon", phaseName_));
|
|
||||||
const word omegaName(IOobject::groupName("omega", phaseName_));
|
|
||||||
|
|
||||||
if (mesh.foundObject<volScalarField>(epsilonName))
|
|
||||||
{
|
|
||||||
fieldName_ = epsilonName;
|
|
||||||
C2_.read(turbulence_.coeffDict());
|
|
||||||
}
|
|
||||||
else if (mesh.foundObject<volScalarField>(omegaName))
|
|
||||||
{
|
|
||||||
fieldName_ = omegaName;
|
|
||||||
betaStar_.read(turbulence_.coeffDict());
|
|
||||||
|
|
||||||
// Read beta for k-omega models or beta1 for k-omega SST
|
|
||||||
if (turbulence_.coeffDict().found("beta"))
|
|
||||||
{
|
|
||||||
beta_.read(turbulence_.coeffDict());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
beta_ =
|
|
||||||
dimensionedScalar("beta1", dimless, turbulence_.coeffDict());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalIOErrorInFunction(dict)
|
|
||||||
<< "Cannot find either " << epsilonName << " or " << omegaName
|
|
||||||
<< " field for fvModel " << typeName << exit(FatalIOError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::wordList Foam::fv::interfaceTurbulenceDamping::addSupFields() const
|
|
||||||
{
|
|
||||||
return wordList(1, fieldName_);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::interfaceTurbulenceDamping::addSup
|
|
||||||
(
|
|
||||||
fvMatrix<scalar>& eqn,
|
|
||||||
const word& fieldName
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
addRhoSup(one(), eqn, fieldName);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::interfaceTurbulenceDamping::addSup
|
|
||||||
(
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<scalar>& eqn,
|
|
||||||
const word& fieldName
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
addRhoSup(rho(), eqn, fieldName);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::interfaceTurbulenceDamping::addSup
|
|
||||||
(
|
|
||||||
const volScalarField& alpha,
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<scalar>& eqn,
|
|
||||||
const word& fieldName
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< type() << ": applying source to " << eqn.psi().name() << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
volScalarField::Internal aSqrnu
|
|
||||||
(
|
|
||||||
alpha*sqr(phase_.thermo().nu()()())
|
|
||||||
);
|
|
||||||
|
|
||||||
if (fieldName == IOobject::groupName("epsilon", phaseName_))
|
|
||||||
{
|
|
||||||
eqn += rho()*interfaceFraction(alpha)
|
|
||||||
*C2_*aSqrnu*turbulence_.k()()/pow4(delta_);
|
|
||||||
}
|
|
||||||
else if (fieldName == IOobject::groupName("omega", phaseName_))
|
|
||||||
{
|
|
||||||
eqn += rho()*interfaceFraction(alpha)
|
|
||||||
*beta_*aSqrnu/(sqr(betaStar_)*pow4(delta_));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Support for field " << fieldName << " is not implemented"
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::interfaceTurbulenceDamping::topoChange(const polyTopoChangeMap&)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::interfaceTurbulenceDamping::mapMesh(const polyMeshMap& map)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::interfaceTurbulenceDamping::distribute
|
|
||||||
(
|
|
||||||
const polyDistributionMap&
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
bool Foam::fv::interfaceTurbulenceDamping::movePoints()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,226 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2022 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::fv::interfaceTurbulenceDamping
|
|
||||||
|
|
||||||
Description
|
|
||||||
Free-surface phase turbulence damping function
|
|
||||||
|
|
||||||
Adds an extra source term to the mixture or phase epsilon or omega
|
|
||||||
equation to reduce turbulence generated near a free-surface. The
|
|
||||||
implementation is based on
|
|
||||||
|
|
||||||
Reference:
|
|
||||||
\verbatim
|
|
||||||
Frederix, E. M. A., Mathur, A., Dovizio, D., Geurts, B. J.,
|
|
||||||
& Komen, E. M. J. (2018).
|
|
||||||
Reynolds-averaged modeling of turbulence damping
|
|
||||||
near a large-scale interface in two-phase flow.
|
|
||||||
Nuclear engineering and design, 333, 122-130.
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
but with an improved formulation for the coefficient \c A appropriate for
|
|
||||||
unstructured meshes including those with split-cell refinement patterns.
|
|
||||||
However the dimensioned length-scale coefficient \c delta remains and must
|
|
||||||
be set appropriately for the case by performing test runs and comparing with
|
|
||||||
known results. Clearly this model is far from general and more research is
|
|
||||||
needed in order that \c delta can be obtained directly from the interface
|
|
||||||
flow and turbulence conditions.
|
|
||||||
|
|
||||||
Usage
|
|
||||||
Example usage:
|
|
||||||
\verbatim
|
|
||||||
interfaceTurbulenceDamping
|
|
||||||
{
|
|
||||||
type interfaceTurbulenceDamping;
|
|
||||||
|
|
||||||
libs ("libmultiphaseEulerFoamFvModels.so");
|
|
||||||
|
|
||||||
phase water;
|
|
||||||
|
|
||||||
// Interface turbulence damping length scale
|
|
||||||
// This is a required input as described in section 3.3 of the paper
|
|
||||||
delta 1e-4;
|
|
||||||
}
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
interfaceTurbulenceDamping.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef interfaceTurbulenceDamping_H
|
|
||||||
#define interfaceTurbulenceDamping_H
|
|
||||||
|
|
||||||
#include "fvModel.H"
|
|
||||||
#include "phaseSystem.H"
|
|
||||||
#include "phaseCompressibleMomentumTransportModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace fv
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class interfaceTurbulenceDamping Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class interfaceTurbulenceDamping
|
|
||||||
:
|
|
||||||
public fvModel
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- The name of the Lagrangian phase
|
|
||||||
word phaseName_;
|
|
||||||
|
|
||||||
//- Field name
|
|
||||||
word fieldName_;
|
|
||||||
|
|
||||||
//- Interface turbulence damping length scale
|
|
||||||
// This is a required input as described in section 3.3 of the paper
|
|
||||||
dimensionedScalar delta_;
|
|
||||||
|
|
||||||
//- Reference to the phase
|
|
||||||
const phaseModel& phase_;
|
|
||||||
|
|
||||||
//- Reference to the mixture turbulence model
|
|
||||||
const phaseCompressible::momentumTransportModel& turbulence_;
|
|
||||||
|
|
||||||
// Turbulence model coefficients
|
|
||||||
|
|
||||||
dimensionedScalar C2_;
|
|
||||||
dimensionedScalar betaStar_;
|
|
||||||
dimensionedScalar beta_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Interface fraction in a cell
|
|
||||||
tmp<volScalarField::Internal> interfaceFraction
|
|
||||||
(
|
|
||||||
const volScalarField& alpha
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Add explicit contribution to incompressible or compressible
|
|
||||||
// mixture epsilon or omega equation
|
|
||||||
template<class RhoType>
|
|
||||||
void addRhoSup
|
|
||||||
(
|
|
||||||
const RhoType& rho,
|
|
||||||
fvMatrix<scalar>& eqn,
|
|
||||||
const word& fieldName
|
|
||||||
) const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("interfaceTurbulenceDamping");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from explicit source name and mesh
|
|
||||||
interfaceTurbulenceDamping
|
|
||||||
(
|
|
||||||
const word& sourceName,
|
|
||||||
const word& modelType,
|
|
||||||
const dictionary& dict,
|
|
||||||
const fvMesh& mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construction
|
|
||||||
interfaceTurbulenceDamping
|
|
||||||
(
|
|
||||||
const interfaceTurbulenceDamping&
|
|
||||||
) = delete;
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return the list of fields for which the option adds source term
|
|
||||||
// to the transport equation
|
|
||||||
virtual wordList addSupFields() const;
|
|
||||||
|
|
||||||
//- Add explicit contribution to mixture epsilon or omega equation
|
|
||||||
virtual void addSup
|
|
||||||
(
|
|
||||||
fvMatrix<scalar>& eqn,
|
|
||||||
const word& fieldName
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Add explicit contribution to compressible
|
|
||||||
// mixture epsilon or omega equation
|
|
||||||
virtual void addSup
|
|
||||||
(
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<scalar>& eqn,
|
|
||||||
const word& fieldName
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Add explicit contribution to phase epsilon or omega equation
|
|
||||||
virtual void addSup
|
|
||||||
(
|
|
||||||
const volScalarField& alpha,
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<scalar>& eqn,
|
|
||||||
const word& fieldName
|
|
||||||
) const;
|
|
||||||
|
|
||||||
|
|
||||||
// Mesh changes
|
|
||||||
|
|
||||||
//- Update topology using the given map
|
|
||||||
virtual void topoChange(const polyTopoChangeMap&);
|
|
||||||
|
|
||||||
//- Update from another mesh using the given map
|
|
||||||
virtual void mapMesh(const polyMeshMap&);
|
|
||||||
|
|
||||||
//- Redistribute or update using the given distribution map
|
|
||||||
virtual void distribute(const polyDistributionMap&);
|
|
||||||
|
|
||||||
//- Update for mesh motion
|
|
||||||
virtual bool movePoints();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const interfaceTurbulenceDamping&) = delete;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace fv
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,254 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2022 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 "phaseTurbulenceStabilisation.H"
|
|
||||||
#include "phaseSystem.H"
|
|
||||||
#include "surfaceInterpolate.H"
|
|
||||||
#include "fvcGrad.H"
|
|
||||||
#include "fvmSup.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace fv
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(phaseTurbulenceStabilisation, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
fvModel,
|
|
||||||
phaseTurbulenceStabilisation,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::fv::phaseTurbulenceStabilisation::addSup
|
|
||||||
(
|
|
||||||
const volScalarField& alpha,
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<scalar>& eqn,
|
|
||||||
tmp<volScalarField>
|
|
||||||
(phaseCompressible::momentumTransportModel::*psi)() const
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< type() << ": applying source to " << eqn.psi().name() << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
const fvMesh& mesh = this->mesh();
|
|
||||||
|
|
||||||
const phaseSystem::phaseModelPartialList& movingPhases =
|
|
||||||
phase_.fluid().movingPhases();
|
|
||||||
|
|
||||||
volScalarField::Internal transferRate
|
|
||||||
(
|
|
||||||
volScalarField::Internal::New
|
|
||||||
(
|
|
||||||
"transferRate",
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar(dimless/dimTime, 0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
volScalarField::Internal psiTransferRate
|
|
||||||
(
|
|
||||||
volScalarField::Internal::New
|
|
||||||
(
|
|
||||||
"psiTransferRate",
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar((turbulence_.*psi)()().dimensions()/dimTime, 0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
forAll(movingPhases, phasei)
|
|
||||||
{
|
|
||||||
if (movingPhases[phasei] != phase_)
|
|
||||||
{
|
|
||||||
const phaseCompressible::momentumTransportModel& turbulence =
|
|
||||||
mesh.lookupType<phaseCompressible::momentumTransportModel>
|
|
||||||
(
|
|
||||||
phaseName_
|
|
||||||
);
|
|
||||||
|
|
||||||
if (notNull(turbulence))
|
|
||||||
{
|
|
||||||
const volScalarField::Internal phaseTransferRate
|
|
||||||
(
|
|
||||||
movingPhases[phasei]
|
|
||||||
*min
|
|
||||||
(
|
|
||||||
turbulence.epsilon()/turbulence.k(),
|
|
||||||
1.0/phase_.time().deltaT()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
transferRate += phaseTransferRate;
|
|
||||||
psiTransferRate += phaseTransferRate*(turbulence.*psi)()();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const volScalarField::Internal transferCoeff
|
|
||||||
(
|
|
||||||
max(alphaInversion_ - alpha(), scalar(0))*rho()
|
|
||||||
);
|
|
||||||
|
|
||||||
eqn += transferCoeff*psiTransferRate;
|
|
||||||
eqn -= fvm::Sp(transferCoeff*transferRate, eqn.psi());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::fv::phaseTurbulenceStabilisation::phaseTurbulenceStabilisation
|
|
||||||
(
|
|
||||||
const word& sourceName,
|
|
||||||
const word& modelType,
|
|
||||||
const dictionary& dict,
|
|
||||||
const fvMesh& mesh
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fvModel(sourceName, modelType, dict, mesh),
|
|
||||||
phaseName_(dict.lookup("phase")),
|
|
||||||
alphaInversion_("alphaInversion", dimless, dict),
|
|
||||||
phase_
|
|
||||||
(
|
|
||||||
mesh.lookupObject<phaseModel>(IOobject::groupName("alpha", phaseName_))
|
|
||||||
),
|
|
||||||
turbulence_
|
|
||||||
(
|
|
||||||
mesh.lookupType<phaseCompressible::momentumTransportModel>
|
|
||||||
(
|
|
||||||
phaseName_
|
|
||||||
)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const word kName(IOobject::groupName("k", phaseName_));
|
|
||||||
const word epsilonName(IOobject::groupName("epsilon", phaseName_));
|
|
||||||
const word omegaName(IOobject::groupName("omega", phaseName_));
|
|
||||||
|
|
||||||
if (mesh.foundObject<volScalarField>(kName))
|
|
||||||
{
|
|
||||||
fieldNames_.append(kName);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mesh.foundObject<volScalarField>(epsilonName))
|
|
||||||
{
|
|
||||||
fieldNames_.append(epsilonName);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mesh.foundObject<volScalarField>(omegaName))
|
|
||||||
{
|
|
||||||
fieldNames_.append(omegaName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::wordList Foam::fv::phaseTurbulenceStabilisation::addSupFields() const
|
|
||||||
{
|
|
||||||
return fieldNames_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::phaseTurbulenceStabilisation::addSup
|
|
||||||
(
|
|
||||||
const volScalarField& alpha,
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<scalar>& eqn,
|
|
||||||
const word& fieldName
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (fieldName == IOobject::groupName("k", phaseName_))
|
|
||||||
{
|
|
||||||
addSup
|
|
||||||
(
|
|
||||||
alpha,
|
|
||||||
rho,
|
|
||||||
eqn,
|
|
||||||
&phaseCompressible::momentumTransportModel::k
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else if (fieldName == IOobject::groupName("epsilon", phaseName_))
|
|
||||||
{
|
|
||||||
addSup
|
|
||||||
(
|
|
||||||
alpha,
|
|
||||||
rho,
|
|
||||||
eqn,
|
|
||||||
&phaseCompressible::momentumTransportModel::epsilon
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else if (fieldName == IOobject::groupName("omega", phaseName_))
|
|
||||||
{
|
|
||||||
addSup
|
|
||||||
(
|
|
||||||
alpha,
|
|
||||||
rho,
|
|
||||||
eqn,
|
|
||||||
&phaseCompressible::momentumTransportModel::omega
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Support for field " << fieldName << " is not implemented"
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::phaseTurbulenceStabilisation::topoChange
|
|
||||||
(
|
|
||||||
const polyTopoChangeMap&
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::phaseTurbulenceStabilisation::mapMesh(const polyMeshMap& map)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::phaseTurbulenceStabilisation::distribute
|
|
||||||
(
|
|
||||||
const polyDistributionMap&
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
bool Foam::fv::phaseTurbulenceStabilisation::movePoints()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,198 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2022 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::fv::phaseTurbulenceStabilisation
|
|
||||||
|
|
||||||
Description
|
|
||||||
Phase turbulence stabilisation
|
|
||||||
|
|
||||||
In the limit of a phase-fraction->0 the turbulence properties cannot be
|
|
||||||
obtained from the phase turbulence model, coupling to the other phase/phases
|
|
||||||
is required. The phaseTurbulenceStabilisation fvModel stabilises the phase
|
|
||||||
turbulence properties by adding transfer terms from the corresponding
|
|
||||||
properties of the other phases when the phase-fraction is less than the
|
|
||||||
specified \c alphaInversion. This implementation is a generalisation of
|
|
||||||
the approach used in the Foam::RASModels::LaheyKEpsilon and
|
|
||||||
Foam::RASModels::continuousGasKEpsilon models to handle phase-inversion and
|
|
||||||
free-surface flow and can be used with any combination of RAS turbulence
|
|
||||||
models.
|
|
||||||
|
|
||||||
To stabilise the solution of the phase turbulence equations \c
|
|
||||||
alphaInversion can be set to a small value e.g. 1e-2, but unless the phase
|
|
||||||
turbulence model is specifically designed to handle phase-inversion and both
|
|
||||||
continuous and dispersed regimes it may be useful to set \c alphaInversion
|
|
||||||
to a higher value, corresponding to the phase-fraction at which transition
|
|
||||||
from continuous to dispersed happens and effectively use the turbulence
|
|
||||||
properties of the other phase when the phase is dispersed. This is of
|
|
||||||
course an approximation to the real system and if accurate handling of both
|
|
||||||
the continuous and dispersed phase regimes is required specially developed
|
|
||||||
models should be used.
|
|
||||||
|
|
||||||
Usage
|
|
||||||
Example usage:
|
|
||||||
\verbatim
|
|
||||||
phaseTurbulenceStabilisation
|
|
||||||
{
|
|
||||||
type phaseTurbulenceStabilisation;
|
|
||||||
|
|
||||||
libs ("libmultiphaseEulerFoamFvModels.so");
|
|
||||||
|
|
||||||
phase air;
|
|
||||||
|
|
||||||
alphaInversion 0.1;
|
|
||||||
}
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
phaseTurbulenceStabilisation.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef phaseTurbulenceStabilisation_H
|
|
||||||
#define phaseTurbulenceStabilisation_H
|
|
||||||
|
|
||||||
#include "fvModel.H"
|
|
||||||
#include "phaseModel.H"
|
|
||||||
#include "phaseCompressibleMomentumTransportModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace fv
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class phaseTurbulenceStabilisation Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class phaseTurbulenceStabilisation
|
|
||||||
:
|
|
||||||
public fvModel
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- The name of the Lagrangian phase
|
|
||||||
word phaseName_;
|
|
||||||
|
|
||||||
//- Field names
|
|
||||||
wordList fieldNames_;
|
|
||||||
|
|
||||||
//- Phase-fraction below which turbulence property blending is applied
|
|
||||||
dimensionedScalar alphaInversion_;
|
|
||||||
|
|
||||||
//- Reference to the phase
|
|
||||||
const phaseModel& phase_;
|
|
||||||
|
|
||||||
//- Reference to the mixture turbulence model
|
|
||||||
const phaseCompressible::momentumTransportModel& turbulence_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Add contribution to phase psi equation
|
|
||||||
void addSup
|
|
||||||
(
|
|
||||||
const volScalarField& alpha,
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<scalar>& eqn,
|
|
||||||
tmp<volScalarField>
|
|
||||||
(phaseCompressible::momentumTransportModel::*psi)() const
|
|
||||||
) const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("phaseTurbulenceStabilisation");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from explicit source name and mesh
|
|
||||||
phaseTurbulenceStabilisation
|
|
||||||
(
|
|
||||||
const word& sourceName,
|
|
||||||
const word& modelType,
|
|
||||||
const dictionary& dict,
|
|
||||||
const fvMesh& mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construction
|
|
||||||
phaseTurbulenceStabilisation
|
|
||||||
(
|
|
||||||
const phaseTurbulenceStabilisation&
|
|
||||||
) = delete;
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return the list of fields for which the option adds source term
|
|
||||||
// to the transport equation
|
|
||||||
virtual wordList addSupFields() const;
|
|
||||||
|
|
||||||
using fvModel::addSup;
|
|
||||||
|
|
||||||
//- Add contribution to phase k, epsilon or omega equation
|
|
||||||
virtual void addSup
|
|
||||||
(
|
|
||||||
const volScalarField& alpha,
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<scalar>& eqn,
|
|
||||||
const word& fieldName
|
|
||||||
) const;
|
|
||||||
|
|
||||||
|
|
||||||
// Mesh changes
|
|
||||||
|
|
||||||
//- Update topology using the given map
|
|
||||||
virtual void topoChange(const polyTopoChangeMap&);
|
|
||||||
|
|
||||||
//- Update from another mesh using the given map
|
|
||||||
virtual void mapMesh(const polyMeshMap&);
|
|
||||||
|
|
||||||
//- Redistribute or update using the given distribution map
|
|
||||||
virtual void distribute(const polyDistributionMap&);
|
|
||||||
|
|
||||||
//- Update for mesh motion
|
|
||||||
virtual bool movePoints();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const phaseTurbulenceStabilisation&) = delete;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace fv
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
tmp<surfaceScalarField> trDeltaTf;
|
|
||||||
|
|
||||||
if (LTS && faceMomentum)
|
|
||||||
{
|
|
||||||
trDeltaTf = tmp<surfaceScalarField>
|
|
||||||
(
|
|
||||||
new surfaceScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
fv::localEulerDdt::rDeltaTfName,
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::READ_IF_PRESENT,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar(dimless/dimTime, 1)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
trDeltaTf.ref() = fvc::interpolate(fv::localEulerDdt::localRDeltaT(mesh));
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
diffusiveMassTransferModels/diffusiveMassTransferModel/diffusiveMassTransferModel.C
|
|
||||||
diffusiveMassTransferModels/diffusiveMassTransferModel/diffusiveMassTransferModelNew.C
|
|
||||||
diffusiveMassTransferModels/Frossling/Frossling.C
|
|
||||||
diffusiveMassTransferModels/sphericalDiffusiveMassTransfer/sphericalDiffusiveMassTransfer.C
|
|
||||||
|
|
||||||
interfaceSurfaceTensionModels/interfaceSurfaceTensionModel/interfaceSurfaceTensionModel.C
|
|
||||||
interfaceSurfaceTensionModels/interfaceSurfaceTensionModel/interfaceSurfaceTensionModelNew.C
|
|
||||||
interfaceSurfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C
|
|
||||||
|
|
||||||
interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.C
|
|
||||||
interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModelNew.C
|
|
||||||
interfaceCompositionModels/Henry/Henry.C
|
|
||||||
interfaceCompositionModels/nonRandomTwoLiquid/nonRandomTwoLiquid.C
|
|
||||||
interfaceCompositionModels/Raoult/Raoult.C
|
|
||||||
interfaceCompositionModels/saturated/saturated.C
|
|
||||||
|
|
||||||
saturationModels/saturationModel/saturationModel.C
|
|
||||||
saturationModels/saturationModel/saturationModelNew.C
|
|
||||||
saturationModels/Antoine/Antoine.C
|
|
||||||
saturationModels/AntoineExtended/AntoineExtended.C
|
|
||||||
saturationModels/ArdenBuck/ArdenBuck.C
|
|
||||||
saturationModels/polynomial/polynomial.C
|
|
||||||
saturationModels/function1/function1.C
|
|
||||||
saturationModels/constantSaturationConditions/constantSaturationConditions.C
|
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libeulerianInterfacialCompositionModels
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
EXE_INC = \
|
|
||||||
-I../phaseSystems/lnInclude \
|
|
||||||
-I$(LIB_SRC)/physicalProperties/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/multicomponentThermo/lnInclude \
|
|
||||||
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/MomentumTransportModels/phaseCompressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
|
||||||
-I$(LIB_SRC)/sampling/lnInclude
|
|
||||||
|
|
||||||
LIB_LIBS = \
|
|
||||||
-lfluidThermophysicalModels \
|
|
||||||
-lmulticomponentThermophysicalModels \
|
|
||||||
-lspecie
|
|
||||||
@ -1,87 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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 "Frossling.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace diffusiveMassTransferModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(Frossling, 0);
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
diffusiveMassTransferModel,
|
|
||||||
Frossling,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::diffusiveMassTransferModels::Frossling::Frossling
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
diffusiveMassTransferModel(dict, interface),
|
|
||||||
interface_
|
|
||||||
(
|
|
||||||
interface.modelCast
|
|
||||||
<
|
|
||||||
diffusiveMassTransferModel,
|
|
||||||
dispersedPhaseInterface
|
|
||||||
>()
|
|
||||||
),
|
|
||||||
Le_("Le", dimless, dict)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::diffusiveMassTransferModels::Frossling::~Frossling()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::diffusiveMassTransferModels::Frossling::K() const
|
|
||||||
{
|
|
||||||
const volScalarField Sh
|
|
||||||
(
|
|
||||||
2 + 0.552*sqrt(interface_.Re())*cbrt(Le_*interface_.Pr())
|
|
||||||
);
|
|
||||||
|
|
||||||
return 6*interface_.dispersed()*Sh/sqr(interface_.dispersed().d());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,102 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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::diffusiveMassTransferModels::Frossling
|
|
||||||
|
|
||||||
Description
|
|
||||||
Frossling correlation for turbulent mass transfer from the surface of a
|
|
||||||
sphere to the surrounding fluid.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
Frossling.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef Frossling_H
|
|
||||||
#define Frossling_H
|
|
||||||
|
|
||||||
#include "diffusiveMassTransferModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace diffusiveMassTransferModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class Frossling Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class Frossling
|
|
||||||
:
|
|
||||||
public diffusiveMassTransferModel
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Interface
|
|
||||||
const dispersedPhaseInterface interface_;
|
|
||||||
|
|
||||||
//- Lewis number
|
|
||||||
const dimensionedScalar Le_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("Frossling");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
Frossling
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~Frossling();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- The implicit mass transfer coefficient
|
|
||||||
virtual tmp<volScalarField> K() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace diffusiveMassTransferModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,76 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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 "diffusiveMassTransferModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(diffusiveMassTransferModel, 0);
|
|
||||||
defineBlendedInterfacialModelTypeNameAndDebug
|
|
||||||
(
|
|
||||||
diffusiveMassTransferModel,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
defineSidedInterfacialModelTypeNameAndDebug
|
|
||||||
(
|
|
||||||
blendedDiffusiveMassTransferModel,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
defineRunTimeSelectionTable(diffusiveMassTransferModel, dictionary);
|
|
||||||
}
|
|
||||||
|
|
||||||
const Foam::dimensionSet Foam::diffusiveMassTransferModel::dimK(0, -2, 0, 0, 0);
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::diffusiveMassTransferModel::diffusiveMassTransferModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::diffusiveMassTransferModel::~diffusiveMassTransferModel()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::blendedDiffusiveMassTransferModel::K() const
|
|
||||||
{
|
|
||||||
tmp<volScalarField> (diffusiveMassTransferModel::*k)() const =
|
|
||||||
&diffusiveMassTransferModel::K;
|
|
||||||
return evaluate(k, "K", diffusiveMassTransferModel::dimK, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,189 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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::diffusiveMassTransferModel
|
|
||||||
|
|
||||||
Description
|
|
||||||
Model for diffusive mass transfer coefficients between two phases
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
diffusiveMassTransferModel.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef diffusiveMassTransferModel_H
|
|
||||||
#define diffusiveMassTransferModel_H
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "volFields.H"
|
|
||||||
#include "dictionary.H"
|
|
||||||
#include "runTimeSelectionTables.H"
|
|
||||||
#include "BlendedInterfacialModel.H"
|
|
||||||
#include "SidedInterfacialModel.H"
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
class phaseSystem;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class diffusiveMassTransferModel Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class diffusiveMassTransferModel
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("diffusiveMassTransferModel");
|
|
||||||
|
|
||||||
|
|
||||||
// Declare runtime construction
|
|
||||||
|
|
||||||
declareRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
autoPtr,
|
|
||||||
diffusiveMassTransferModel,
|
|
||||||
dictionary,
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
),
|
|
||||||
(dict, interface)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Static Data Members
|
|
||||||
|
|
||||||
//- Coefficient dimensions
|
|
||||||
static const dimensionSet dimK;
|
|
||||||
|
|
||||||
//- Does this model require correcting on fixed flux boundaries?
|
|
||||||
static const bool correctFixedFluxBCs = false;
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
diffusiveMassTransferModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~diffusiveMassTransferModel();
|
|
||||||
|
|
||||||
|
|
||||||
// Selectors
|
|
||||||
|
|
||||||
static autoPtr<diffusiveMassTransferModel> New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- The implicit mass transfer coefficient
|
|
||||||
// Note: this has had the species mass diffusivity factored out
|
|
||||||
virtual tmp<volScalarField> K() const = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class blendedDiffusiveMassTransferModel Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class blendedDiffusiveMassTransferModel
|
|
||||||
:
|
|
||||||
public BlendedInterfacialModel<diffusiveMassTransferModel>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Inherit base class constructors
|
|
||||||
using
|
|
||||||
BlendedInterfacialModel<diffusiveMassTransferModel>::
|
|
||||||
BlendedInterfacialModel;
|
|
||||||
|
|
||||||
|
|
||||||
// Selectors
|
|
||||||
|
|
||||||
static autoPtr<blendedDiffusiveMassTransferModel> New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return the heatTransfer coefficient K
|
|
||||||
tmp<volScalarField> K() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class sidedBlendedDiffusiveMassTransferModel Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class sidedBlendedDiffusiveMassTransferModel
|
|
||||||
:
|
|
||||||
public SidedInterfacialModel<blendedDiffusiveMassTransferModel>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Inherit base class constructors
|
|
||||||
using
|
|
||||||
SidedInterfacialModel<blendedDiffusiveMassTransferModel>::
|
|
||||||
SidedInterfacialModel;
|
|
||||||
|
|
||||||
|
|
||||||
// Selectors
|
|
||||||
|
|
||||||
static autoPtr<sidedBlendedDiffusiveMassTransferModel> New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,90 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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 "diffusiveMassTransferModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::diffusiveMassTransferModel>
|
|
||||||
Foam::diffusiveMassTransferModel::New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const dictionary& modelDict =
|
|
||||||
interface.fluid().modelSubDict<diffusiveMassTransferModel>(dict);
|
|
||||||
|
|
||||||
const word diffusiveMassTransferModelType(modelDict.lookup("type"));
|
|
||||||
|
|
||||||
Info<< "Selecting diffusiveMassTransferModel for "
|
|
||||||
<< interface.name() << ": " << diffusiveMassTransferModelType << endl;
|
|
||||||
|
|
||||||
dictionaryConstructorTable::iterator cstrIter =
|
|
||||||
dictionaryConstructorTablePtr_->find(diffusiveMassTransferModelType);
|
|
||||||
|
|
||||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Unknown diffusiveMassTransferModelType type "
|
|
||||||
<< diffusiveMassTransferModelType << endl << endl
|
|
||||||
<< "Valid diffusiveMassTransferModel types are : " << endl
|
|
||||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
return cstrIter()(modelDict, interface);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::blendedDiffusiveMassTransferModel>
|
|
||||||
Foam::blendedDiffusiveMassTransferModel::New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return autoPtr<blendedDiffusiveMassTransferModel>
|
|
||||||
(
|
|
||||||
new blendedDiffusiveMassTransferModel(dict, interface)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::sidedBlendedDiffusiveMassTransferModel>
|
|
||||||
Foam::sidedBlendedDiffusiveMassTransferModel::New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return autoPtr<sidedBlendedDiffusiveMassTransferModel>
|
|
||||||
(
|
|
||||||
new sidedBlendedDiffusiveMassTransferModel(dict, interface)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,84 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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 "sphericalDiffusiveMassTransfer.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace diffusiveMassTransferModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(sphericalDiffusiveMassTransfer, 0);
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
diffusiveMassTransferModel,
|
|
||||||
sphericalDiffusiveMassTransfer,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::diffusiveMassTransferModels::sphericalDiffusiveMassTransfer::
|
|
||||||
sphericalDiffusiveMassTransfer
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
diffusiveMassTransferModel(dict, interface),
|
|
||||||
interface_
|
|
||||||
(
|
|
||||||
interface.modelCast
|
|
||||||
<
|
|
||||||
diffusiveMassTransferModel,
|
|
||||||
dispersedPhaseInterface
|
|
||||||
>()
|
|
||||||
),
|
|
||||||
Le_("Le", dimless, dict)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::diffusiveMassTransferModels::sphericalDiffusiveMassTransfer::
|
|
||||||
~sphericalDiffusiveMassTransfer()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::diffusiveMassTransferModels::sphericalDiffusiveMassTransfer::K() const
|
|
||||||
{
|
|
||||||
return 60*interface_.dispersed()/sqr(interface_.dispersed().d());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,101 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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::diffusiveMassTransferModels::sphericalDiffusiveMassTransfer
|
|
||||||
|
|
||||||
Description
|
|
||||||
Model which applies an analytical solution for mass transfer from the
|
|
||||||
surface of a sphere to the fluid within the sphere.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
sphericalDiffusiveMassTransfer.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef sphericalDiffusiveMassTransfer_H
|
|
||||||
#define sphericalDiffusiveMassTransfer_H
|
|
||||||
|
|
||||||
#include "diffusiveMassTransferModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace diffusiveMassTransferModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class sphericalDiffusiveMassTransfer Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class sphericalDiffusiveMassTransfer
|
|
||||||
:
|
|
||||||
public diffusiveMassTransferModel
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Interface
|
|
||||||
const dispersedPhaseInterface interface_;
|
|
||||||
|
|
||||||
//- Lewis number
|
|
||||||
const dimensionedScalar Le_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("spherical");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
sphericalDiffusiveMassTransfer
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~sphericalDiffusiveMassTransfer();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- The implicit mass transfer coefficient
|
|
||||||
virtual tmp<volScalarField> K() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace diffusiveMassTransferModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,129 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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 "Henry.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace interfaceCompositionModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(Henry, 0);
|
|
||||||
addToRunTimeSelectionTable(interfaceCompositionModel, Henry, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::interfaceCompositionModels::Henry::Henry
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
interfaceCompositionModel(dict, interface),
|
|
||||||
k_(dict.lookup("k")),
|
|
||||||
YSolvent_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
IOobject::groupName("YSolvent", this->interface().name()),
|
|
||||||
interface.mesh().time().timeName(),
|
|
||||||
interface.mesh()
|
|
||||||
),
|
|
||||||
interface.mesh(),
|
|
||||||
dimensionedScalar(dimless, 1)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (k_.size() != species().size())
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Differing number of species and solubilities"
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::interfaceCompositionModels::Henry::~Henry()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::interfaceCompositionModels::Henry::update(const volScalarField& Tf)
|
|
||||||
{
|
|
||||||
YSolvent_ = scalar(1);
|
|
||||||
|
|
||||||
forAllConstIter(hashedWordList, species(), iter)
|
|
||||||
{
|
|
||||||
YSolvent_ -= Yf(*iter, Tf);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::interfaceCompositionModels::Henry::Yf
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (species().found(speciesName))
|
|
||||||
{
|
|
||||||
const label index = species()[speciesName];
|
|
||||||
|
|
||||||
return
|
|
||||||
k_[index]
|
|
||||||
*otherComposition().Y(speciesName)
|
|
||||||
*otherThermo().rho()
|
|
||||||
/thermo().rho();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return YSolvent_*composition().Y(speciesName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::interfaceCompositionModels::Henry::YfPrime
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return volScalarField::New
|
|
||||||
(
|
|
||||||
IOobject::groupName("YfPrime", interface().name()),
|
|
||||||
interface().mesh(),
|
|
||||||
dimensionedScalar(dimless/dimTemperature, 0)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,119 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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::interfaceCompositionModels::Henry
|
|
||||||
|
|
||||||
Description
|
|
||||||
Henry's law for gas solubility in liquid. The concentration of a dissolved
|
|
||||||
species in the liquid is proportional to its partial pressure in the gas. A
|
|
||||||
dimensionless solubility, \f$k\f$, is given for each species. This is the
|
|
||||||
ratio of the concentration of the species in the liquid to the
|
|
||||||
corresponding concentration in the gas; i.e., \f$k =
|
|
||||||
c_{i,liq}/c_{i,gas}\f$. Mixing in the gas is assumed to be ideal.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
Henry.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef Henry_H
|
|
||||||
#define Henry_H
|
|
||||||
|
|
||||||
#include "interfaceCompositionModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace interfaceCompositionModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class Henry Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class Henry
|
|
||||||
:
|
|
||||||
public interfaceCompositionModel
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Dimensionless solubility coefficients
|
|
||||||
const scalarList k_;
|
|
||||||
|
|
||||||
//- The remaining solvent species fraction
|
|
||||||
volScalarField YSolvent_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("Henry");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
Henry
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~Henry();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Update the composition
|
|
||||||
virtual void update(const volScalarField& Tf);
|
|
||||||
|
|
||||||
//- The interface species fraction
|
|
||||||
virtual tmp<volScalarField> Yf
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- The interface species fraction derivative w.r.t. temperature
|
|
||||||
virtual tmp<volScalarField> YfPrime
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace interfaceCompositionModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,162 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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 "Raoult.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace interfaceCompositionModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(Raoult, 0);
|
|
||||||
addToRunTimeSelectionTable(interfaceCompositionModel, Raoult, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::interfaceCompositionModels::Raoult::Raoult
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
interfaceCompositionModel(dict, interface),
|
|
||||||
YNonVapour_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
IOobject::groupName("YNonVapour", this->interface().name()),
|
|
||||||
interface.mesh().time().timeName(),
|
|
||||||
interface.mesh()
|
|
||||||
),
|
|
||||||
interface.mesh(),
|
|
||||||
dimensionedScalar(dimless, 1)
|
|
||||||
),
|
|
||||||
YNonVapourPrime_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
IOobject::groupName("YNonVapourPrime", this->interface().name()),
|
|
||||||
interface.mesh().time().timeName(),
|
|
||||||
interface.mesh()
|
|
||||||
),
|
|
||||||
interface.mesh(),
|
|
||||||
dimensionedScalar(dimless/dimTemperature, 0)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
forAllConstIter(hashedWordList, species(), iter)
|
|
||||||
{
|
|
||||||
speciesModels_.insert
|
|
||||||
(
|
|
||||||
*iter,
|
|
||||||
autoPtr<interfaceCompositionModel>
|
|
||||||
(
|
|
||||||
interfaceCompositionModel::New
|
|
||||||
(
|
|
||||||
dict.subDict(*iter),
|
|
||||||
interface
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::interfaceCompositionModels::Raoult::~Raoult()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::interfaceCompositionModels::Raoult::update(const volScalarField& Tf)
|
|
||||||
{
|
|
||||||
YNonVapour_ = scalar(1);
|
|
||||||
|
|
||||||
forAllIter
|
|
||||||
(
|
|
||||||
HashTable<autoPtr<interfaceCompositionModel>>,
|
|
||||||
speciesModels_,
|
|
||||||
iter
|
|
||||||
)
|
|
||||||
{
|
|
||||||
iter()->update(Tf);
|
|
||||||
|
|
||||||
YNonVapour_ -=
|
|
||||||
otherComposition().Y(iter.key())
|
|
||||||
*iter()->Yf(iter.key(), Tf);
|
|
||||||
|
|
||||||
YNonVapourPrime_ -=
|
|
||||||
otherComposition().Y(iter.key())
|
|
||||||
*iter()->YfPrime(iter.key(), Tf);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::interfaceCompositionModels::Raoult::Yf
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (species().found(speciesName))
|
|
||||||
{
|
|
||||||
return
|
|
||||||
otherComposition().Y(speciesName)
|
|
||||||
*speciesModels_[speciesName]->Yf(speciesName, Tf);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return composition().Y(speciesName)*YNonVapour_;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::interfaceCompositionModels::Raoult::YfPrime
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (species().found(speciesName))
|
|
||||||
{
|
|
||||||
return
|
|
||||||
otherComposition().Y(speciesName)
|
|
||||||
*speciesModels_[speciesName]->YfPrime(speciesName, Tf);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return composition().Y(speciesName)*YNonVapourPrime_;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,119 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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::interfaceCompositionModels::Raoult
|
|
||||||
|
|
||||||
Description
|
|
||||||
Raoult's law of ideal mixing. A separate composition model is given for
|
|
||||||
each species. The composition of a species is equal to the value given by
|
|
||||||
the model scaled by the species fraction in the bulk of the other phase.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
Raoult.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef Raoult_H
|
|
||||||
#define Raoult_H
|
|
||||||
|
|
||||||
#include "interfaceCompositionModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace interfaceCompositionModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class Raoult Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class Raoult
|
|
||||||
:
|
|
||||||
public interfaceCompositionModel
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Non-vapour species fraction
|
|
||||||
volScalarField YNonVapour_;
|
|
||||||
|
|
||||||
//- Non-vapour species fraction derivative w.r.t. temperature
|
|
||||||
volScalarField YNonVapourPrime_;
|
|
||||||
|
|
||||||
//- Species' individual composition models
|
|
||||||
HashTable<autoPtr<interfaceCompositionModel>> speciesModels_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("Raoult");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
Raoult
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~Raoult();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Update the composition
|
|
||||||
virtual void update(const volScalarField& Tf);
|
|
||||||
|
|
||||||
//- The interface species fraction
|
|
||||||
virtual tmp<volScalarField> Yf
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- The interface species fraction derivative w.r.t. temperature
|
|
||||||
virtual tmp<volScalarField> YfPrime
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace interfaceCompositionModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,113 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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 "interfaceCompositionModel.H"
|
|
||||||
#include "phaseModel.H"
|
|
||||||
#include "phaseSystem.H"
|
|
||||||
#include "rhoMulticomponentThermo.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(interfaceCompositionModel, 0);
|
|
||||||
defineSidedInterfacialModelTypeNameAndDebug(interfaceCompositionModel, 0);
|
|
||||||
defineRunTimeSelectionTable(interfaceCompositionModel, dictionary);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::interfaceCompositionModel::interfaceCompositionModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
interface_
|
|
||||||
(
|
|
||||||
interface.modelCast<interfaceCompositionModel, sidedPhaseInterface>()
|
|
||||||
),
|
|
||||||
species_(dict.lookup("species")),
|
|
||||||
Le_("Le", dimless, dict),
|
|
||||||
thermo_
|
|
||||||
(
|
|
||||||
refCast<const rhoMulticomponentThermo>(interface_.phase().thermo())
|
|
||||||
),
|
|
||||||
otherThermo_(interface_.otherPhase().thermo())
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::interfaceCompositionModel::~interfaceCompositionModel()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::interfaceCompositionModel::dY
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
const label speciei = composition().species()[speciesName];
|
|
||||||
|
|
||||||
return Yf(speciesName, Tf) - composition().Y()[speciei];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::interfaceCompositionModel::dYfPrime
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return YfPrime(speciesName, Tf);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::interfaceCompositionModel::D
|
|
||||||
(
|
|
||||||
const word& speciesName
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
const label speciei = composition().species()[speciesName];
|
|
||||||
const volScalarField& p(thermo_.p());
|
|
||||||
const volScalarField& T(thermo_.T());
|
|
||||||
|
|
||||||
return volScalarField::New
|
|
||||||
(
|
|
||||||
IOobject::groupName("D" + speciesName, interface_.name()),
|
|
||||||
composition().kappa(speciei, p, T)
|
|
||||||
/composition().Cp(speciei, p, T)
|
|
||||||
/composition().rho(speciei, p, T)
|
|
||||||
/Le_
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,231 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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::interfaceCompositionModel
|
|
||||||
|
|
||||||
Description
|
|
||||||
Generic base class for interface composition models. These models describe
|
|
||||||
the composition in phase 1 of the supplied pair at the interface with phase
|
|
||||||
2.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
interfaceCompositionModel.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef interfaceCompositionModel_H
|
|
||||||
#define interfaceCompositionModel_H
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "volFields.H"
|
|
||||||
#include "dictionary.H"
|
|
||||||
#include "hashedWordList.H"
|
|
||||||
#include "rhoMulticomponentThermo.H"
|
|
||||||
#include "runTimeSelectionTables.H"
|
|
||||||
#include "sidedPhaseInterface.H"
|
|
||||||
#include "SidedInterfacialModel.H"
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class interfaceCompositionModel Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class interfaceCompositionModel
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- Interface
|
|
||||||
const sidedPhaseInterface interface_;
|
|
||||||
|
|
||||||
//- Names of the transferring species
|
|
||||||
const hashedWordList species_;
|
|
||||||
|
|
||||||
//- Lewis number
|
|
||||||
const dimensionedScalar Le_;
|
|
||||||
|
|
||||||
//- Multi-component thermo model for this side of the interface
|
|
||||||
const rhoMulticomponentThermo& thermo_;
|
|
||||||
|
|
||||||
//- General thermo model for the other side of the interface
|
|
||||||
const rhoThermo& otherThermo_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("interfaceCompositionModel");
|
|
||||||
|
|
||||||
|
|
||||||
// Declare runtime construction
|
|
||||||
|
|
||||||
declareRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
autoPtr,
|
|
||||||
interfaceCompositionModel,
|
|
||||||
dictionary,
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
),
|
|
||||||
(dict, interface)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
interfaceCompositionModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~interfaceCompositionModel();
|
|
||||||
|
|
||||||
|
|
||||||
// Selectors
|
|
||||||
|
|
||||||
static autoPtr<interfaceCompositionModel> New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool outer=true
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
// Access
|
|
||||||
|
|
||||||
//- Return the interface
|
|
||||||
inline const sidedPhaseInterface& interface() const;
|
|
||||||
|
|
||||||
//- Return the transferring species names
|
|
||||||
inline const hashedWordList& species() const;
|
|
||||||
|
|
||||||
//- Return the thermo
|
|
||||||
inline const rhoMulticomponentThermo& thermo() const;
|
|
||||||
|
|
||||||
//- Return the composition
|
|
||||||
inline const basicSpecieMixture& composition() const;
|
|
||||||
|
|
||||||
//- Return the other thermo
|
|
||||||
inline const rhoThermo& otherThermo() const;
|
|
||||||
|
|
||||||
//- Return whether the other side has a multi-specie composition
|
|
||||||
inline bool otherHasComposition() const;
|
|
||||||
|
|
||||||
//- Return the other composition
|
|
||||||
inline const basicSpecieMixture& otherComposition() const;
|
|
||||||
|
|
||||||
|
|
||||||
// Evaluation
|
|
||||||
|
|
||||||
//- Interface mass fraction
|
|
||||||
virtual tmp<volScalarField> Yf
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- The interface mass fraction derivative w.r.t. temperature
|
|
||||||
virtual tmp<volScalarField> YfPrime
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- Mass fraction difference between the interface and the field
|
|
||||||
tmp<volScalarField> dY
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Mass fraction difference between the interface and the field
|
|
||||||
// derivative w.r.t. temperature
|
|
||||||
tmp<volScalarField> dYfPrime
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Mass diffusivity
|
|
||||||
tmp<volScalarField> D
|
|
||||||
(
|
|
||||||
const word& speciesName
|
|
||||||
) const;
|
|
||||||
|
|
||||||
|
|
||||||
//- Update the composition
|
|
||||||
virtual void update(const volScalarField& Tf) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class sidedInterfaceCompositionModel Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class sidedInterfaceCompositionModel
|
|
||||||
:
|
|
||||||
public SidedInterfacialModel<interfaceCompositionModel>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Inherit base class constructors
|
|
||||||
using
|
|
||||||
SidedInterfacialModel<interfaceCompositionModel>::
|
|
||||||
SidedInterfacialModel;
|
|
||||||
|
|
||||||
|
|
||||||
// Selectors
|
|
||||||
|
|
||||||
static autoPtr<sidedInterfaceCompositionModel> New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "interfaceCompositionModelI.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,76 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2019-2022 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 "interfaceCompositionModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
const Foam::sidedPhaseInterface&
|
|
||||||
Foam::interfaceCompositionModel::interface() const
|
|
||||||
{
|
|
||||||
return interface_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::hashedWordList& Foam::interfaceCompositionModel::species() const
|
|
||||||
{
|
|
||||||
return species_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::rhoMulticomponentThermo&
|
|
||||||
Foam::interfaceCompositionModel::thermo() const
|
|
||||||
{
|
|
||||||
return thermo_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::basicSpecieMixture&
|
|
||||||
Foam::interfaceCompositionModel::composition() const
|
|
||||||
{
|
|
||||||
return thermo_.composition();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::rhoThermo& Foam::interfaceCompositionModel::otherThermo() const
|
|
||||||
{
|
|
||||||
return otherThermo_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Foam::interfaceCompositionModel::otherHasComposition() const
|
|
||||||
{
|
|
||||||
return isA<rhoMulticomponentThermo>(otherThermo_);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::basicSpecieMixture&
|
|
||||||
Foam::interfaceCompositionModel::otherComposition() const
|
|
||||||
{
|
|
||||||
return refCast<const rhoMulticomponentThermo>(otherThermo_).composition();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,80 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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 "interfaceCompositionModel.H"
|
|
||||||
#include "phaseSystem.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::interfaceCompositionModel>
|
|
||||||
Foam::interfaceCompositionModel::New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool outer
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const dictionary& modelDict =
|
|
||||||
outer
|
|
||||||
? interface.fluid().modelSubDict<interfaceCompositionModel>(dict)
|
|
||||||
: dict;
|
|
||||||
|
|
||||||
const word interfaceCompositionModelType(modelDict.lookup("type"));
|
|
||||||
|
|
||||||
Info<< "Selecting interfaceCompositionModel for "
|
|
||||||
<< interface.name() << ": " << interfaceCompositionModelType << endl;
|
|
||||||
|
|
||||||
dictionaryConstructorTable::iterator cstrIter =
|
|
||||||
dictionaryConstructorTablePtr_->find(interfaceCompositionModelType);
|
|
||||||
|
|
||||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Unknown interfaceCompositionModelType type "
|
|
||||||
<< interfaceCompositionModelType << endl << endl
|
|
||||||
<< "Valid interfaceCompositionModel types are : " << endl
|
|
||||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
return cstrIter()(modelDict, interface);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::sidedInterfaceCompositionModel>
|
|
||||||
Foam::sidedInterfaceCompositionModel::New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return autoPtr<sidedInterfaceCompositionModel>
|
|
||||||
(
|
|
||||||
new sidedInterfaceCompositionModel(dict, interface)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,288 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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 "nonRandomTwoLiquid.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace interfaceCompositionModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(nonRandomTwoLiquid, 0);
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
interfaceCompositionModel,
|
|
||||||
nonRandomTwoLiquid,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::interfaceCompositionModels::nonRandomTwoLiquid::nonRandomTwoLiquid
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
interfaceCompositionModel(dict, interface),
|
|
||||||
gamma1_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
IOobject::groupName("gamma1", this->interface().name()),
|
|
||||||
interface.mesh().time().timeName(),
|
|
||||||
interface.mesh()
|
|
||||||
),
|
|
||||||
interface.mesh(),
|
|
||||||
dimensionedScalar(dimless, 1)
|
|
||||||
),
|
|
||||||
gamma2_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
IOobject::groupName("gamma2", this->interface().name()),
|
|
||||||
interface.mesh().time().timeName(),
|
|
||||||
interface.mesh()
|
|
||||||
),
|
|
||||||
interface.mesh(),
|
|
||||||
dimensionedScalar(dimless, 1)
|
|
||||||
),
|
|
||||||
beta12_("", dimless/dimTemperature, 0),
|
|
||||||
beta21_("", dimless/dimTemperature, 0)
|
|
||||||
{
|
|
||||||
if (species().size() != 2)
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "nonRandomTwoLiquid model is suitable for two species only."
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
species1Name_ = species()[0];
|
|
||||||
species2Name_ = species()[1];
|
|
||||||
|
|
||||||
species1Index_ = composition().species()[species1Name_];
|
|
||||||
species2Index_ = composition().species()[species2Name_];
|
|
||||||
|
|
||||||
alpha12_ = dimensionedScalar
|
|
||||||
(
|
|
||||||
"alpha12",
|
|
||||||
dimless,
|
|
||||||
dict.subDict(species1Name_).lookup("alpha")
|
|
||||||
);
|
|
||||||
alpha21_ = dimensionedScalar
|
|
||||||
(
|
|
||||||
"alpha21",
|
|
||||||
dimless,
|
|
||||||
dict.subDict(species2Name_).lookup("alpha")
|
|
||||||
);
|
|
||||||
|
|
||||||
beta12_ = dimensionedScalar
|
|
||||||
(
|
|
||||||
"beta12",
|
|
||||||
dimless/dimTemperature,
|
|
||||||
dict.subDict(species1Name_).lookup("beta")
|
|
||||||
);
|
|
||||||
beta21_ = dimensionedScalar
|
|
||||||
(
|
|
||||||
"beta21",
|
|
||||||
dimless/dimTemperature,
|
|
||||||
dict.subDict(species2Name_).lookup("beta")
|
|
||||||
);
|
|
||||||
|
|
||||||
saturationModel12_.reset
|
|
||||||
(
|
|
||||||
saturationModel::New
|
|
||||||
(
|
|
||||||
dict.subDict(species1Name_).subDict("interaction"),
|
|
||||||
interface,
|
|
||||||
false
|
|
||||||
).ptr()
|
|
||||||
);
|
|
||||||
saturationModel21_.reset
|
|
||||||
(
|
|
||||||
saturationModel::New
|
|
||||||
(
|
|
||||||
dict.subDict(species2Name_).subDict("interaction"),
|
|
||||||
interface,
|
|
||||||
false
|
|
||||||
).ptr()
|
|
||||||
);
|
|
||||||
|
|
||||||
speciesModel1_.reset
|
|
||||||
(
|
|
||||||
interfaceCompositionModel::New
|
|
||||||
(
|
|
||||||
dict.subDict(species1Name_),
|
|
||||||
interface,
|
|
||||||
false
|
|
||||||
).ptr()
|
|
||||||
);
|
|
||||||
speciesModel2_.reset
|
|
||||||
(
|
|
||||||
interfaceCompositionModel::New
|
|
||||||
(
|
|
||||||
dict.subDict(species2Name_),
|
|
||||||
interface,
|
|
||||||
false
|
|
||||||
).ptr()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::interfaceCompositionModels::nonRandomTwoLiquid::~nonRandomTwoLiquid()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::interfaceCompositionModels::nonRandomTwoLiquid::update
|
|
||||||
(
|
|
||||||
const volScalarField& Tf
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const volScalarField W(thermo().W());
|
|
||||||
|
|
||||||
const volScalarField X1
|
|
||||||
(
|
|
||||||
composition().Y(species1Index_)
|
|
||||||
*W
|
|
||||||
/dimensionedScalar
|
|
||||||
(
|
|
||||||
"W",
|
|
||||||
dimMass/dimMoles,
|
|
||||||
composition().Wi(species1Index_)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
const volScalarField X2
|
|
||||||
(
|
|
||||||
composition().Y(species2Index_)
|
|
||||||
*W
|
|
||||||
/dimensionedScalar
|
|
||||||
(
|
|
||||||
"W",
|
|
||||||
dimMass/dimMoles,
|
|
||||||
composition().Wi(species2Index_)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
const volScalarField alpha12(alpha12_ + Tf*beta12_);
|
|
||||||
const volScalarField alpha21(alpha21_ + Tf*beta21_);
|
|
||||||
|
|
||||||
const volScalarField tau12(saturationModel12_->lnPSat(Tf));
|
|
||||||
const volScalarField tau21(saturationModel21_->lnPSat(Tf));
|
|
||||||
|
|
||||||
const volScalarField G12(exp(- alpha12*tau12));
|
|
||||||
const volScalarField G21(exp(- alpha21*tau21));
|
|
||||||
|
|
||||||
gamma1_ =
|
|
||||||
exp
|
|
||||||
(
|
|
||||||
sqr(X2)
|
|
||||||
*(
|
|
||||||
tau21*sqr(G21)/max(sqr(X1 + X2*G21), small)
|
|
||||||
+ tau12*G12/max(sqr(X2 + X1*G12), small)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
gamma2_ =
|
|
||||||
exp
|
|
||||||
(
|
|
||||||
sqr(X1)
|
|
||||||
*(
|
|
||||||
tau12*sqr(G12)/max(sqr(X2 + X1*G12), small)
|
|
||||||
+ tau21*G21/max(sqr(X1 + X2*G21), small)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::interfaceCompositionModels::nonRandomTwoLiquid::Yf
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (speciesName == species1Name_)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
otherComposition().Y(speciesName)
|
|
||||||
*speciesModel1_->Yf(speciesName, Tf)
|
|
||||||
*gamma1_;
|
|
||||||
}
|
|
||||||
else if (speciesName == species2Name_)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
otherComposition().Y(speciesName)
|
|
||||||
*speciesModel2_->Yf(speciesName, Tf)
|
|
||||||
*gamma2_;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return
|
|
||||||
composition().Y(speciesName)
|
|
||||||
*(scalar(1) - Yf(species1Name_, Tf) - Yf(species2Name_, Tf));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::interfaceCompositionModels::nonRandomTwoLiquid::YfPrime
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (speciesName == species1Name_)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
otherComposition().Y(speciesName)
|
|
||||||
*speciesModel1_->YfPrime(speciesName, Tf)
|
|
||||||
*gamma1_;
|
|
||||||
}
|
|
||||||
else if (speciesName == species2Name_)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
otherComposition().Y(speciesName)
|
|
||||||
*speciesModel2_->YfPrime(speciesName, Tf)
|
|
||||||
*gamma2_;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return
|
|
||||||
- composition().Y(speciesName)
|
|
||||||
*(YfPrime(species1Name_, Tf) + YfPrime(species2Name_, Tf));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,156 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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::interfaceCompositionModels::nonRandomTwoLiquid
|
|
||||||
|
|
||||||
Description
|
|
||||||
Non ideal law for the mixing of two species. A separate composition model
|
|
||||||
is given for each species. The composition of a species is equal to the
|
|
||||||
value given by the model, scaled by the species fraction in the bulk of the
|
|
||||||
other phase, and multiplied by the activity coefficient for that species.
|
|
||||||
The gas behaviour is assumed ideal; i.e. the fugacity coefficient is taken
|
|
||||||
as equal to 1.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
nonRandomTwoLiquid.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef nonRandomTwoLiquid_H
|
|
||||||
#define nonRandomTwoLiquid_H
|
|
||||||
|
|
||||||
#include "interfaceCompositionModel.H"
|
|
||||||
#include "saturationModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace interfaceCompositionModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class nonRandomTwoLiquid Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class nonRandomTwoLiquid
|
|
||||||
:
|
|
||||||
public interfaceCompositionModel
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Activity coefficient for species 1
|
|
||||||
volScalarField gamma1_;
|
|
||||||
|
|
||||||
//- Activity coefficient for species 2
|
|
||||||
volScalarField gamma2_;
|
|
||||||
|
|
||||||
//- Name of species 1
|
|
||||||
word species1Name_;
|
|
||||||
|
|
||||||
//- Name of species 2
|
|
||||||
word species2Name_;
|
|
||||||
|
|
||||||
//- Index of species 1 within this thermo
|
|
||||||
label species1Index_;
|
|
||||||
|
|
||||||
//- Index of species 2 within this thermo
|
|
||||||
label species2Index_;
|
|
||||||
|
|
||||||
//- Non-randomness constant parameter for species 1
|
|
||||||
dimensionedScalar alpha12_;
|
|
||||||
|
|
||||||
//- Non-randomness constant parameter for species 2
|
|
||||||
dimensionedScalar alpha21_;
|
|
||||||
|
|
||||||
//- Non-randomness linear parameter for species 1
|
|
||||||
dimensionedScalar beta12_;
|
|
||||||
|
|
||||||
//- Non-randomness linear parameter for species 2
|
|
||||||
dimensionedScalar beta21_;
|
|
||||||
|
|
||||||
//- Interaction parameter model for species 1
|
|
||||||
autoPtr<saturationModel> saturationModel12_;
|
|
||||||
|
|
||||||
//- Interaction parameter model for species 2
|
|
||||||
autoPtr<saturationModel> saturationModel21_;
|
|
||||||
|
|
||||||
//- Composition model for species 1
|
|
||||||
autoPtr<interfaceCompositionModel> speciesModel1_;
|
|
||||||
|
|
||||||
//- Composition model for species 2
|
|
||||||
autoPtr<interfaceCompositionModel> speciesModel2_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("nonRandomTwoLiquid");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
nonRandomTwoLiquid
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~nonRandomTwoLiquid();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Update the composition
|
|
||||||
virtual void update(const volScalarField& Tf);
|
|
||||||
|
|
||||||
//- The interface species fraction
|
|
||||||
virtual tmp<volScalarField> Yf
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- The interface species fraction derivative w.r.t. temperature
|
|
||||||
virtual tmp<volScalarField> YfPrime
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace interfaceCompositionModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,152 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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 "saturated.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace interfaceCompositionModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(saturated, 0);
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
interfaceCompositionModel,
|
|
||||||
saturated,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::interfaceCompositionModels::saturated::wRatioByP() const
|
|
||||||
{
|
|
||||||
const dimensionedScalar Wi
|
|
||||||
(
|
|
||||||
"W",
|
|
||||||
dimMass/dimMoles,
|
|
||||||
composition().Wi(saturatedIndex_)
|
|
||||||
);
|
|
||||||
|
|
||||||
return Wi/thermo().W()/thermo().p();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::interfaceCompositionModels::saturated::saturated
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
interfaceCompositionModel(dict, interface),
|
|
||||||
saturatedName_(species()[0]),
|
|
||||||
saturatedIndex_(composition().species()[saturatedName_]),
|
|
||||||
saturationModel_
|
|
||||||
(
|
|
||||||
saturationModel::New
|
|
||||||
(
|
|
||||||
dict.subDict("saturationPressure"),
|
|
||||||
interface,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (species().size() != 1)
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "saturated model is suitable for one species only."
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::interfaceCompositionModels::saturated::~saturated()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::interfaceCompositionModels::saturated::update
|
|
||||||
(
|
|
||||||
const volScalarField& Tf
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::interfaceCompositionModels::saturated::Yf
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (saturatedName_ == speciesName)
|
|
||||||
{
|
|
||||||
return wRatioByP()*saturationModel_->pSat(Tf);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const label speciesIndex = composition().species()[speciesName];
|
|
||||||
|
|
||||||
return
|
|
||||||
composition().Y()[speciesIndex]
|
|
||||||
*(scalar(1) - wRatioByP()*saturationModel_->pSat(Tf))
|
|
||||||
/max(scalar(1) - composition().Y()[saturatedIndex_], small);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::interfaceCompositionModels::saturated::YfPrime
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (saturatedName_ == speciesName)
|
|
||||||
{
|
|
||||||
return wRatioByP()*saturationModel_->pSatPrime(Tf);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const label speciesIndex = composition().species()[speciesName];
|
|
||||||
|
|
||||||
return
|
|
||||||
- composition().Y()[speciesIndex]
|
|
||||||
*wRatioByP()*saturationModel_->pSatPrime(Tf)
|
|
||||||
/max(scalar(1) - composition().Y()[saturatedIndex_], small);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,128 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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::interfaceCompositionModels::saturated
|
|
||||||
|
|
||||||
Description
|
|
||||||
Model which uses a saturation pressure model for a single species to
|
|
||||||
calculate the interface composition.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
saturated.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef saturated_H
|
|
||||||
#define saturated_H
|
|
||||||
|
|
||||||
#include "interfaceCompositionModel.H"
|
|
||||||
#include "saturationModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace interfaceCompositionModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class saturated Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class saturated
|
|
||||||
:
|
|
||||||
public interfaceCompositionModel
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- saturated species name
|
|
||||||
word saturatedName_;
|
|
||||||
|
|
||||||
//- saturated species index
|
|
||||||
label saturatedIndex_;
|
|
||||||
|
|
||||||
//- Saturation pressure model
|
|
||||||
autoPtr<saturationModel> saturationModel_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Constant of proportionality between partial pressure and mass
|
|
||||||
// fraction
|
|
||||||
tmp<volScalarField> wRatioByP() const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("saturated");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
saturated
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~saturated();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Update the composition
|
|
||||||
virtual void update(const volScalarField& Tf);
|
|
||||||
|
|
||||||
//- The interface species fraction
|
|
||||||
virtual tmp<volScalarField> Yf
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- The interface species fraction derivative w.r.t. temperature
|
|
||||||
virtual tmp<volScalarField> YfPrime
|
|
||||||
(
|
|
||||||
const word& speciesName,
|
|
||||||
const volScalarField& Tf
|
|
||||||
) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace interfaceCompositionModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,99 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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 "constantSurfaceTensionCoefficient.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace interfaceSurfaceTensionModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(constantSurfaceTensionCoefficient, 0);
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
interfaceSurfaceTensionModel,
|
|
||||||
constantSurfaceTensionCoefficient,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::interfaceSurfaceTensionModels::constantSurfaceTensionCoefficient::
|
|
||||||
constantSurfaceTensionCoefficient
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
interfaceSurfaceTensionModel(dict, interface),
|
|
||||||
sigma_("sigma", dimSigma, dict)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::interfaceSurfaceTensionModels::constantSurfaceTensionCoefficient::
|
|
||||||
~constantSurfaceTensionCoefficient()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::interfaceSurfaceTensionModels::constantSurfaceTensionCoefficient::
|
|
||||||
sigma() const
|
|
||||||
{
|
|
||||||
return volScalarField::New
|
|
||||||
(
|
|
||||||
"sigma",
|
|
||||||
interface_.mesh(),
|
|
||||||
sigma_
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField>
|
|
||||||
Foam::interfaceSurfaceTensionModels::constantSurfaceTensionCoefficient::sigma
|
|
||||||
(
|
|
||||||
const label patchi
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<scalarField>
|
|
||||||
(
|
|
||||||
new scalarField
|
|
||||||
(
|
|
||||||
interface_.mesh().boundary()[patchi].size(),
|
|
||||||
sigma_.value()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,100 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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::interfaceSurfaceTensionModels::constantSurfaceTensionCoefficient
|
|
||||||
|
|
||||||
Description
|
|
||||||
Constant value surface tension model.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
constantSurfaceTensionCoefficient.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef constantSurfaceTensionCoefficient_H
|
|
||||||
#define constantSurfaceTensionCoefficient_H
|
|
||||||
|
|
||||||
#include "interfaceSurfaceTensionModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace interfaceSurfaceTensionModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class constantSurfaceTensionCoefficient Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class constantSurfaceTensionCoefficient
|
|
||||||
:
|
|
||||||
public interfaceSurfaceTensionModel
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Constant surface tension value
|
|
||||||
const dimensionedScalar sigma_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("constant");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
constantSurfaceTensionCoefficient
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~constantSurfaceTensionCoefficient();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Surface tension
|
|
||||||
virtual tmp<volScalarField> sigma() const;
|
|
||||||
|
|
||||||
//- Surface tension for a patch
|
|
||||||
virtual tmp<scalarField> sigma(const label patchi) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace interfaceSurfaceTensionModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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 "interfaceSurfaceTensionModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(interfaceSurfaceTensionModel, 0);
|
|
||||||
defineRunTimeSelectionTable(interfaceSurfaceTensionModel, dictionary);
|
|
||||||
}
|
|
||||||
|
|
||||||
const Foam::dimensionSet Foam::interfaceSurfaceTensionModel::dimSigma
|
|
||||||
(
|
|
||||||
1, 0, -2, 0, 0
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::interfaceSurfaceTensionModel::interfaceSurfaceTensionModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
interface_(interface)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::interfaceSurfaceTensionModel::~interfaceSurfaceTensionModel()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,132 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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::interfaceSurfaceTensionModel
|
|
||||||
|
|
||||||
Description
|
|
||||||
Abstract base-class for interface surface-tension models which can be
|
|
||||||
used when interface compression is applied between two phases.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
interfaceSurfaceTensionModel.C
|
|
||||||
interfaceSurfaceTensionModelNew.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef interfaceSurfaceTensionModel_H
|
|
||||||
#define interfaceSurfaceTensionModel_H
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "volFields.H"
|
|
||||||
#include "dictionary.H"
|
|
||||||
#include "runTimeSelectionTables.H"
|
|
||||||
#include "phaseInterface.H"
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class interfaceSurfaceTensionModel Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class interfaceSurfaceTensionModel
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Protected data
|
|
||||||
|
|
||||||
//- Interface
|
|
||||||
const phaseInterface interface_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("surfaceTensionModel");
|
|
||||||
|
|
||||||
|
|
||||||
// Declare runtime construction
|
|
||||||
declareRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
autoPtr,
|
|
||||||
interfaceSurfaceTensionModel,
|
|
||||||
dictionary,
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
),
|
|
||||||
(dict, interface)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Static Data Members
|
|
||||||
|
|
||||||
//- Coefficient dimensions
|
|
||||||
static const dimensionSet dimSigma;
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
interfaceSurfaceTensionModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~interfaceSurfaceTensionModel();
|
|
||||||
|
|
||||||
|
|
||||||
// Selectors
|
|
||||||
|
|
||||||
static autoPtr<interfaceSurfaceTensionModel> New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool outer=true
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Surface tension
|
|
||||||
virtual tmp<volScalarField> sigma() const = 0;
|
|
||||||
|
|
||||||
//- Surface tension for a patch
|
|
||||||
virtual tmp<scalarField> sigma(const label patchi) const = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,66 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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 "interfaceSurfaceTensionModel.H"
|
|
||||||
#include "phaseSystem.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::interfaceSurfaceTensionModel >
|
|
||||||
Foam::interfaceSurfaceTensionModel::New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool outer
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const dictionary& modelDict =
|
|
||||||
outer
|
|
||||||
? interface.fluid().modelSubDict<interfaceSurfaceTensionModel>(dict)
|
|
||||||
: dict;
|
|
||||||
|
|
||||||
const word interfaceSurfaceTensionModelType(modelDict.lookup("type"));
|
|
||||||
|
|
||||||
Info<< "Selecting interfaceSurfaceTensionModel for "
|
|
||||||
<< interface.name() << ": " << interfaceSurfaceTensionModelType << endl;
|
|
||||||
|
|
||||||
dictionaryConstructorTable::iterator cstrIter =
|
|
||||||
dictionaryConstructorTablePtr_->find(interfaceSurfaceTensionModelType);
|
|
||||||
|
|
||||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Unknown interfaceSurfaceTensionModelType type "
|
|
||||||
<< interfaceSurfaceTensionModelType << endl << endl
|
|
||||||
<< "Valid interfaceSurfaceTensionModel types are : " << endl
|
|
||||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
return cstrIter()(modelDict, interface);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,108 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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 "Antoine.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace saturationModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(Antoine, 0);
|
|
||||||
addToRunTimeSelectionTable(saturationModel, Antoine, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::saturationModels::Antoine::Antoine
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
saturationModel(dict, interface),
|
|
||||||
A_("A", dimless, dict),
|
|
||||||
B_("B", dimTemperature, dict),
|
|
||||||
C_("C", dimTemperature, dict)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::saturationModels::Antoine::~Antoine()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::Antoine::pSat
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return
|
|
||||||
dimensionedScalar(dimPressure, 1)
|
|
||||||
*exp(A_ + B_/(C_ + T));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::Antoine::pSatPrime
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return - pSat(T)*B_/sqr(C_ + T);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::Antoine::lnPSat
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return A_ + B_/(C_ + T);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::Antoine::Tsat
|
|
||||||
(
|
|
||||||
const volScalarField& p
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return
|
|
||||||
B_/(log(p*dimensionedScalar(dimless/dimPressure, 1)) - A_)
|
|
||||||
- C_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,121 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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::saturationModels::Antoine
|
|
||||||
|
|
||||||
Description
|
|
||||||
Antoine equation for the vapour pressure.
|
|
||||||
|
|
||||||
\f[
|
|
||||||
\log p = A + \frac{B}{C + T}
|
|
||||||
\f]
|
|
||||||
|
|
||||||
Coefficients \f$A\f$, \f$B\f$ and \f$C\f$ are to be supplied and should be
|
|
||||||
suitable for natural logarithms and temperatures in Kelvin.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
Antoine.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef Antoine_H
|
|
||||||
#define Antoine_H
|
|
||||||
|
|
||||||
#include "saturationModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace saturationModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class Antoine Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class Antoine
|
|
||||||
:
|
|
||||||
public saturationModel
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Protected data
|
|
||||||
|
|
||||||
//- Constant A
|
|
||||||
dimensionedScalar A_;
|
|
||||||
|
|
||||||
//- Constant B
|
|
||||||
dimensionedScalar B_;
|
|
||||||
|
|
||||||
//- Constant C
|
|
||||||
dimensionedScalar C_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("Antoine");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
Antoine
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~Antoine();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Saturation pressure
|
|
||||||
virtual tmp<volScalarField> pSat(const volScalarField& T) const;
|
|
||||||
|
|
||||||
//- Saturation pressure derivative w.r.t. temperature
|
|
||||||
virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
|
|
||||||
|
|
||||||
//- Natural log of the saturation pressure
|
|
||||||
virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
|
|
||||||
|
|
||||||
//- Saturation temperature
|
|
||||||
virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace saturationModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,118 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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 "AntoineExtended.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace saturationModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(AntoineExtended, 0);
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
saturationModel,
|
|
||||||
AntoineExtended,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::saturationModels::AntoineExtended::AntoineExtended
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
Antoine(dict, interface),
|
|
||||||
D_("D", dimless, dict),
|
|
||||||
F_("F", dimless, dict),
|
|
||||||
E_("E", dimless/pow(dimTemperature, F_), dict)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::saturationModels::AntoineExtended::~AntoineExtended()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::AntoineExtended::pSat
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return
|
|
||||||
dimensionedScalar(dimPressure/pow(dimTemperature, D_), 1)
|
|
||||||
*exp(A_ + B_/(C_ + T) + E_*pow(T, F_))
|
|
||||||
*pow(T, D_);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::AntoineExtended::pSatPrime
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return pSat(T)*((D_ + E_*F_*pow(T, F_))/T - B_/sqr(C_ + T));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::AntoineExtended::lnPSat
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return
|
|
||||||
A_
|
|
||||||
+ B_/(C_ + T)
|
|
||||||
+ D_*log(T*dimensionedScalar(dimless/dimTemperature, 1))
|
|
||||||
+ E_*pow(T, F_);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::AntoineExtended::Tsat
|
|
||||||
(
|
|
||||||
const volScalarField& p
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
NotImplemented;
|
|
||||||
|
|
||||||
return volScalarField::null();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,121 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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::saturationModels::AntoineExtended
|
|
||||||
|
|
||||||
Description
|
|
||||||
Extended Antoine equation for the vapour pressure.
|
|
||||||
|
|
||||||
\f[
|
|
||||||
\log (p) = A + \frac{B}{C + T} + D \log (T) + E T^F
|
|
||||||
\f]
|
|
||||||
|
|
||||||
Coefficients \f$A\f$, \f$B\f$, \f$C\f$, \f$D\f$, \f$E\f$ and \f$F\f$ are
|
|
||||||
to be supplied and should be suitable for natural logarithms and
|
|
||||||
temperatures in Kelvin.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
AntoineExtended.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef AntoineExtended_H
|
|
||||||
#define AntoineExtended_H
|
|
||||||
|
|
||||||
#include "Antoine.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace saturationModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class AntoineExtended Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class AntoineExtended
|
|
||||||
:
|
|
||||||
public Antoine
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Constant D
|
|
||||||
dimensionedScalar D_;
|
|
||||||
|
|
||||||
//- Constant F
|
|
||||||
dimensionedScalar F_;
|
|
||||||
|
|
||||||
//- Constant E
|
|
||||||
// (after F so F's dimensions can be used in the construction)
|
|
||||||
dimensionedScalar E_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("AntoineExtended");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
AntoineExtended
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~AntoineExtended();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Saturation pressure
|
|
||||||
virtual tmp<volScalarField> pSat(const volScalarField& T) const;
|
|
||||||
|
|
||||||
//- Saturation pressure derivative w.r.t. temperature
|
|
||||||
virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
|
|
||||||
|
|
||||||
//- Natural log of the saturation pressure
|
|
||||||
virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
|
|
||||||
|
|
||||||
//- Saturation temperature
|
|
||||||
virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace saturationModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,130 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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 "ArdenBuck.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace saturationModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(ArdenBuck, 0);
|
|
||||||
addToRunTimeSelectionTable(saturationModel, ArdenBuck, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static const Foam::dimensionedScalar zeroC("", Foam::dimTemperature, 273.15);
|
|
||||||
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21);
|
|
||||||
static const Foam::dimensionedScalar B("", Foam::dimless, 18.678);
|
|
||||||
static const Foam::dimensionedScalar C("", Foam::dimTemperature, 234.5);
|
|
||||||
static const Foam::dimensionedScalar D("", Foam::dimTemperature, 257.14);
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::ArdenBuck::xByTC
|
|
||||||
(
|
|
||||||
const volScalarField& TC
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return (B - TC/C)/(D + TC);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::saturationModels::ArdenBuck::ArdenBuck
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
saturationModel(dict, interface)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::saturationModels::ArdenBuck::~ArdenBuck()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::ArdenBuck::pSat
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
volScalarField TC(T - zeroC);
|
|
||||||
|
|
||||||
return A*exp(TC*xByTC(TC));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::ArdenBuck::pSatPrime
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
volScalarField TC(T - zeroC);
|
|
||||||
|
|
||||||
volScalarField x(xByTC(TC));
|
|
||||||
|
|
||||||
return A*exp(TC*x)*(D*x - TC/C)/(D + TC);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::ArdenBuck::lnPSat
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
volScalarField TC(T - zeroC);
|
|
||||||
|
|
||||||
return log(A.value()) + TC*xByTC(TC);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::ArdenBuck::Tsat
|
|
||||||
(
|
|
||||||
const volScalarField& p
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
NotImplemented;
|
|
||||||
|
|
||||||
return volScalarField::null();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,106 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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::saturationModels::ArdenBuck
|
|
||||||
|
|
||||||
Description
|
|
||||||
ArdenBuck equation for the vapour pressure of moist air.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
ArdenBuck.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef ArdenBuck_H
|
|
||||||
#define ArdenBuck_H
|
|
||||||
|
|
||||||
#include "saturationModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace saturationModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class ArdenBuck Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class ArdenBuck
|
|
||||||
:
|
|
||||||
public saturationModel
|
|
||||||
{
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Exponent divided by the temperature
|
|
||||||
tmp<volScalarField> xByTC(const volScalarField& TC) const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("ArdenBuck");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
ArdenBuck
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~ArdenBuck();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Saturation pressure
|
|
||||||
virtual tmp<volScalarField> pSat(const volScalarField& T) const;
|
|
||||||
|
|
||||||
//- Saturation pressure derivative w.r.t. temperature
|
|
||||||
virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
|
|
||||||
|
|
||||||
//- Natural log of the saturation pressure
|
|
||||||
virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
|
|
||||||
|
|
||||||
//- Saturation temperature
|
|
||||||
virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace saturationModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,130 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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 "constantSaturationConditions.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace saturationModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(constantSaturationConditions, 0);
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
saturationModel,
|
|
||||||
constantSaturationConditions,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::saturationModels::constantSaturationConditions::
|
|
||||||
constantSaturationConditions
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
saturationModel(dict, interface),
|
|
||||||
pSat_("pSat", dimPressure, dict),
|
|
||||||
Tsat_("Tsat", dimTemperature, dict)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::saturationModels::constantSaturationConditions::
|
|
||||||
~constantSaturationConditions()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::constantSaturationConditions::pSat
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return volScalarField::New
|
|
||||||
(
|
|
||||||
"pSat",
|
|
||||||
T.mesh(),
|
|
||||||
pSat_
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::constantSaturationConditions::pSatPrime
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return volScalarField::New
|
|
||||||
(
|
|
||||||
"pSatPrime",
|
|
||||||
T.mesh(),
|
|
||||||
dimensionedScalar(dimPressure/dimTemperature, 0)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::constantSaturationConditions::lnPSat
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return volScalarField::New
|
|
||||||
(
|
|
||||||
"lnPSat",
|
|
||||||
T.mesh(),
|
|
||||||
dimensionedScalar(dimless, log(pSat_.value()))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::constantSaturationConditions::Tsat
|
|
||||||
(
|
|
||||||
const volScalarField& p
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return volScalarField::New
|
|
||||||
(
|
|
||||||
"Tsat",
|
|
||||||
p.mesh(),
|
|
||||||
Tsat_
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,111 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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::saturationModels::constantSaturationConditions
|
|
||||||
|
|
||||||
Description
|
|
||||||
Constant saturation pressure and temperature.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
constantSaturationConditions.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef constantSaturationConditions_H
|
|
||||||
#define constantSaturationConditions_H
|
|
||||||
|
|
||||||
#include "saturationModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace saturationModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class constantSaturationConditions Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class constantSaturationConditions
|
|
||||||
:
|
|
||||||
public saturationModel
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Constant saturation pressure
|
|
||||||
dimensionedScalar pSat_;
|
|
||||||
|
|
||||||
//- Constant saturation temperature
|
|
||||||
dimensionedScalar Tsat_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("constant");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
constantSaturationConditions
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~constantSaturationConditions();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Saturation pressure
|
|
||||||
virtual tmp<volScalarField> pSat(const volScalarField& T) const;
|
|
||||||
|
|
||||||
//- Saturation pressure derivative w.r.t. temperature
|
|
||||||
virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
|
|
||||||
|
|
||||||
//- Natural log of the saturation pressure
|
|
||||||
virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
|
|
||||||
|
|
||||||
//- Saturation temperature
|
|
||||||
virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace saturationModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,136 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2017-2022 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 "function1.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace saturationModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(function1, 0);
|
|
||||||
addToRunTimeSelectionTable(saturationModel, function1, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::saturationModels::function1::function1
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
saturationModel(dict, interface),
|
|
||||||
function_(Function1<scalar>::New("function", dict))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::saturationModels::function1::~function1()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::function1::pSat
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
NotImplemented;
|
|
||||||
return volScalarField::null();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::function1::pSatPrime
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
NotImplemented;
|
|
||||||
return volScalarField::null();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::function1::lnPSat
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
NotImplemented;
|
|
||||||
return volScalarField::null();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::function1::Tsat
|
|
||||||
(
|
|
||||||
const volScalarField& p
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
tmp<volScalarField> tTsat
|
|
||||||
(
|
|
||||||
volScalarField::New
|
|
||||||
(
|
|
||||||
"Tsat",
|
|
||||||
p.mesh(),
|
|
||||||
dimensionedScalar(dimTemperature, 0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField& Tsat = tTsat.ref();
|
|
||||||
|
|
||||||
forAll(Tsat, celli)
|
|
||||||
{
|
|
||||||
Tsat[celli] = function_->value(p[celli]);
|
|
||||||
}
|
|
||||||
|
|
||||||
volScalarField::Boundary& TsatBf = Tsat.boundaryFieldRef();
|
|
||||||
|
|
||||||
forAll(Tsat.boundaryField(), patchi)
|
|
||||||
{
|
|
||||||
scalarField& Tsatp = TsatBf[patchi];
|
|
||||||
const scalarField& pp = p.boundaryField()[patchi];
|
|
||||||
|
|
||||||
forAll(Tsatp, facei)
|
|
||||||
{
|
|
||||||
Tsatp[facei] = function_->value(pp[facei]);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return tTsat;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,147 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2017-2022 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::saturationModels::function1
|
|
||||||
|
|
||||||
Description
|
|
||||||
Saturation vapour temperature in terms of
|
|
||||||
the vapour pressure (in Pa). The saturation temperature in Kelvins is
|
|
||||||
specified as a Foam::Function1 type, to enable use of, e.g. constant,
|
|
||||||
polynomial, table values.
|
|
||||||
|
|
||||||
Currently this class only provides \f$T_sat\f$, the inverse function to
|
|
||||||
return the vapour pressure for a given temperature are not implemented.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
type function1;
|
|
||||||
function polynomial
|
|
||||||
(
|
|
||||||
(308.0422 0)
|
|
||||||
(0.0015096 1)
|
|
||||||
(-1.61589e-8 2)
|
|
||||||
(1.114106e-13 3)
|
|
||||||
(-4.52216e-19 4)
|
|
||||||
(1.05192e-24 5)
|
|
||||||
(-1.2953e-30 6)
|
|
||||||
(6.5365e-37 7)
|
|
||||||
)
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
type function1;
|
|
||||||
function table;
|
|
||||||
functionCoeffs
|
|
||||||
{
|
|
||||||
file "filename.csv";
|
|
||||||
format csv;
|
|
||||||
nHeaderLine 1;
|
|
||||||
refColumn 0;
|
|
||||||
componentColumns (1);
|
|
||||||
separator ",";
|
|
||||||
mergeSeparators no;
|
|
||||||
outOfBounds clamp;
|
|
||||||
interpolationScheme linear;
|
|
||||||
};
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
function1.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef function1_H
|
|
||||||
#define function1_H
|
|
||||||
|
|
||||||
#include "saturationModel.H"
|
|
||||||
#include "Function1.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace saturationModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class function1 Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class function1
|
|
||||||
:
|
|
||||||
public saturationModel
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Saturation temperature as a function of pressure
|
|
||||||
autoPtr<Function1<scalar>> function_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("function1");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
function1
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~function1();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Saturation pressure
|
|
||||||
virtual tmp<volScalarField> pSat(const volScalarField& T) const;
|
|
||||||
|
|
||||||
//- Saturation pressure derivative w.r.t. temperature
|
|
||||||
virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
|
|
||||||
|
|
||||||
//- Natural log of the saturation pressure
|
|
||||||
virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
|
|
||||||
|
|
||||||
//- Saturation temperature
|
|
||||||
virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace saturationModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,135 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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 "polynomial.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace saturationModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(polynomial, 0);
|
|
||||||
addToRunTimeSelectionTable(saturationModel, polynomial, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::saturationModels::polynomial::polynomial
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
saturationModel(dict, interface),
|
|
||||||
C_(dict.lookup("C<8>"))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::saturationModels::polynomial::~polynomial()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::polynomial::pSat
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
NotImplemented;
|
|
||||||
return volScalarField::null();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::polynomial::pSatPrime
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
NotImplemented;
|
|
||||||
return volScalarField::null();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::polynomial::lnPSat
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
NotImplemented;
|
|
||||||
return volScalarField::null();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::saturationModels::polynomial::Tsat
|
|
||||||
(
|
|
||||||
const volScalarField& p
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
tmp<volScalarField> tTsat
|
|
||||||
(
|
|
||||||
volScalarField::New
|
|
||||||
(
|
|
||||||
"Tsat",
|
|
||||||
p.mesh(),
|
|
||||||
dimensionedScalar(dimTemperature, 0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField& Tsat = tTsat.ref();
|
|
||||||
|
|
||||||
forAll(Tsat, celli)
|
|
||||||
{
|
|
||||||
Tsat[celli] = C_.value(p[celli]);
|
|
||||||
}
|
|
||||||
|
|
||||||
volScalarField::Boundary& TsatBf = Tsat.boundaryFieldRef();
|
|
||||||
|
|
||||||
forAll(Tsat.boundaryField(), patchi)
|
|
||||||
{
|
|
||||||
scalarField& Tsatp = TsatBf[patchi];
|
|
||||||
const scalarField& pp = p.boundaryField()[patchi];
|
|
||||||
|
|
||||||
forAll(Tsatp, facei)
|
|
||||||
{
|
|
||||||
Tsatp[facei] = C_.value(pp[facei]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return tTsat;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,117 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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::saturationModels::polynomial
|
|
||||||
|
|
||||||
Description
|
|
||||||
Polynomial equation for the saturation vapour temperature in terms of
|
|
||||||
the vapour pressure (in Pa).
|
|
||||||
|
|
||||||
\f[
|
|
||||||
T_sat = \sum_i C_i p^i
|
|
||||||
\f]
|
|
||||||
|
|
||||||
where \f$p\f$ is the pressure in Pa and \f$C\f$ are the coefficients.
|
|
||||||
|
|
||||||
Currently this class only provides \f$T_sat\f$, the inverse function to
|
|
||||||
return the vapour pressure for a given temperature are not implemented.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
polynomial.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef polynomial_H
|
|
||||||
#define polynomial_H
|
|
||||||
|
|
||||||
#include "saturationModel.H"
|
|
||||||
#include "Polynomial.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace saturationModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class polynomial Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class polynomial
|
|
||||||
:
|
|
||||||
public saturationModel
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Polynomial coefficients
|
|
||||||
Polynomial<8> C_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("polynomial");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
polynomial
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~polynomial();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Saturation pressure
|
|
||||||
virtual tmp<volScalarField> pSat(const volScalarField& T) const;
|
|
||||||
|
|
||||||
//- Saturation pressure derivative w.r.t. temperature
|
|
||||||
virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
|
|
||||||
|
|
||||||
//- Natural log of the saturation pressure
|
|
||||||
virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
|
|
||||||
|
|
||||||
//- Saturation temperature
|
|
||||||
virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace saturationModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,78 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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 "saturationModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(saturationModel, 0);
|
|
||||||
defineRunTimeSelectionTable(saturationModel, dictionary);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::saturationModel::saturationModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
regIOobject
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
IOobject::groupName("saturationModel", interface.name()),
|
|
||||||
interface.mesh().time().constant(),
|
|
||||||
interface.mesh()
|
|
||||||
)
|
|
||||||
),
|
|
||||||
interface_(interface)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::saturationModel::~saturationModel()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
const Foam::phaseInterface& Foam::saturationModel::interface() const
|
|
||||||
{
|
|
||||||
return interface_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Foam::saturationModel::writeData(Ostream& os) const
|
|
||||||
{
|
|
||||||
return os.good();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,150 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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::saturationModel
|
|
||||||
|
|
||||||
Description
|
|
||||||
Model to describe the dependence of saturation pressure on temperature, and
|
|
||||||
vice versa
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
saturationModel.C
|
|
||||||
saturationModelNew.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef saturationModel_H
|
|
||||||
#define saturationModel_H
|
|
||||||
|
|
||||||
#include "volFields.H"
|
|
||||||
#include "dictionary.H"
|
|
||||||
#include "phaseInterface.H"
|
|
||||||
#include "runTimeSelectionTables.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class saturationModel Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class saturationModel
|
|
||||||
:
|
|
||||||
public regIOobject
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- The interface
|
|
||||||
const phaseInterface interface_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("saturationModel");
|
|
||||||
|
|
||||||
|
|
||||||
//- Declare runtime construction
|
|
||||||
declareRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
autoPtr,
|
|
||||||
saturationModel,
|
|
||||||
dictionary,
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
),
|
|
||||||
(dict, interface)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
saturationModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Selectors
|
|
||||||
|
|
||||||
static autoPtr<saturationModel> New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool outer=true
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~saturationModel();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Access the interface
|
|
||||||
const phaseInterface& interface() const;
|
|
||||||
|
|
||||||
//- Saturation pressure
|
|
||||||
virtual tmp<volScalarField> pSat
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- Saturation pressure derivative w.r.t. temperature
|
|
||||||
virtual tmp<volScalarField> pSatPrime
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- Natural log of the saturation pressure
|
|
||||||
virtual tmp<volScalarField> lnPSat
|
|
||||||
(
|
|
||||||
const volScalarField& T
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- Saturation temperature
|
|
||||||
virtual tmp<volScalarField> Tsat
|
|
||||||
(
|
|
||||||
const volScalarField& p
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- Dummy write for regIOobject
|
|
||||||
bool writeData(Ostream& os) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2022 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 "saturationModel.H"
|
|
||||||
#include "phaseSystem.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::saturationModel> Foam::saturationModel::New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool outer
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const dictionary& modelDict =
|
|
||||||
outer ? interface.fluid().modelSubDict<saturationModel>(dict) : dict;
|
|
||||||
|
|
||||||
const word saturationModelType(modelDict.lookup("type"));
|
|
||||||
|
|
||||||
Info<< "Selecting saturationModel for "
|
|
||||||
<< interface.name() << ": " << saturationModelType << endl;
|
|
||||||
|
|
||||||
dictionaryConstructorTable::iterator cstrIter =
|
|
||||||
dictionaryConstructorTablePtr_->find(saturationModelType);
|
|
||||||
|
|
||||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Unknown saturationModelType type "
|
|
||||||
<< saturationModelType << endl << endl
|
|
||||||
<< "Valid saturationModel types are : " << endl
|
|
||||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
return cstrIter()(modelDict, interface);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,91 +0,0 @@
|
|||||||
dragModels/dragModel/dragModel.C
|
|
||||||
dragModels/dragModel/dragModelNew.C
|
|
||||||
dragModels/dispersedDragModel/dispersedDragModel.C
|
|
||||||
dragModels/Beetstra/Beetstra.C
|
|
||||||
dragModels/segregated/segregated.C
|
|
||||||
dragModels/Ergun/Ergun.C
|
|
||||||
dragModels/Gibilaro/Gibilaro.C
|
|
||||||
dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C
|
|
||||||
dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C
|
|
||||||
dragModels/Lain/Lain.C
|
|
||||||
dragModels/SchillerNaumann/SchillerNaumann.C
|
|
||||||
dragModels/SyamlalOBrien/SyamlalOBrien.C
|
|
||||||
dragModels/TomiyamaCorrelated/TomiyamaCorrelated.C
|
|
||||||
dragModels/TomiyamaAnalytic/TomiyamaAnalytic.C
|
|
||||||
dragModels/Tenneti/Tenneti.C
|
|
||||||
dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.C
|
|
||||||
dragModels/WenYu/WenYu.C
|
|
||||||
dragModels/IshiiZuber/IshiiZuber.C
|
|
||||||
dragModels/AttouFerschneider/AttouFerschneider.C
|
|
||||||
dragModels/aerosolDrag/aerosolDrag.C
|
|
||||||
dragModels/timeScaleFilteredDrag/timeScaleFilteredDrag.C
|
|
||||||
|
|
||||||
swarmCorrections/swarmCorrection/swarmCorrection.C
|
|
||||||
swarmCorrections/swarmCorrection/swarmCorrectionNew.C
|
|
||||||
swarmCorrections/noSwarm/noSwarm.C
|
|
||||||
swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.C
|
|
||||||
|
|
||||||
liftModels/liftModel/liftModel.C
|
|
||||||
liftModels/liftModel/liftModelNew.C
|
|
||||||
liftModels/dispersedLiftModel/dispersedLiftModel.C
|
|
||||||
liftModels/noLift/noLift.C
|
|
||||||
liftModels/constantLiftCoefficient/constantLiftCoefficient.C
|
|
||||||
liftModels/Moraga/Moraga.C
|
|
||||||
liftModels/LegendreMagnaudet/LegendreMagnaudet.C
|
|
||||||
liftModels/SaffmanMei/SaffmanMei.C
|
|
||||||
liftModels/TomiyamaLift/TomiyamaLift.C
|
|
||||||
liftModels/wallDampedLift/wallDampedLift.C
|
|
||||||
|
|
||||||
heatTransferModels/heatTransferModel/heatTransferModel.C
|
|
||||||
heatTransferModels/heatTransferModel/heatTransferModelNew.C
|
|
||||||
heatTransferModels/constantNu/constantNuHeatTransfer.C
|
|
||||||
heatTransferModels/RanzMarshall/RanzMarshall.C
|
|
||||||
heatTransferModels/Gunn/Gunn.C
|
|
||||||
heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.C
|
|
||||||
heatTransferModels/timeScaleFilteredHeatTransfer/timeScaleFilteredHeatTransfer.C
|
|
||||||
|
|
||||||
virtualMassModels/virtualMassModel/virtualMassModel.C
|
|
||||||
virtualMassModels/virtualMassModel/virtualMassModelNew.C
|
|
||||||
virtualMassModels/dispersedVirtualMassModel/dispersedVirtualMassModel.C
|
|
||||||
virtualMassModels/noVirtualMass/noVirtualMass.C
|
|
||||||
virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C
|
|
||||||
virtualMassModels/Lamb/Lamb.C
|
|
||||||
|
|
||||||
wallLubricationModels/wallLubricationModel/wallLubricationModel.C
|
|
||||||
wallLubricationModels/wallLubricationModel/wallLubricationModelNew.C
|
|
||||||
wallLubricationModels/dispersedWallLubricationModel/dispersedWallLubricationModel.C
|
|
||||||
wallLubricationModels/noWallLubrication/noWallLubrication.C
|
|
||||||
wallLubricationModels/Antal/Antal.C
|
|
||||||
wallLubricationModels/Frank/Frank.C
|
|
||||||
wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C
|
|
||||||
|
|
||||||
turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C
|
|
||||||
turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModelNew.C
|
|
||||||
turbulentDispersionModels/dispersedTurbulentDispersionModel/dispersedTurbulentDispersionModel.C
|
|
||||||
turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C
|
|
||||||
turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.C
|
|
||||||
turbulentDispersionModels/Burns/Burns.C
|
|
||||||
turbulentDispersionModels/Gosman/Gosman.C
|
|
||||||
turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.C
|
|
||||||
|
|
||||||
aspectRatioModels/aspectRatioModel/aspectRatioModel.C
|
|
||||||
aspectRatioModels/aspectRatioModel/aspectRatioModelNew.C
|
|
||||||
aspectRatioModels/constantAspectRatio/constantAspectRatio.C
|
|
||||||
aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.C
|
|
||||||
aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.C
|
|
||||||
aspectRatioModels/Wellek/Wellek.C
|
|
||||||
|
|
||||||
wallDependentModel/wallDependentModel.C
|
|
||||||
|
|
||||||
wallDampingModels/wallDampingModel/wallDampingModel.C
|
|
||||||
wallDampingModels/wallDampingModel/wallDampingModelNew.C
|
|
||||||
wallDampingModels/linear/linearWallDamping.C
|
|
||||||
wallDampingModels/cosine/cosineWallDamping.C
|
|
||||||
wallDampingModels/sine/sineWallDamping.C
|
|
||||||
|
|
||||||
phaseTransferModels/phaseTransferModel/phaseTransferModel.C
|
|
||||||
phaseTransferModels/phaseTransferModel/phaseTransferModelNew.C
|
|
||||||
phaseTransferModels/deposition/deposition.C
|
|
||||||
phaseTransferModels/reactionDriven/reactionDriven.C
|
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libeulerianInterfacialModels
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
EXE_INC = \
|
|
||||||
-I../phaseSystems/lnInclude \
|
|
||||||
-I$(LIB_SRC)/physicalProperties/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
|
||||||
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/MomentumTransportModels/phaseCompressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
|
||||||
-I$(LIB_SRC)/sampling/lnInclude
|
|
||||||
|
|
||||||
LIB_LIBS = \
|
|
||||||
-lphaseSystem \
|
|
||||||
-lfluidThermophysicalModels \
|
|
||||||
-lspecie
|
|
||||||
@ -1,76 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2014-2022 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 "TomiyamaAspectRatio.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace aspectRatioModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(TomiyamaAspectRatio, 0);
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
aspectRatioModel,
|
|
||||||
TomiyamaAspectRatio,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::aspectRatioModels::TomiyamaAspectRatio::TomiyamaAspectRatio
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
VakhrushevEfremov(dict, interface),
|
|
||||||
wallDependentModel(interface_.mesh())
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::aspectRatioModels::TomiyamaAspectRatio::~TomiyamaAspectRatio()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::aspectRatioModels::TomiyamaAspectRatio::E() const
|
|
||||||
{
|
|
||||||
return
|
|
||||||
VakhrushevEfremov::E()
|
|
||||||
*max(1 - 0.35*yWall()/interface_.dispersed().d(), scalar(0.65));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,101 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2014-2022 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::aspectRatioModels::TomiyamaAspectRatio
|
|
||||||
|
|
||||||
Description
|
|
||||||
Aspect ratio model of Tomiyama.
|
|
||||||
|
|
||||||
Reference:
|
|
||||||
\verbatim
|
|
||||||
Otromke, M. (2013).
|
|
||||||
Implementation and Comparison of Correlations for interfacial Forces in
|
|
||||||
a Gas-Liquid System within an Euler-Euler Framework.
|
|
||||||
PhD Thesis.
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
TomiyamaAspectRatio.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef TomiyamaAspectRatio_H
|
|
||||||
#define TomiyamaAspectRatio_H
|
|
||||||
|
|
||||||
#include "VakhrushevEfremov.H"
|
|
||||||
#include "wallDependentModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace aspectRatioModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class TomiyamaAspectRatio Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class TomiyamaAspectRatio
|
|
||||||
:
|
|
||||||
public VakhrushevEfremov,
|
|
||||||
public wallDependentModel
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("Tomiyama");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
TomiyamaAspectRatio
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~TomiyamaAspectRatio();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Aspect ratio
|
|
||||||
virtual tmp<volScalarField> E() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace aspectRatioModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,79 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2014-2022 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 "VakhrushevEfremov.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace aspectRatioModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(VakhrushevEfremov, 0);
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
aspectRatioModel,
|
|
||||||
VakhrushevEfremov,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::aspectRatioModels::VakhrushevEfremov::VakhrushevEfremov
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
aspectRatioModel(dict, interface)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::aspectRatioModels::VakhrushevEfremov::~VakhrushevEfremov()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::aspectRatioModels::VakhrushevEfremov::E() const
|
|
||||||
{
|
|
||||||
const volScalarField Ta(interface_.Ta());
|
|
||||||
|
|
||||||
return
|
|
||||||
neg(Ta - 1)
|
|
||||||
+ pos0(Ta - 1)*neg(Ta - 39.8)
|
|
||||||
*pow3(0.81 + 0.206*tanh(1.6 - 2*log10(max(Ta, scalar(1)))))
|
|
||||||
+ pos0(Ta - 39.8)*0.24;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,99 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2014-2022 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::aspectRatioModels::VakhrushevEfremov
|
|
||||||
|
|
||||||
Description
|
|
||||||
Aspect ratio model of Vakhrushev and Efremov.
|
|
||||||
|
|
||||||
Reference:
|
|
||||||
\verbatim
|
|
||||||
Vakhrushev, I. A., & Efremov, G. I. (1970).
|
|
||||||
Interpolation formula for computing the velocities of single gas bubbles
|
|
||||||
in liquids.
|
|
||||||
Chemistry and Technology of Fuels and Oils, 6(5), 376-379.
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
VakhrushevEfremov.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef VakhrushevEfremov_H
|
|
||||||
#define VakhrushevEfremov_H
|
|
||||||
|
|
||||||
#include "aspectRatioModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace aspectRatioModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class VakhrushevEfremov Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class VakhrushevEfremov
|
|
||||||
:
|
|
||||||
public aspectRatioModel
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("VakhrushevEfremov");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
VakhrushevEfremov
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~VakhrushevEfremov();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Aspect ratio
|
|
||||||
virtual tmp<volScalarField> E() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace aspectRatioModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,73 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2014-2022 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 "Wellek.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace aspectRatioModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(Wellek, 0);
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
aspectRatioModel,
|
|
||||||
Wellek,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::aspectRatioModels::Wellek::Wellek
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
aspectRatioModel(dict, interface)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::aspectRatioModels::Wellek::~Wellek()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::aspectRatioModels::Wellek::E() const
|
|
||||||
{
|
|
||||||
return scalar(1)/(1 + 0.163*pow(interface_.Eo(), 0.757));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,105 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2014-2022 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::aspectRatioModels::Wellek
|
|
||||||
|
|
||||||
Description
|
|
||||||
Aspect ratio model of Wellek et al.
|
|
||||||
|
|
||||||
References:
|
|
||||||
\verbatim
|
|
||||||
Otromke, M. (2013).
|
|
||||||
Implementation and Comparison of Correlations for interfacial Forces in
|
|
||||||
a Gas-Liquid System within an Euler-Euler Framework.
|
|
||||||
PhD Thesis.
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
Wellek, R. M., Agrawal, A. K., & Skelland, A. H. P. (1966).
|
|
||||||
Shape of liquid drops moving in liquid media.
|
|
||||||
AIChE Journal, 12(5), 854-862.
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
Wellek.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef Wellek_H
|
|
||||||
#define Wellek_H
|
|
||||||
|
|
||||||
#include "aspectRatioModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace aspectRatioModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class Wellek Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class Wellek
|
|
||||||
:
|
|
||||||
public aspectRatioModel
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("Wellek");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
Wellek
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~Wellek();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Aspect ratio
|
|
||||||
virtual tmp<volScalarField> E() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace aspectRatioModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,55 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2014-2022 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 "aspectRatioModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(aspectRatioModel, 0);
|
|
||||||
defineRunTimeSelectionTable(aspectRatioModel, dictionary);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::aspectRatioModel::aspectRatioModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
interface_(interface.modelCast<aspectRatioModel, dispersedPhaseInterface>())
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::aspectRatioModel::~aspectRatioModel()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,123 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2014-2022 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::aspectRatioModel
|
|
||||||
|
|
||||||
Description
|
|
||||||
Model for deviations in the shape of the dispersed phase from spherical.
|
|
||||||
Just a sub-model modifier, typically for the drag model. Not a proper part
|
|
||||||
of the diameter/shape modelling in the phase models.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
aspectRatioModel.C
|
|
||||||
aspectRatioModelNew.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef aspectRatioModel_H
|
|
||||||
#define aspectRatioModel_H
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "volFields.H"
|
|
||||||
#include "dictionary.H"
|
|
||||||
#include "runTimeSelectionTables.H"
|
|
||||||
#include "dispersedPhaseInterface.H"
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class aspectRatioModel Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class aspectRatioModel
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Protected data
|
|
||||||
|
|
||||||
//- Interface
|
|
||||||
const dispersedPhaseInterface interface_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("aspectRatioModel");
|
|
||||||
|
|
||||||
|
|
||||||
// Declare runtime construction
|
|
||||||
declareRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
autoPtr,
|
|
||||||
aspectRatioModel,
|
|
||||||
dictionary,
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
),
|
|
||||||
(dict, interface)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
aspectRatioModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~aspectRatioModel();
|
|
||||||
|
|
||||||
|
|
||||||
// Selectors
|
|
||||||
|
|
||||||
static autoPtr<aspectRatioModel> New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Aspect ratio
|
|
||||||
virtual tmp<volScalarField> E() const = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2014-2022 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 "aspectRatioModel.H"
|
|
||||||
#include "phaseSystem.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::aspectRatioModel>
|
|
||||||
Foam::aspectRatioModel::New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const word aspectRatioModelType(dict.lookup("type"));
|
|
||||||
|
|
||||||
Info<< "Selecting aspectRatioModel for "
|
|
||||||
<< interface.name() << ": " << aspectRatioModelType << endl;
|
|
||||||
|
|
||||||
dictionaryConstructorTable::iterator cstrIter =
|
|
||||||
dictionaryConstructorTablePtr_->find(aspectRatioModelType);
|
|
||||||
|
|
||||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Unknown aspectRatioModelType type "
|
|
||||||
<< aspectRatioModelType << endl << endl
|
|
||||||
<< "Valid aspectRatioModel types are : " << endl
|
|
||||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
return cstrIter()(dict, interface);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,79 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2014-2022 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 "constantAspectRatio.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace aspectRatioModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(constantAspectRatio, 0);
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
aspectRatioModel,
|
|
||||||
constantAspectRatio,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::aspectRatioModels::constantAspectRatio::constantAspectRatio
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
)
|
|
||||||
:
|
|
||||||
aspectRatioModel(dict, interface),
|
|
||||||
E0_("E0", dimless, dict)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::aspectRatioModels::constantAspectRatio::~constantAspectRatio()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::aspectRatioModels::constantAspectRatio::E() const
|
|
||||||
{
|
|
||||||
return volScalarField::New
|
|
||||||
(
|
|
||||||
aspectRatioModel::typeName + ":E",
|
|
||||||
interface_.mesh(),
|
|
||||||
E0_
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,97 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2014-2022 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::aspectRatioModels::constantAspectRatio
|
|
||||||
|
|
||||||
Description
|
|
||||||
Constant value aspect ratio model.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
constantAspectRatio.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef constantAspectRatio_H
|
|
||||||
#define constantAspectRatio_H
|
|
||||||
|
|
||||||
#include "aspectRatioModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace aspectRatioModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class constantAspectRatio Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class constantAspectRatio
|
|
||||||
:
|
|
||||||
public aspectRatioModel
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Constant aspect ratio value
|
|
||||||
const dimensionedScalar E0_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("constant");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
constantAspectRatio
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~constantAspectRatio();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Aspect ratio
|
|
||||||
virtual tmp<volScalarField> E() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace aspectRatioModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,167 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2018-2022 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 "AttouFerschneider.H"
|
|
||||||
#include "phaseSystem.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(AttouFerschneider, 0);
|
|
||||||
addToRunTimeSelectionTable(dragModel, AttouFerschneider, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::dragModels::AttouFerschneider::KGasLiquid
|
|
||||||
(
|
|
||||||
const phaseModel& gas,
|
|
||||||
const phaseModel& liquid
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
const phaseModel& solid = gas.fluid().phases()[solidName_];
|
|
||||||
|
|
||||||
const volScalarField oneMinusGas(max(1 - gas, liquid.residualAlpha()));
|
|
||||||
const volScalarField cbrtR
|
|
||||||
(
|
|
||||||
cbrt(max(solid, solid.residualAlpha())/oneMinusGas)
|
|
||||||
);
|
|
||||||
const volScalarField magURel(mag(gas.U() - liquid.U()));
|
|
||||||
|
|
||||||
return
|
|
||||||
E2_*gas.thermo().mu()*sqr(oneMinusGas/solid.d())*sqr(cbrtR)
|
|
||||||
/max(gas, gas.residualAlpha())
|
|
||||||
+ E2_*gas.rho()*magURel*(1 - gas)/solid.d()*cbrtR;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::dragModels::AttouFerschneider::KGasSolid
|
|
||||||
(
|
|
||||||
const phaseModel& gas,
|
|
||||||
const phaseModel& solid
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
const volScalarField oneMinusGas(max(1 - gas, solid.residualAlpha()));
|
|
||||||
const volScalarField cbrtR
|
|
||||||
(
|
|
||||||
cbrt(max(solid, solid.residualAlpha())/oneMinusGas)
|
|
||||||
);
|
|
||||||
|
|
||||||
return
|
|
||||||
E1_*gas.thermo().mu()*sqr(oneMinusGas/solid.d())*sqr(cbrtR)
|
|
||||||
/max(gas, gas.residualAlpha())
|
|
||||||
+ E2_*gas.rho()*mag(gas.U())*(1 - gas)/solid.d()*cbrtR;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::dragModels::AttouFerschneider::KLiquidSolid
|
|
||||||
(
|
|
||||||
const phaseModel& liquid,
|
|
||||||
const phaseModel& solid
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
const phaseModel& gas = liquid.fluid().phases()[gasName_];
|
|
||||||
|
|
||||||
return
|
|
||||||
E1_*liquid.thermo().mu()
|
|
||||||
*sqr(max(solid, solid.residualAlpha())/solid.d())
|
|
||||||
/max(liquid, liquid.residualAlpha())
|
|
||||||
+ E2_*liquid.rho()*mag(gas.U())*solid/solid.d();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::AttouFerschneider::AttouFerschneider
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
)
|
|
||||||
:
|
|
||||||
dragModel(dict, interface, registerObject),
|
|
||||||
interface_(interface),
|
|
||||||
gasName_(dict.lookup("gas")),
|
|
||||||
liquidName_(dict.lookup("liquid")),
|
|
||||||
solidName_(dict.lookup("solid")),
|
|
||||||
E1_("E1", dimless, dict),
|
|
||||||
E2_("E2", dimless, dict)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::AttouFerschneider::~AttouFerschneider()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::dragModels::AttouFerschneider::K() const
|
|
||||||
{
|
|
||||||
const phaseModel& gas = interface_.fluid().phases()[gasName_];
|
|
||||||
const phaseModel& liquid = interface_.fluid().phases()[liquidName_];
|
|
||||||
const phaseModel& solid = interface_.fluid().phases()[solidName_];
|
|
||||||
|
|
||||||
if (interface_.contains(gas) && interface_.contains(liquid))
|
|
||||||
{
|
|
||||||
return KGasLiquid(gas, liquid);
|
|
||||||
}
|
|
||||||
if (interface_.contains(gas) && interface_.contains(solid))
|
|
||||||
{
|
|
||||||
return KGasSolid(gas, solid);
|
|
||||||
}
|
|
||||||
if (interface_.contains(liquid) && interface_.contains(solid))
|
|
||||||
{
|
|
||||||
return KLiquidSolid(liquid, solid);
|
|
||||||
}
|
|
||||||
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "The interface " << interface_.name() << " does not contain two "
|
|
||||||
<< "out of the gas, liquid and solid phase models."
|
|
||||||
<< exit(FatalError);
|
|
||||||
|
|
||||||
return tmp<volScalarField>(nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::surfaceScalarField>
|
|
||||||
Foam::dragModels::AttouFerschneider::Kf() const
|
|
||||||
{
|
|
||||||
return fvc::interpolate(K());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,150 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2018-2022 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::dragModels::AttouFerschneider
|
|
||||||
|
|
||||||
Description
|
|
||||||
Attou and Ferschneider's Drag model for film flow through packed beds. The
|
|
||||||
implementation follows the description of Gunjal and Ranade, who, in the
|
|
||||||
reference below, formulate the model in more convenient terms.
|
|
||||||
|
|
||||||
Reference:
|
|
||||||
\verbatim
|
|
||||||
Gunjal, P. R., & Ranade, V. V. (2007).
|
|
||||||
Modeling of laboratory and commercial scale hydro-processing reactors
|
|
||||||
using CFD.
|
|
||||||
Chemical Engineering Science, 62(18-20), 5512-5526.
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
AttouFerschneider.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef AttouFerschneider_H
|
|
||||||
#define AttouFerschneider_H
|
|
||||||
|
|
||||||
#include "dragModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class AttouFerschneider Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class AttouFerschneider
|
|
||||||
:
|
|
||||||
public dragModel
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Interface
|
|
||||||
const phaseInterface interface_;
|
|
||||||
|
|
||||||
//- Name of the gaseous phase
|
|
||||||
const word gasName_;
|
|
||||||
|
|
||||||
//- Name of the liquidphase
|
|
||||||
const word liquidName_;
|
|
||||||
|
|
||||||
//- Name of the solid phase
|
|
||||||
const word solidName_;
|
|
||||||
|
|
||||||
//- Ergun constant 1
|
|
||||||
const dimensionedScalar E1_;
|
|
||||||
|
|
||||||
//- Ergun constant 2
|
|
||||||
const dimensionedScalar E2_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Return the momentum transfer coefficient between gas and liquid
|
|
||||||
virtual tmp<volScalarField> KGasLiquid
|
|
||||||
(
|
|
||||||
const phaseModel& gas,
|
|
||||||
const phaseModel& liquid
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the momentum transfer coefficient between gas and solid
|
|
||||||
virtual tmp<volScalarField> KGasSolid
|
|
||||||
(
|
|
||||||
const phaseModel& gas,
|
|
||||||
const phaseModel& solid
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the momentum transfer coefficient between liquid and solid
|
|
||||||
virtual tmp<volScalarField> KLiquidSolid
|
|
||||||
(
|
|
||||||
const phaseModel& liquid,
|
|
||||||
const phaseModel& solid
|
|
||||||
) const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("AttouFerschneider");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
AttouFerschneider
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~AttouFerschneider();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- The drag coefficient used in the momentum equation
|
|
||||||
virtual tmp<volScalarField> K() const;
|
|
||||||
|
|
||||||
//- The drag coefficient used in the face-momentum equations
|
|
||||||
virtual tmp<surfaceScalarField> Kf() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace dragModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,101 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2016-2022 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 "Beetstra.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(Beetstra, 0);
|
|
||||||
addToRunTimeSelectionTable(dragModel, Beetstra, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::Beetstra::Beetstra
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
)
|
|
||||||
:
|
|
||||||
dispersedDragModel(dict, interface, registerObject),
|
|
||||||
residualRe_("residualRe", dimless, dict.lookup("residualRe"))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::Beetstra::~Beetstra()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::dragModels::Beetstra::CdRe() const
|
|
||||||
{
|
|
||||||
const volScalarField alpha1
|
|
||||||
(
|
|
||||||
max(interface_.dispersed(), interface_.continuous().residualAlpha())
|
|
||||||
);
|
|
||||||
|
|
||||||
const volScalarField alpha2
|
|
||||||
(
|
|
||||||
max(1 - interface_.dispersed(), interface_.continuous().residualAlpha())
|
|
||||||
);
|
|
||||||
|
|
||||||
const volScalarField Res(alpha2*interface_.Re());
|
|
||||||
|
|
||||||
const volScalarField ResLim
|
|
||||||
(
|
|
||||||
"ReLim",
|
|
||||||
max(Res, residualRe_)
|
|
||||||
);
|
|
||||||
|
|
||||||
const volScalarField F0
|
|
||||||
(
|
|
||||||
"F0",
|
|
||||||
10*alpha1/sqr(alpha2) + sqr(alpha2)*(1 + 1.5*sqrt(alpha1))
|
|
||||||
);
|
|
||||||
|
|
||||||
const volScalarField F1
|
|
||||||
(
|
|
||||||
"F1",
|
|
||||||
0.413*Res/(24*sqr(alpha2))*(1.0/alpha2
|
|
||||||
+ 3*alpha1*alpha2 + 8.4*pow(ResLim, -0.343))
|
|
||||||
/(1 + pow(10.0, 3*alpha1)*pow(ResLim, -(1 + 4*alpha1)/2.0))
|
|
||||||
);
|
|
||||||
|
|
||||||
return 24*alpha2*(F0 + F1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,108 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2016-2022 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::dragModels::Beetstra
|
|
||||||
|
|
||||||
Description
|
|
||||||
Drag model of Beetstra et al. for monodisperse gas-particle flows obtained
|
|
||||||
with direct numerical simulations with the Lattice-Boltzmann method and
|
|
||||||
accounting for the effect of particle ensembles.
|
|
||||||
|
|
||||||
Reference:
|
|
||||||
\verbatim
|
|
||||||
Beetstra, R., van der Hoef, M. A., & Kuipers, J. a. M. (2007).
|
|
||||||
Drag force of intermediate Reynolds number flow past mono- and
|
|
||||||
bidisperse arrays of spheres.
|
|
||||||
AIChE Journal, 53(2), 489–501.
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
Beetstra.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef Beetstra_H
|
|
||||||
#define Beetstra_H
|
|
||||||
|
|
||||||
#include "dispersedDragModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class Beetstra Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class Beetstra
|
|
||||||
:
|
|
||||||
public dispersedDragModel
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Residual Reynolds Number
|
|
||||||
const dimensionedScalar residualRe_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("Beetstra");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
Beetstra
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~Beetstra();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Drag coefficient
|
|
||||||
virtual tmp<volScalarField> CdRe() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace dragModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,79 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2022 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 "Ergun.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(Ergun, 0);
|
|
||||||
addToRunTimeSelectionTable(dragModel, Ergun, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::Ergun::Ergun
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
)
|
|
||||||
:
|
|
||||||
dispersedDragModel(dict, interface, registerObject)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::Ergun::~Ergun()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::dragModels::Ergun::CdRe() const
|
|
||||||
{
|
|
||||||
const phaseModel& dispersed = interface_.dispersed();
|
|
||||||
const phaseModel& continuous = interface_.continuous();
|
|
||||||
|
|
||||||
return
|
|
||||||
(4.0/3.0)
|
|
||||||
*(
|
|
||||||
150
|
|
||||||
*max(1 - continuous, dispersed.residualAlpha())
|
|
||||||
/max(continuous, continuous.residualAlpha())
|
|
||||||
+ 1.75
|
|
||||||
*interface_.Re()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,98 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2022 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::dragModels::Ergun
|
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
Reference:
|
|
||||||
\verbatim
|
|
||||||
Enwald, H., Peirano, E., & Almstedt, A. E. (1996).
|
|
||||||
Eulerian two-phase flow theory applied to fluidisation.
|
|
||||||
International Journal of Multiphase Flow, 22, 21-66.
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
Ergun.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef Ergun_H
|
|
||||||
#define Ergun_H
|
|
||||||
|
|
||||||
#include "dispersedDragModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class Ergun Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class Ergun
|
|
||||||
:
|
|
||||||
public dispersedDragModel
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("Ergun");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
Ergun
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~Ergun();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Drag coefficient
|
|
||||||
virtual tmp<volScalarField> CdRe() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace dragModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2022 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 "Gibilaro.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(Gibilaro, 0);
|
|
||||||
addToRunTimeSelectionTable(dragModel, Gibilaro, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::Gibilaro::Gibilaro
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
)
|
|
||||||
:
|
|
||||||
dispersedDragModel(dict, interface, registerObject)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::Gibilaro::~Gibilaro()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::dragModels::Gibilaro::CdRe() const
|
|
||||||
{
|
|
||||||
const volScalarField alpha2
|
|
||||||
(
|
|
||||||
max(1 - interface_.dispersed(), interface_.continuous().residualAlpha())
|
|
||||||
);
|
|
||||||
|
|
||||||
return
|
|
||||||
(4.0/3.0)
|
|
||||||
*(17.3/alpha2 + 0.336*interface_.Re())
|
|
||||||
*max(interface_.continuous(), interface_.continuous().residualAlpha())
|
|
||||||
*pow(alpha2, -2.8);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,99 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2022 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::dragModels::Gibilaro
|
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
Reference:
|
|
||||||
\verbatim
|
|
||||||
Enwald, H., Peirano, E., & Almstedt, A. E. (1996).
|
|
||||||
Eulerian two-phase flow theory applied to fluidisation.
|
|
||||||
International Journal of Multiphase Flow, 22, 21-66.
|
|
||||||
Eq. 106, p. 43.
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
Gibilaro.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef Gibilaro_H
|
|
||||||
#define Gibilaro_H
|
|
||||||
|
|
||||||
#include "dispersedDragModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class Gibilaro Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class Gibilaro
|
|
||||||
:
|
|
||||||
public dispersedDragModel
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("Gibilaro");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
Gibilaro
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~Gibilaro();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Drag coefficient
|
|
||||||
virtual tmp<volScalarField> CdRe() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace dragModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,75 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2022 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 "GidaspowErgunWenYu.H"
|
|
||||||
#include "Ergun.H"
|
|
||||||
#include "WenYu.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(GidaspowErgunWenYu, 0);
|
|
||||||
addToRunTimeSelectionTable(dragModel, GidaspowErgunWenYu, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::GidaspowErgunWenYu::GidaspowErgunWenYu
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
)
|
|
||||||
:
|
|
||||||
dispersedDragModel(dict, interface, registerObject),
|
|
||||||
Ergun_(dict, interface, false),
|
|
||||||
WenYu_(dict, interface, false)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::GidaspowErgunWenYu::~GidaspowErgunWenYu()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::dragModels::GidaspowErgunWenYu::CdRe() const
|
|
||||||
{
|
|
||||||
return
|
|
||||||
pos0(interface_.continuous() - 0.8)*WenYu_.CdRe()
|
|
||||||
+ neg(interface_.continuous() - 0.8)*Ergun_.CdRe();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,111 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2022 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::dragModels::GidaspowErgunWenYu
|
|
||||||
|
|
||||||
Description
|
|
||||||
Gidaspow, Ergun, Wen and Yu drag model
|
|
||||||
|
|
||||||
Reference:
|
|
||||||
\verbatim
|
|
||||||
Gidaspow, D. (1994).
|
|
||||||
Multiphase flow and fluidisation: continuum and kinetic theory
|
|
||||||
descriptions.
|
|
||||||
Academic press, New York.
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
GidaspowErgunWenYu.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef GidaspowErgunWenYu_H
|
|
||||||
#define GidaspowErgunWenYu_H
|
|
||||||
|
|
||||||
#include "dispersedDragModel.H"
|
|
||||||
#include "Ergun.H"
|
|
||||||
#include "WenYu.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class GidaspowErgunWenYu Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class GidaspowErgunWenYu
|
|
||||||
:
|
|
||||||
public dispersedDragModel
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Ergun drag model
|
|
||||||
Ergun Ergun_;
|
|
||||||
|
|
||||||
//- Wen Yu drag model
|
|
||||||
WenYu WenYu_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("GidaspowErgunWenYu");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
GidaspowErgunWenYu
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~GidaspowErgunWenYu();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Drag coefficient
|
|
||||||
virtual tmp<volScalarField> CdRe() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace dragModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,86 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2022 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 "GidaspowSchillerNaumann.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(GidaspowSchillerNaumann, 0);
|
|
||||||
addToRunTimeSelectionTable(dragModel, GidaspowSchillerNaumann, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::GidaspowSchillerNaumann::GidaspowSchillerNaumann
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
)
|
|
||||||
:
|
|
||||||
dispersedDragModel(dict, interface, registerObject),
|
|
||||||
residualRe_("residualRe", dimless, dict)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::GidaspowSchillerNaumann::~GidaspowSchillerNaumann()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::dragModels::GidaspowSchillerNaumann::CdRe() const
|
|
||||||
{
|
|
||||||
const volScalarField alpha2
|
|
||||||
(
|
|
||||||
max(1 - interface_.dispersed(), interface_.continuous().residualAlpha())
|
|
||||||
);
|
|
||||||
|
|
||||||
const volScalarField Re(alpha2*interface_.Re());
|
|
||||||
|
|
||||||
const volScalarField CdsRe
|
|
||||||
(
|
|
||||||
neg(Re - 1000)*24*(1.0 + 0.15*pow(Re, 0.687))/alpha2
|
|
||||||
+ pos0(Re - 1000)*0.44*max(Re, residualRe_)
|
|
||||||
);
|
|
||||||
|
|
||||||
return
|
|
||||||
CdsRe
|
|
||||||
*pow(alpha2, -2.65)
|
|
||||||
*max(interface_.continuous(), interface_.continuous().residualAlpha());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,111 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2022 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::dragModels::GidaspowSchillerNaumann
|
|
||||||
|
|
||||||
Description
|
|
||||||
Gidaspow, Schiller and Naumann drag model
|
|
||||||
|
|
||||||
References:
|
|
||||||
\verbatim
|
|
||||||
Enwald, H., Peirano, E., & Almstedt, A. E. (1996).
|
|
||||||
Eulerian two-phase flow theory applied to fluidisation.
|
|
||||||
International Journal of Multiphase Flow, 22, 21-66.
|
|
||||||
|
|
||||||
This is identical to the Wen and Yu, Rowe model Table 3.6 p.56 in
|
|
||||||
van Wachem, B. G. M. (2000).
|
|
||||||
Derivation, implementation, and validation of computer simulation models
|
|
||||||
for gas-solid fluidised beds.
|
|
||||||
PhD Thesis, TU Delft.
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
GidaspowSchillerNaumann.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef GidaspowSchillerNaumann_H
|
|
||||||
#define GidaspowSchillerNaumann_H
|
|
||||||
|
|
||||||
#include "dispersedDragModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class GidaspowSchillerNaumann Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class GidaspowSchillerNaumann
|
|
||||||
:
|
|
||||||
public dispersedDragModel
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Residual Reynolds Number
|
|
||||||
const dimensionedScalar residualRe_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("GidaspowSchillerNaumann");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
GidaspowSchillerNaumann
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~GidaspowSchillerNaumann();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Drag coefficient
|
|
||||||
virtual tmp<volScalarField> CdRe() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace dragModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,99 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2014-2022 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 "IshiiZuber.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(IshiiZuber, 0);
|
|
||||||
addToRunTimeSelectionTable(dragModel, IshiiZuber, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::IshiiZuber::IshiiZuber
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
)
|
|
||||||
:
|
|
||||||
dispersedDragModel(dict, interface, registerObject)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::IshiiZuber::~IshiiZuber()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::dragModels::IshiiZuber::CdRe() const
|
|
||||||
{
|
|
||||||
const volScalarField Re(interface_.Re());
|
|
||||||
const volScalarField Eo(interface_.Eo());
|
|
||||||
|
|
||||||
const volScalarField mud(interface_.dispersed().thermo().mu());
|
|
||||||
const volScalarField muc(interface_.continuous().thermo().mu());
|
|
||||||
|
|
||||||
const volScalarField muStar((mud + 0.4*muc)/(mud + muc));
|
|
||||||
|
|
||||||
const volScalarField muMix
|
|
||||||
(
|
|
||||||
muc*pow(max(1 - interface_.dispersed(), scalar(1e-3)), -2.5*muStar)
|
|
||||||
);
|
|
||||||
|
|
||||||
const volScalarField ReM(Re*muc/muMix);
|
|
||||||
const volScalarField CdRe
|
|
||||||
(
|
|
||||||
pos0(1000 - ReM)*24*(1 + 0.1*pow(ReM, 0.75))
|
|
||||||
+ neg(1000 - ReM)*0.44*ReM
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField F((muc/muMix)*sqrt(1 - interface_.dispersed()));
|
|
||||||
F.max(1e-3);
|
|
||||||
|
|
||||||
const volScalarField Ealpha((1 + 17.67*pow(F, 0.8571428))/(18.67*F));
|
|
||||||
|
|
||||||
const volScalarField CdReEllipse(Ealpha*0.6666*sqrt(Eo)*Re);
|
|
||||||
|
|
||||||
return
|
|
||||||
pos0(CdReEllipse - CdRe)
|
|
||||||
*min(CdReEllipse, Re*sqr(1 - interface_.dispersed())*2.66667)
|
|
||||||
+ neg(CdReEllipse - CdRe)*CdRe;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,101 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2014-2022 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::dragModels::IshiiZuber
|
|
||||||
|
|
||||||
Description
|
|
||||||
Ishii and Zuber (1979) drag model for dense dispersed bubbly flows.
|
|
||||||
|
|
||||||
Reference:
|
|
||||||
\verbatim
|
|
||||||
Ishii, M., & Zuber, N. (1979).
|
|
||||||
Drag coefficient and relative velocity in bubbly, droplet or particulate
|
|
||||||
flows.
|
|
||||||
AIChE Journal, 25(5), 843-855.
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
IshiiZuber.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef IshiiZuber_H
|
|
||||||
#define IshiiZuber_H
|
|
||||||
|
|
||||||
#include "dispersedDragModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class IshiiZuber Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class IshiiZuber
|
|
||||||
:
|
|
||||||
public dispersedDragModel
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("IshiiZuber");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
IshiiZuber
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~IshiiZuber();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Drag coefficient
|
|
||||||
virtual tmp<volScalarField> CdRe() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace dragModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,74 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2014-2022 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 "Lain.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(Lain, 0);
|
|
||||||
addToRunTimeSelectionTable(dragModel, Lain, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::Lain::Lain
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
)
|
|
||||||
:
|
|
||||||
dispersedDragModel(dict, interface, registerObject)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::Lain::~Lain()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::dragModels::Lain::CdRe() const
|
|
||||||
{
|
|
||||||
volScalarField Re(interface_.Re());
|
|
||||||
|
|
||||||
return
|
|
||||||
neg(Re - 1.5)*16.0
|
|
||||||
+ pos0(Re - 1.5)*neg(Re - 80)*14.9*pow(Re, 0.22)
|
|
||||||
+ pos0(Re - 80)*neg(Re - 1500)*48*(1 - 2.21/sqrt(max(Re, small)))
|
|
||||||
+ pos0(Re - 1500)*2.61*Re;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,107 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2014-2022 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::dragModels::Lain
|
|
||||||
|
|
||||||
Description
|
|
||||||
Drag model of Lain et al.
|
|
||||||
|
|
||||||
References:
|
|
||||||
\verbatim
|
|
||||||
Otromke, M. (2013).
|
|
||||||
Implementation and Comparison of Correlations for interfacial Forces in
|
|
||||||
a Gas-Liquid System within an Euler-Euler Framework.
|
|
||||||
PhD Thesis.
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
Laın, S., Bröder, D., Sommerfeld, M., & Göz, M. F. (2002).
|
|
||||||
Modelling hydrodynamics and turbulence in a bubble column using the
|
|
||||||
Euler–Lagrange procedure.
|
|
||||||
International journal of multiphase flow, 28(8), 1381-1407.
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
Lain.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef Lain_H
|
|
||||||
#define Lain_H
|
|
||||||
|
|
||||||
#include "dispersedDragModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class Lain Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class Lain
|
|
||||||
:
|
|
||||||
public dispersedDragModel
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("Lain");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
Lain
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~Lain();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Drag coefficient
|
|
||||||
virtual tmp<volScalarField> CdRe() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace dragModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,73 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2022 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 "SchillerNaumann.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(SchillerNaumann, 0);
|
|
||||||
addToRunTimeSelectionTable(dragModel, SchillerNaumann, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::SchillerNaumann::SchillerNaumann
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
)
|
|
||||||
:
|
|
||||||
dispersedDragModel(dict, interface, registerObject),
|
|
||||||
residualRe_("residualRe", dimless, dict)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::SchillerNaumann::~SchillerNaumann()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::dragModels::SchillerNaumann::CdRe() const
|
|
||||||
{
|
|
||||||
volScalarField Re(interface_.Re());
|
|
||||||
|
|
||||||
return
|
|
||||||
neg(Re - 1000)*24*(1.0 + 0.15*pow(Re, 0.687))
|
|
||||||
+ pos0(Re - 1000)*0.44*max(Re, residualRe_);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,98 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2022 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::dragModels::SchillerNaumann
|
|
||||||
|
|
||||||
Description
|
|
||||||
Schiller and Naumann drag model for dispersed bubbly flows.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
SchillerNaumann.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef SchillerNaumann_H
|
|
||||||
#define SchillerNaumann_H
|
|
||||||
|
|
||||||
#include "dispersedDragModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class SchillerNaumann Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class SchillerNaumann
|
|
||||||
:
|
|
||||||
public dispersedDragModel
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Residual Reynolds Number
|
|
||||||
const dimensionedScalar residualRe_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("SchillerNaumann");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
SchillerNaumann
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~SchillerNaumann();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Drag coefficient
|
|
||||||
virtual tmp<volScalarField> CdRe() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace dragModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,92 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2022 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 "SyamlalOBrien.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(SyamlalOBrien, 0);
|
|
||||||
addToRunTimeSelectionTable(dragModel, SyamlalOBrien, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::SyamlalOBrien::SyamlalOBrien
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
)
|
|
||||||
:
|
|
||||||
dispersedDragModel(dict, interface, registerObject)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::SyamlalOBrien::~SyamlalOBrien()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::dragModels::SyamlalOBrien::CdRe() const
|
|
||||||
{
|
|
||||||
const volScalarField alpha2
|
|
||||||
(
|
|
||||||
max(1 - interface_.dispersed(), interface_.continuous().residualAlpha())
|
|
||||||
);
|
|
||||||
|
|
||||||
const volScalarField A(pow(alpha2, 4.14));
|
|
||||||
const volScalarField B
|
|
||||||
(
|
|
||||||
neg(alpha2 - 0.85)*(0.8*pow(alpha2, 1.28))
|
|
||||||
+ pos0(alpha2 - 0.85)*(pow(alpha2, 2.65))
|
|
||||||
);
|
|
||||||
const volScalarField Re(interface_.Re());
|
|
||||||
const volScalarField Vr
|
|
||||||
(
|
|
||||||
0.5
|
|
||||||
*(
|
|
||||||
A - 0.06*Re + sqrt(sqr(0.06*Re) + 0.12*Re*(2*B - A) + sqr(A))
|
|
||||||
)
|
|
||||||
);
|
|
||||||
volScalarField CdsRe(sqr(0.63*sqrt(Re) + 4.8*sqrt(Vr)));
|
|
||||||
|
|
||||||
return
|
|
||||||
CdsRe
|
|
||||||
*max(interface_.continuous(), interface_.continuous().residualAlpha())
|
|
||||||
/sqr(Vr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,99 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2022 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::dragModels::SyamlalOBrien
|
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
Reference:
|
|
||||||
\verbatim
|
|
||||||
Syamlal, M., Rogers, W., & O’Brien, T. J. (1993).
|
|
||||||
Mfix documentation: Theory guide, technical note, doe/metc-94/1004,
|
|
||||||
ntis/de94000087.
|
|
||||||
National Technical Information Service.
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
SyamlalOBrien.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef SyamlalOBrien_H
|
|
||||||
#define SyamlalOBrien_H
|
|
||||||
|
|
||||||
#include "dispersedDragModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class SyamlalOBrien Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class SyamlalOBrien
|
|
||||||
:
|
|
||||||
public dispersedDragModel
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("SyamlalOBrien");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
SyamlalOBrien
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~SyamlalOBrien();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Drag coefficient
|
|
||||||
virtual tmp<volScalarField> CdRe() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace dragModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,101 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2016-2022 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 "Tenneti.H"
|
|
||||||
#include "SchillerNaumann.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(Tenneti, 0);
|
|
||||||
addToRunTimeSelectionTable(dragModel, Tenneti, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::Tenneti::Tenneti
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
)
|
|
||||||
:
|
|
||||||
dispersedDragModel(dict, interface, registerObject),
|
|
||||||
residualRe_("residualRe", dimless, dict.lookup("residualRe"))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::Tenneti::~Tenneti()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::dragModels::Tenneti::CdRe() const
|
|
||||||
{
|
|
||||||
const volScalarField alpha1
|
|
||||||
(
|
|
||||||
max(interface_.dispersed(), interface_.continuous().residualAlpha())
|
|
||||||
);
|
|
||||||
|
|
||||||
const volScalarField alpha2
|
|
||||||
(
|
|
||||||
max(1 - interface_.dispersed(), interface_.continuous().residualAlpha())
|
|
||||||
);
|
|
||||||
|
|
||||||
const volScalarField Res(alpha2*interface_.Re());
|
|
||||||
|
|
||||||
const volScalarField CdReIsolated
|
|
||||||
(
|
|
||||||
neg(Res - 1000)*24*(1 + 0.15*pow(Res, 0.687))
|
|
||||||
+ pos0(Res - 1000)*0.44*max(Res, residualRe_)
|
|
||||||
);
|
|
||||||
|
|
||||||
const volScalarField F0
|
|
||||||
(
|
|
||||||
5.81*alpha1/pow3(alpha2) + 0.48*pow(alpha1, 1.0/3.0)/pow4(alpha2)
|
|
||||||
);
|
|
||||||
|
|
||||||
const volScalarField F1
|
|
||||||
(
|
|
||||||
pow3(alpha1)*Res*(0.95 + 0.61*pow3(alpha1)/sqr(alpha2))
|
|
||||||
);
|
|
||||||
|
|
||||||
// Tenneti et al. correlation includes the mean pressure drag.
|
|
||||||
// This was removed here by multiplying F by alpha2 for consistency with
|
|
||||||
// the formulation used in OpenFOAM
|
|
||||||
return CdReIsolated + 24*sqr(alpha2)*(F0 + F1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,110 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2016-2022 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::dragModels::Tenneti
|
|
||||||
|
|
||||||
Description
|
|
||||||
Drag model of Tenneti et al. for monodisperse gas-particle flows obtained
|
|
||||||
with particle-resolved direct numerical simulations and accounting for the
|
|
||||||
effect of particle ensembles.
|
|
||||||
|
|
||||||
Reference:
|
|
||||||
\verbatim
|
|
||||||
Tenneti, S., Garg, R., & Subramaniam, S. (2011).
|
|
||||||
Drag law for monodisperse gas–solid systems using particle-resolved
|
|
||||||
direct numerical simulation of flow past fixed assemblies of spheres.
|
|
||||||
International Journal of Multiphase Flow, 37(9), 1072–1092.
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
Tenneti.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef Tenneti_H
|
|
||||||
#define Tenneti_H
|
|
||||||
|
|
||||||
#include "dispersedDragModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
|
|
||||||
class SchillerNaumann;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class Tenneti Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class Tenneti
|
|
||||||
:
|
|
||||||
public dispersedDragModel
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Residual Reynolds Number
|
|
||||||
const dimensionedScalar residualRe_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("Tenneti");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from a dictionary and an interface
|
|
||||||
Tenneti
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~Tenneti();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Drag coefficient
|
|
||||||
virtual tmp<volScalarField> CdRe() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace dragModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,90 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2014-2022 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 "TomiyamaAnalytic.H"
|
|
||||||
#include "aspectRatioModel.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace dragModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(TomiyamaAnalytic, 0);
|
|
||||||
addToRunTimeSelectionTable(dragModel, TomiyamaAnalytic, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::TomiyamaAnalytic::TomiyamaAnalytic
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const phaseInterface& interface,
|
|
||||||
const bool registerObject
|
|
||||||
)
|
|
||||||
:
|
|
||||||
dispersedDragModel(dict, interface, registerObject),
|
|
||||||
residualRe_("residualRe", dimless, dict),
|
|
||||||
residualEo_("residualEo", dimless, dict),
|
|
||||||
residualE_("residualE", dimless, dict),
|
|
||||||
aspectRatio_(aspectRatioModel::New(dict.subDict("aspectRatio"), interface))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dragModels::TomiyamaAnalytic::~TomiyamaAnalytic()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::dragModels::TomiyamaAnalytic::CdRe() const
|
|
||||||
{
|
|
||||||
const volScalarField Eo(max(interface_.Eo(), residualEo_));
|
|
||||||
const volScalarField E(max(aspectRatio_->E(), residualE_));
|
|
||||||
|
|
||||||
const volScalarField OmEsq(max(1 - sqr(E), sqr(residualE_)));
|
|
||||||
const volScalarField rtOmEsq(sqrt(OmEsq));
|
|
||||||
|
|
||||||
const volScalarField F(max(asin(rtOmEsq) - E*rtOmEsq, residualE_)/OmEsq);
|
|
||||||
|
|
||||||
return
|
|
||||||
(8.0/3.0)
|
|
||||||
*Eo
|
|
||||||
/(
|
|
||||||
Eo*pow(E, 2.0/3.0)/OmEsq
|
|
||||||
+ 16*pow(E, 4.0/3.0)
|
|
||||||
)
|
|
||||||
/sqr(F)
|
|
||||||
*max(interface_.Re(), residualRe_);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user