mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: centralize more libraries in src/phaseSystemModels
- prelude to code refactoring
NOTE
no source code change in this commit, only relocation,
renaming and adjustment of Make/{files,options}
This commit is contained in:
committed by
Sergio Ferraris
parent
42ce617b43
commit
03526e2097
@ -1,14 +1,21 @@
|
||||
incompressibleTurbulenceModel.C
|
||||
|
||||
turbulentTransportModels/turbulentTransportModels.C
|
||||
turbulentTransportModels/RAS/qZeta/qZeta.C
|
||||
turbulentTransportModels/RAS/kkLOmega/kkLOmega.C
|
||||
turbulentTransportModels/RAS/LamBremhorstKE/LamBremhorstKE.C
|
||||
turbulentTransportModels/RAS/LienLeschziner/LienLeschziner.C
|
||||
turbulentTransportModels/RAS/ShihQuadraticKE/ShihQuadraticKE.C
|
||||
turbulentTransportModels/RAS/LienCubicKE/LienCubicKE.C
|
||||
|
||||
BCs = turbulentTransportModels/RAS/derivedFvPatchFields
|
||||
turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C
|
||||
|
||||
RASModels = turbulentTransportModels/RAS
|
||||
|
||||
$(RASModels)/qZeta/qZeta.C
|
||||
$(RASModels)/kkLOmega/kkLOmega.C
|
||||
$(RASModels)/LamBremhorstKE/LamBremhorstKE.C
|
||||
$(RASModels)/LienLeschziner/LienLeschziner.C
|
||||
$(RASModels)/ShihQuadraticKE/ShihQuadraticKE.C
|
||||
$(RASModels)/LienCubicKE/LienCubicKE.C
|
||||
|
||||
|
||||
wallFunctions = turbulentTransportModels/derivedFvPatchFields/wallFunctions
|
||||
|
||||
$(wallFunctions)/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C
|
||||
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libincompressibleTurbulenceModels
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
DEShybrid/DEShybrid.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libturbulenceModelSchemes
|
||||
LIB = $(FOAM_LIBBIN)/libturbulenceModelSchemes
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/OpenFOAM/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/fileFormats/lnInclude \
|
||||
-I$(LIB_SRC)/surfMesh/lnInclude \
|
||||
@ -19,11 +18,9 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/fvAgglomerationMethods/pairPatchAgglomeration/lnInclude \
|
||||
-I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/phaseSystems/lnInclude
|
||||
-I$(LIB_SRC)/fvAgglomerationMethods/pairPatchAgglomeration/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lOpenFOAM \
|
||||
-lfiniteVolume \
|
||||
-lfileFormats \
|
||||
-lsurfMesh \
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
|
||||
wclean libso reactingEulerFoam/phaseSystems
|
||||
wclean libso reactingEulerFoam/interfacialModels
|
||||
wclean libso reactingEulerFoam/interfacialCompositionModels
|
||||
wclean libso reactingEulerFoam/derivedFvPatchFields
|
||||
|
||||
wclean libso reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem
|
||||
wclean libso reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels
|
||||
|
||||
wclean libso reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem
|
||||
wclean libso reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels
|
||||
wclean libso reactingEulerFoam/functionObjects
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -1,32 +1,11 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmakeLnInclude reactingEulerFoam/phaseSystems
|
||||
|
||||
case "$WM_COMPILER" in
|
||||
Mingw*)
|
||||
echo "Skipping $WM_COMPILER compilation of $PWD"
|
||||
echo "... needs further resolution of cyclic dependencies"
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType reactingEulerFoam/interfacialModels
|
||||
wmake $targetType reactingEulerFoam/interfacialCompositionModels
|
||||
wmake $targetType reactingEulerFoam/derivedFvPatchFields
|
||||
|
||||
wmake $targetType reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem
|
||||
wmake $targetType reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels
|
||||
|
||||
wmake $targetType reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem
|
||||
wmake $targetType reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels
|
||||
|
||||
wmake $targetType reactingEulerFoam/phaseSystems
|
||||
wmake $targetType reactingEulerFoam/functionObjects
|
||||
multiphaseInter/Allwmake $targetType $*
|
||||
multiphaseEuler/Allwmake $targetType $*
|
||||
reactingEuler/Allwmake $targetType $*
|
||||
twoPhaseEuler/Allwmake $targetType $*
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
8
src/phaseSystemModels/multiphaseEuler/Allwclean
Executable file
8
src/phaseSystemModels/multiphaseEuler/Allwclean
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wclean libso interfacialModels
|
||||
wclean libso multiphaseSystem
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
10
src/phaseSystemModels/multiphaseEuler/Allwmake
Executable file
10
src/phaseSystemModels/multiphaseEuler/Allwmake
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmakeLnInclude multiphaseSystem
|
||||
wmake $targetType interfacialModels
|
||||
wmake $targetType multiphaseSystem
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -0,0 +1,19 @@
|
||||
drag = dragModels
|
||||
$(drag)/dragModel/dragModel.C
|
||||
$(drag)/dragModel/dragModelNew.C
|
||||
$(drag)/Ergun/Ergun.C
|
||||
$(drag)/GidaspowErgunWenYu/GidaspowErgunWenYu.C
|
||||
$(drag)/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C
|
||||
$(drag)/SchillerNaumann/SchillerNaumann.C
|
||||
$(drag)/Gibilaro/Gibilaro.C
|
||||
$(drag)/WenYu/WenYu.C
|
||||
$(drag)/SyamlalOBrien/SyamlalOBrien.C
|
||||
$(drag)/blended/blended.C
|
||||
$(drag)/interface/interface.C
|
||||
|
||||
heatTransfer = heatTransferModels
|
||||
$(heatTransfer)/heatTransferModel/heatTransferModel.C
|
||||
$(heatTransfer)/heatTransferModel/heatTransferModelNew.C
|
||||
$(heatTransfer)/RanzMarshall/RanzMarshall.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libcompressibleMultiphaseEulerianInterfacialModels
|
||||
@ -0,0 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I../multiphaseSystem/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmultiphaseSystem
|
||||
@ -0,0 +1,84 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
)
|
||||
:
|
||||
dragModel(interfaceDict, phase1, phase2)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::dragModels::Ergun::~Ergun()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::dragModels::Ergun::K
|
||||
(
|
||||
const volScalarField& Ur
|
||||
) const
|
||||
{
|
||||
volScalarField alpha2(max(phase2_, scalar(1.0e-6)));
|
||||
|
||||
return
|
||||
150.0*phase1_*phase2_.nu()*phase2_.rho()
|
||||
/sqr(alpha2*phase1_.d())
|
||||
+ 1.75*phase2_.rho()*Ur/(alpha2*phase1_.d());
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,97 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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
|
||||
H, Enwald, E. Peirano, A-E Almstedt
|
||||
'Eulerian Two-Phase Flow Theory Applied to Fluidization'
|
||||
Int. J. Multiphase Flow, Vol. 22, Suppl, pp. 21-66 (1996)
|
||||
Eq. 104, p. 42
|
||||
|
||||
SourceFiles
|
||||
Ergun.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Ergun_H
|
||||
#define Ergun_H
|
||||
|
||||
#include "dragModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace dragModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class Ergun Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class Ergun
|
||||
:
|
||||
public dragModel
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("Ergun");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
Ergun
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~Ergun();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
tmp<volScalarField> K(const volScalarField& Ur) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace dragModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,83 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
)
|
||||
:
|
||||
dragModel(interfaceDict, phase1, phase2)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::dragModels::Gibilaro::~Gibilaro()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::dragModels::Gibilaro::K
|
||||
(
|
||||
const volScalarField& Ur
|
||||
) const
|
||||
{
|
||||
volScalarField alpha2(max(phase2_, scalar(1.0e-6)));
|
||||
volScalarField bp(pow(alpha2, -2.8));
|
||||
volScalarField Re(max(alpha2*Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3)));
|
||||
|
||||
return (17.3/Re + scalar(0.336))*phase2_.rho()*Ur*bp/phase1_.d();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,97 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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
|
||||
H, Enwald, E. Peirano, A-E Almstedt
|
||||
'Eulerian Two-Phase Flow Theory Applied to Fluidization'
|
||||
Int. J. Multiphase Flow, Vol. 22, Suppl, pp. 21-66 (1996)
|
||||
Eq. 106, p. 43
|
||||
|
||||
SourceFiles
|
||||
Gibilaro.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Gibilaro_H
|
||||
#define Gibilaro_H
|
||||
|
||||
#include "dragModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace dragModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class Gibilaro Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class Gibilaro
|
||||
:
|
||||
public dragModel
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("Gibilaro");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
Gibilaro
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~Gibilaro();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
tmp<volScalarField> K(const volScalarField& Ur) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace dragModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,100 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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 "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace dragModels
|
||||
{
|
||||
defineTypeNameAndDebug(GidaspowErgunWenYu, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
dragModel,
|
||||
GidaspowErgunWenYu,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::dragModels::GidaspowErgunWenYu::GidaspowErgunWenYu
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
)
|
||||
:
|
||||
dragModel(interfaceDict, phase1, phase2)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::dragModels::GidaspowErgunWenYu::~GidaspowErgunWenYu()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::dragModels::GidaspowErgunWenYu::K
|
||||
(
|
||||
const volScalarField& Ur
|
||||
) const
|
||||
{
|
||||
volScalarField alpha2(max(phase2_, scalar(1.0e-6)));
|
||||
volScalarField d(phase1_.d());
|
||||
volScalarField bp(pow(alpha2, -2.65));
|
||||
volScalarField Re(max(Ur*d/phase2_.nu(), scalar(1.0e-3)));
|
||||
|
||||
volScalarField Cds
|
||||
(
|
||||
neg(Re - 1000)*(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re)
|
||||
+ pos0(Re - 1000)*0.44
|
||||
);
|
||||
|
||||
// Wen and Yu (1966)
|
||||
return
|
||||
(
|
||||
pos0(alpha2 - 0.8)
|
||||
*(0.75*Cds*phase2_.rho()*Ur*bp/d)
|
||||
+ neg(alpha2 - 0.8)
|
||||
*(
|
||||
150.0*phase1_*phase2_.nu()*phase2_.rho()/(sqr(alpha2*d))
|
||||
+ 1.75*phase2_.rho()*Ur/(alpha2*d)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,95 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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
|
||||
D. Gidaspow, Multiphase flow and fluidization,
|
||||
Academic Press, New York, 1994.
|
||||
|
||||
SourceFiles
|
||||
GidaspowErgunWenYu.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef GidaspowErgunWenYu_H
|
||||
#define GidaspowErgunWenYu_H
|
||||
|
||||
#include "dragModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace dragModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class GidaspowErgunWenYu Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class GidaspowErgunWenYu
|
||||
:
|
||||
public dragModel
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("GidaspowErgunWenYu");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
GidaspowErgunWenYu
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~GidaspowErgunWenYu();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
tmp<volScalarField> K(const volScalarField& Ur) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace dragModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,89 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
)
|
||||
:
|
||||
dragModel(interfaceDict, phase1, phase2)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::dragModels::GidaspowSchillerNaumann::~GidaspowSchillerNaumann()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::dragModels::GidaspowSchillerNaumann::K
|
||||
(
|
||||
const volScalarField& Ur
|
||||
) const
|
||||
{
|
||||
volScalarField alpha2(max(phase2_, scalar(1e-6)));
|
||||
volScalarField bp(pow(alpha2, -2.65));
|
||||
|
||||
volScalarField Re(max(alpha2*Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3)));
|
||||
volScalarField Cds
|
||||
(
|
||||
neg(Re - 1000)*(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re)
|
||||
+ pos0(Re - 1000)*0.44
|
||||
);
|
||||
|
||||
return 0.75*Cds*phase2_.rho()*Ur*bp/phase1_.d();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,104 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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
|
||||
H, Enwald, E. Peirano, A-E Almstedt
|
||||
'Eulerian Two-Phase Flow Theory Applied to Fluidization'
|
||||
Int. J. Multiphase Flow, Vol. 22, Suppl, pp. 21-66 (1996)
|
||||
Eq. 86-87, p. 40
|
||||
|
||||
This is identical to the Wen and Yu, Rowe model Table 3.6 p.56 in
|
||||
the Ph.D. thesis of Berend van Wachem
|
||||
'Derivation, Implementation and Validation
|
||||
of
|
||||
Computer Simulation Models
|
||||
for Gas-Solid Fluidized Beds'
|
||||
|
||||
SourceFiles
|
||||
GidaspowSchillerNaumann.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef GidaspowSchillerNaumann_H
|
||||
#define GidaspowSchillerNaumann_H
|
||||
|
||||
#include "dragModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace dragModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class GidaspowSchillerNaumann Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class GidaspowSchillerNaumann
|
||||
:
|
||||
public dragModel
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("GidaspowSchillerNaumann");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
GidaspowSchillerNaumann
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~GidaspowSchillerNaumann();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
tmp<volScalarField> K(const volScalarField& Ur) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace dragModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,86 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
)
|
||||
:
|
||||
dragModel(interfaceDict, phase1, phase2)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::dragModels::SchillerNaumann::~SchillerNaumann()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::dragModels::SchillerNaumann::K
|
||||
(
|
||||
const volScalarField& Ur
|
||||
) const
|
||||
{
|
||||
volScalarField Re(max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3)));
|
||||
volScalarField Cds
|
||||
(
|
||||
neg(Re - 1000)*(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re)
|
||||
+ pos0(Re - 1000)*0.44
|
||||
);
|
||||
|
||||
return 0.75*Cds*phase2_.rho()*Ur/phase1_.d();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,93 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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
|
||||
|
||||
SourceFiles
|
||||
SchillerNaumann.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef SchillerNaumann_H
|
||||
#define SchillerNaumann_H
|
||||
|
||||
#include "dragModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace dragModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class SchillerNaumann Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class SchillerNaumann
|
||||
:
|
||||
public dragModel
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("SchillerNaumann");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
SchillerNaumann
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~SchillerNaumann();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
tmp<volScalarField> K(const volScalarField& Ur) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace dragModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,99 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
)
|
||||
:
|
||||
dragModel(interfaceDict, phase1, phase2)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::dragModels::SyamlalOBrien::~SyamlalOBrien()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::dragModels::SyamlalOBrien::K
|
||||
(
|
||||
const volScalarField& Ur
|
||||
) const
|
||||
{
|
||||
volScalarField alpha2(max(phase2_, scalar(1.0e-6)));
|
||||
volScalarField A(pow(alpha2, 4.14));
|
||||
volScalarField B
|
||||
(
|
||||
neg(alpha2 - 0.85)*(0.8*pow(alpha2, 1.28))
|
||||
+ pos0(alpha2 - 0.85)*(pow(alpha2, 2.65))
|
||||
);
|
||||
|
||||
volScalarField Re(max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3)));
|
||||
|
||||
volScalarField Vr
|
||||
(
|
||||
0.5*
|
||||
(
|
||||
A - 0.06*Re + sqrt(sqr(0.06*Re) + 0.12*Re*(2.0*B - A) + sqr(A))
|
||||
)
|
||||
);
|
||||
|
||||
volScalarField Cds(sqr(0.63 + 4.8*sqrt(Vr/Re)));
|
||||
|
||||
return 0.75*Cds*phase2_.rho()*Ur/(phase1_.d()*sqr(Vr));
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,96 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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
|
||||
Syamlal, M., Rogers, W. and O'Brien, T. J. (1993) MFIX documentation,
|
||||
Theory Guide. Technical Note DOE/METC-94/1004. Morgantown, West Virginia,
|
||||
USA.
|
||||
|
||||
SourceFiles
|
||||
SyamlalOBrien.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef SyamlalOBrien_H
|
||||
#define SyamlalOBrien_H
|
||||
|
||||
#include "dragModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace dragModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class SyamlalOBrien Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class SyamlalOBrien
|
||||
:
|
||||
public dragModel
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("SyamlalOBrien");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
SyamlalOBrien
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~SyamlalOBrien();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
tmp<volScalarField> K(const volScalarField& Ur) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace dragModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,89 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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 "WenYu.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace dragModels
|
||||
{
|
||||
defineTypeNameAndDebug(WenYu, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
dragModel,
|
||||
WenYu,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::dragModels::WenYu::WenYu
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
)
|
||||
:
|
||||
dragModel(interfaceDict, phase1, phase2)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::dragModels::WenYu::~WenYu()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::dragModels::WenYu::K
|
||||
(
|
||||
const volScalarField& Ur
|
||||
) const
|
||||
{
|
||||
volScalarField alpha2(max(phase2_, scalar(1.0e-6)));
|
||||
volScalarField bp(pow(alpha2, -2.65));
|
||||
|
||||
volScalarField Re(max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3)));
|
||||
volScalarField Cds
|
||||
(
|
||||
neg(Re - 1000)*(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re)
|
||||
+ pos0(Re - 1000)*0.44
|
||||
);
|
||||
|
||||
return 0.75*Cds*phase2_.rho()*Ur*bp/phase1_.d();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,107 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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::WenYu
|
||||
|
||||
Description
|
||||
H, Enwald, E. Peirano, A-E Almstedt
|
||||
'Eulerian Two-Phase Flow Theory Applied to Fluidization'
|
||||
Int. J. Multiphase Flow, Vol. 22, Suppl, pp. 21-66 (1996)
|
||||
Eq. 86-87, p. 40
|
||||
|
||||
This is identical to the Wen and Yu, Rowe model Table 3.6 p.56 in
|
||||
the Ph.D. thesis of Berend van Wachem
|
||||
'Derivation, Implementation and Validation
|
||||
of
|
||||
Computer Simulation Models
|
||||
for Gas-Solid Fluidized Beds'
|
||||
|
||||
NB: The difference between the Gidaspow-version is the void-fraction
|
||||
in the Re-number
|
||||
|
||||
SourceFiles
|
||||
WenYu.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef WenYu_H
|
||||
#define WenYu_H
|
||||
|
||||
#include "dragModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace dragModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class WenYu Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class WenYu
|
||||
:
|
||||
public dragModel
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("WenYu");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
WenYu
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~WenYu();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
tmp<volScalarField> K(const volScalarField& Ur) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace dragModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,81 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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 "blended.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace dragModels
|
||||
{
|
||||
defineTypeNameAndDebug(blended, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
dragModel,
|
||||
blended,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::dragModels::blended::blended
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
)
|
||||
:
|
||||
dragModel(interfaceDict, phase1, phase2),
|
||||
dragModel1_(New(interfaceDict.subDict(phase1.name()), phase1, phase2)),
|
||||
dragModel2_(New(interfaceDict.subDict(phase2.name()), phase2, phase1))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::dragModels::blended::~blended()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::dragModels::blended::K
|
||||
(
|
||||
const volScalarField& Ur
|
||||
) const
|
||||
{
|
||||
return phase2()*dragModel1_->K(Ur) + phase1()*dragModel2_->K(Ur);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,101 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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::blended
|
||||
|
||||
Description
|
||||
Blends two drag models based on the phase fractions to handle
|
||||
phase-inversion.
|
||||
|
||||
SourceFiles
|
||||
blended.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef blended_H
|
||||
#define blended_H
|
||||
|
||||
#include "dragModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace dragModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class blended Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class blended
|
||||
:
|
||||
public dragModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
// The two drag models to be blended
|
||||
autoPtr<dragModel> dragModel1_;
|
||||
autoPtr<dragModel> dragModel2_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("blended");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
blended
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~blended();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
tmp<volScalarField> K(const volScalarField& Ur) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace dragModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,62 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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 "dragModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(dragModel, 0);
|
||||
defineRunTimeSelectionTable(dragModel, dictionary);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::dragModel::dragModel
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
)
|
||||
:
|
||||
interfaceDict_(interfaceDict),
|
||||
phase1_(phase1),
|
||||
phase2_(phase2),
|
||||
residualPhaseFraction_("residualPhaseFraction", dimless, interfaceDict),
|
||||
residualSlip_("residualSlip", dimVelocity, interfaceDict)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::dragModel::~dragModel()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,154 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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::dragModel
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
dragModel.C
|
||||
newDragModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef dragModel_H
|
||||
#define dragModel_H
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "dictionary.H"
|
||||
#include "phaseModel.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class dragModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class dragModel
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
const dictionary& interfaceDict_;
|
||||
const phaseModel& phase1_;
|
||||
const phaseModel& phase2_;
|
||||
dimensionedScalar residualPhaseFraction_;
|
||||
dimensionedScalar residualSlip_;
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("dragModel");
|
||||
|
||||
|
||||
// Declare runtime construction
|
||||
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
dragModel,
|
||||
dictionary,
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
),
|
||||
(interfaceDict, phase1, phase2)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
dragModel
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~dragModel();
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
static autoPtr<dragModel> New
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
const phaseModel& phase1() const
|
||||
{
|
||||
return phase1_;
|
||||
}
|
||||
|
||||
const phaseModel& phase2() const
|
||||
{
|
||||
return phase2_;
|
||||
}
|
||||
|
||||
const dimensionedScalar& residualPhaseFraction() const
|
||||
{
|
||||
return residualPhaseFraction_;
|
||||
}
|
||||
|
||||
const dimensionedScalar& residualSlip() const
|
||||
{
|
||||
return residualSlip_;
|
||||
}
|
||||
|
||||
//- The drag function K used in the momentum eq.
|
||||
// ddt(alpha1*rho1*U1) + ... = ... alpha1*alpha2*K*(U1-U2)
|
||||
// ddt(alpha2*rho2*U2) + ... = ... alpha1*alpha2*K*(U2-U1)
|
||||
// ********************************** NB! *****************************
|
||||
// for numerical reasons alpha1 and alpha2 has been
|
||||
// extracted from the dragFunction K,
|
||||
// so you MUST divide K by alpha1*alpha2 when implementing the drag
|
||||
// function
|
||||
// ********************************** NB! *****************************
|
||||
virtual tmp<volScalarField> K(const volScalarField& Ur) const = 0;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,64 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "dragModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::dragModel> Foam::dragModel::New
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
)
|
||||
{
|
||||
const word modelType(interfaceDict.get<word>("type"));
|
||||
|
||||
Info << "Selecting dragModel for phase "
|
||||
<< phase1.name()
|
||||
<< ": "
|
||||
<< modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
interfaceDict,
|
||||
"dragModel",
|
||||
modelType,
|
||||
*dictionaryConstructorTablePtr_
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()(interfaceDict, phase1, phase2);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,92 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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 "interface.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace dragModels
|
||||
{
|
||||
defineTypeNameAndDebug(interface, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
dragModel,
|
||||
interface,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::dragModels::interface::interface
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
)
|
||||
:
|
||||
dragModel(interfaceDict, phase1, phase2)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::dragModels::interface::~interface()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::dragModels::interface::K
|
||||
(
|
||||
const volScalarField& Ur
|
||||
) const
|
||||
{
|
||||
return tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"K",
|
||||
Ur.mesh().time().timeName(),
|
||||
Ur.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
Ur.mesh(),
|
||||
dimensionedScalar(dimDensity/dimTime, Zero)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,94 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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::interface
|
||||
|
||||
Description
|
||||
Drag between phase separated by a VoF resolved interface.
|
||||
|
||||
SourceFiles
|
||||
interface.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef interface_H
|
||||
#define interface_H
|
||||
|
||||
#include "dragModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace dragModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class interface Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class interface
|
||||
:
|
||||
public dragModel
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("interface");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
interface
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~interface();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
tmp<volScalarField> K(const volScalarField& Ur) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace dragModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,85 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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 "RanzMarshall.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace heatTransferModels
|
||||
{
|
||||
defineTypeNameAndDebug(RanzMarshall, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
heatTransferModel,
|
||||
RanzMarshall,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::heatTransferModels::RanzMarshall::RanzMarshall
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
)
|
||||
:
|
||||
heatTransferModel(interfaceDict, alpha1, phase1, phase2)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::heatTransferModels::RanzMarshall::~RanzMarshall()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::heatTransferModels::RanzMarshall::K
|
||||
(
|
||||
const volScalarField& Ur
|
||||
) const
|
||||
{
|
||||
volScalarField Re(max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3)));
|
||||
dimensionedScalar Prb =
|
||||
phase2_.rho()*phase2_.nu()*phase2_.Cp()/phase2_.kappa();
|
||||
volScalarField Nu(scalar(2) + 0.6*sqrt(Re)*cbrt(Prb));
|
||||
|
||||
return 6.0*phase2_.kappa()*Nu/sqr(phase1_.d());
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,94 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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::heatTransferModels::RanzMarshall
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
RanzMarshall.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef RanzMarshall_H
|
||||
#define RanzMarshall_H
|
||||
|
||||
#include "heatTransferModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace heatTransferModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class RanzMarshall Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class RanzMarshall
|
||||
:
|
||||
public heatTransferModel
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("RanzMarshall");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
RanzMarshall
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~RanzMarshall();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
tmp<volScalarField> K(const volScalarField& Ur) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace heatTransferModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,62 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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 "heatTransferModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(heatTransferModel, 0);
|
||||
defineRunTimeSelectionTable(heatTransferModel, dictionary);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::heatTransferModel::heatTransferModel
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
)
|
||||
:
|
||||
interfaceDict_(interfaceDict),
|
||||
alpha1_(alpha1),
|
||||
phase1_(phase1),
|
||||
phase2_(phase2)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::heatTransferModel::~heatTransferModel()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,137 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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::heatTransferModel
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
heatTransferModel.C
|
||||
newHeatTransferModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef heatTransferModel_H
|
||||
#define heatTransferModel_H
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "dictionary.H"
|
||||
#include "phaseModel.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class heatTransferModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class heatTransferModel
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
const dictionary& interfaceDict_;
|
||||
const volScalarField& alpha1_;
|
||||
const phaseModel& phase1_;
|
||||
const phaseModel& phase2_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("heatTransferModel");
|
||||
|
||||
|
||||
// Declare runtime construction
|
||||
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
heatTransferModel,
|
||||
dictionary,
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
),
|
||||
(interfaceDict, alpha1, phase1, phase2)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
heatTransferModel
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~heatTransferModel();
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
static autoPtr<heatTransferModel> New
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- The heat-transfer function K used in the enthalpy eq.
|
||||
// ddt(alpha1*rho1*ha) + ... = ... alpha1*alpha2*K*(Ta - Tb)
|
||||
// ddt(alpha2*rho2*hb) + ... = ... alpha1*alpha2*K*(Tb - Ta)
|
||||
// ********************************** NB! *****************************
|
||||
// for numerical reasons alpha1 and alpha2 has been
|
||||
// extracted from the heat-transfer function K,
|
||||
// so you MUST divide K by alpha1*alpha2 when implementing the
|
||||
// heat-transfer function
|
||||
// ********************************** NB! *****************************
|
||||
virtual tmp<volScalarField> K(const volScalarField& Ur) const = 0;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,68 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "heatTransferModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New
|
||||
(
|
||||
const dictionary& interfaceDict,
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
)
|
||||
{
|
||||
const word modelType
|
||||
(
|
||||
interfaceDict.get<word>("heatTransferModel" + phase1.name())
|
||||
);
|
||||
|
||||
Info<< "Selecting heatTransferModel for phase "
|
||||
<< phase1.name()
|
||||
<< ": "
|
||||
<< modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
interfaceDict,
|
||||
"heatTransferModel",
|
||||
modelType,
|
||||
*dictionaryConstructorTablePtr_
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()(interfaceDict, alpha1, phase1, phase2);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,15 @@
|
||||
phaseModel/phaseModel.C
|
||||
|
||||
multiphaseSystem/multiphaseSystem.C
|
||||
|
||||
diameter = diameterModels
|
||||
|
||||
$(diameter)/diameterModel/diameterModel.C
|
||||
$(diameter)/diameterModel/diameterModelNew.C
|
||||
$(diameter)/constantDiameter/constantDiameter.C
|
||||
$(diameter)/isothermalDiameter/isothermalDiameter.C
|
||||
|
||||
alphaContactAngle/alphaContactAngleFvPatchScalarField.C
|
||||
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libmultiphaseSystem
|
||||
@ -0,0 +1,15 @@
|
||||
EXE_INC = \
|
||||
-I../phaseModel/lnInclude \
|
||||
-I../interfacialModels/lnInclude \
|
||||
-IalphaContactAngle \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-linterfaceProperties \
|
||||
-lincompressibleTransportModels
|
||||
@ -0,0 +1,147 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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 "alphaContactAngleFvPatchScalarField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvPatchFieldMapper.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
alphaContactAngleFvPatchScalarField::interfaceThetaProps::interfaceThetaProps
|
||||
(
|
||||
Istream& is
|
||||
)
|
||||
:
|
||||
theta0_(readScalar(is)),
|
||||
uTheta_(readScalar(is)),
|
||||
thetaA_(readScalar(is)),
|
||||
thetaR_(readScalar(is))
|
||||
{}
|
||||
|
||||
|
||||
Istream& operator>>
|
||||
(
|
||||
Istream& is,
|
||||
alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp
|
||||
)
|
||||
{
|
||||
is >> tp.theta0_ >> tp.uTheta_ >> tp.thetaA_ >> tp.thetaR_;
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
Ostream& operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp
|
||||
)
|
||||
{
|
||||
os << tp.theta0_ << token::SPACE
|
||||
<< tp.uTheta_ << token::SPACE
|
||||
<< tp.thetaA_ << token::SPACE
|
||||
<< tp.thetaR_;
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
zeroGradientFvPatchScalarField(p, iF)
|
||||
{}
|
||||
|
||||
|
||||
alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const alphaContactAngleFvPatchScalarField& gcpsf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
zeroGradientFvPatchScalarField(gcpsf, p, iF, mapper),
|
||||
thetaProps_(gcpsf.thetaProps_)
|
||||
{}
|
||||
|
||||
|
||||
alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
zeroGradientFvPatchScalarField(p, iF),
|
||||
thetaProps_(dict.lookup("thetaProperties"))
|
||||
{
|
||||
evaluate();
|
||||
}
|
||||
|
||||
|
||||
alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const alphaContactAngleFvPatchScalarField& gcpsf,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
zeroGradientFvPatchScalarField(gcpsf, iF),
|
||||
thetaProps_(gcpsf.thetaProps_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
|
||||
{
|
||||
fvPatchScalarField::write(os);
|
||||
os.writeEntry("thetaProperties", thetaProps_);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePatchTypeField
|
||||
(
|
||||
fvPatchScalarField,
|
||||
alphaContactAngleFvPatchScalarField
|
||||
);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,217 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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::alphaContactAngleFvPatchScalarField
|
||||
|
||||
Description
|
||||
Contact-angle boundary condition for multi-phase interface-capturing
|
||||
simulations. Used in conjunction with multiphaseSystem.
|
||||
|
||||
SourceFiles
|
||||
alphaContactAngleFvPatchScalarField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef alphaContactAngleFvPatchScalarField_H
|
||||
#define alphaContactAngleFvPatchScalarField_H
|
||||
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
#include "multiphaseSystem.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class alphaContactAngleFvPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class alphaContactAngleFvPatchScalarField
|
||||
:
|
||||
public zeroGradientFvPatchScalarField
|
||||
{
|
||||
public:
|
||||
|
||||
class interfaceThetaProps
|
||||
{
|
||||
//- Equilibrium contact angle
|
||||
scalar theta0_;
|
||||
|
||||
//- Dynamic contact angle velocity scale
|
||||
scalar uTheta_;
|
||||
|
||||
//- Limiting advancing contact angle
|
||||
scalar thetaA_;
|
||||
|
||||
//- Limiting receding contact angle
|
||||
scalar thetaR_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
interfaceThetaProps()
|
||||
{}
|
||||
|
||||
interfaceThetaProps(Istream&);
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
//- Return the equilibrium contact angle theta0
|
||||
scalar theta0(bool matched=true) const
|
||||
{
|
||||
if (matched) return theta0_;
|
||||
else return 180.0 - theta0_;
|
||||
}
|
||||
|
||||
//- Return the dynamic contact angle velocity scale
|
||||
scalar uTheta() const
|
||||
{
|
||||
return uTheta_;
|
||||
}
|
||||
|
||||
//- Return the limiting advancing contact angle
|
||||
scalar thetaA(bool matched=true) const
|
||||
{
|
||||
if (matched) return thetaA_;
|
||||
else return 180.0 - thetaA_;
|
||||
}
|
||||
|
||||
//- Return the limiting receding contact angle
|
||||
scalar thetaR(bool matched=true) const
|
||||
{
|
||||
if (matched) return thetaR_;
|
||||
else return 180.0 - thetaR_;
|
||||
}
|
||||
|
||||
|
||||
// IO functions
|
||||
|
||||
friend Istream& operator>>(Istream&, interfaceThetaProps&);
|
||||
friend Ostream& operator<<(Ostream&, const interfaceThetaProps&);
|
||||
};
|
||||
|
||||
typedef HashTable
|
||||
<
|
||||
interfaceThetaProps,
|
||||
multiphaseSystem::interfacePair,
|
||||
multiphaseSystem::interfacePair::symmHash
|
||||
> thetaPropsTable;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private data
|
||||
|
||||
thetaPropsTable thetaProps_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("alphaContactAngle");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given alphaContactAngleFvPatchScalarField
|
||||
// onto a new patch
|
||||
alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const alphaContactAngleFvPatchScalarField&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual tmp<fvPatchScalarField> clone() const
|
||||
{
|
||||
return tmp<fvPatchScalarField>
|
||||
(
|
||||
new alphaContactAngleFvPatchScalarField(*this)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
alphaContactAngleFvPatchScalarField
|
||||
(
|
||||
const alphaContactAngleFvPatchScalarField&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual tmp<fvPatchScalarField> clone
|
||||
(
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
) const
|
||||
{
|
||||
return tmp<fvPatchScalarField>
|
||||
(
|
||||
new alphaContactAngleFvPatchScalarField(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
//- Return the contact angle properties
|
||||
const thetaPropsTable& thetaProps() const
|
||||
{
|
||||
return thetaProps_;
|
||||
}
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,89 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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 "constantDiameter.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace diameterModels
|
||||
{
|
||||
defineTypeNameAndDebug(constant, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
diameterModel,
|
||||
constant,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::diameterModels::constant::constant
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phaseModel& phase
|
||||
)
|
||||
:
|
||||
diameterModel(dict, phase),
|
||||
d_("d", dimLength, dict)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::diameterModels::constant::~constant()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::diameterModels::constant::d() const
|
||||
{
|
||||
return tmp<Foam::volScalarField>
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"d",
|
||||
phase_.U().time().timeName(),
|
||||
phase_.U().mesh()
|
||||
),
|
||||
phase_.U().mesh(),
|
||||
d_
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,98 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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::diameterModels::constant
|
||||
|
||||
Description
|
||||
Constant dispersed-phase particle diameter model.
|
||||
|
||||
SourceFiles
|
||||
constantDiameter.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef diameterModels_constant_H
|
||||
#define diameterModels_constant_H
|
||||
|
||||
#include "diameterModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace diameterModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class constant Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class constant
|
||||
:
|
||||
public diameterModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- The constant diameter of the phase
|
||||
dimensionedScalar d_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("constant");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
constant
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phaseModel& phase
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~constant();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
tmp<volScalarField> d() const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace diameterModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,58 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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 "diameterModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(diameterModel, 0);
|
||||
defineRunTimeSelectionTable(diameterModel, dictionary);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::diameterModel::diameterModel
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phaseModel& phase
|
||||
)
|
||||
:
|
||||
dict_(dict),
|
||||
phase_(phase)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::diameterModel::~diameterModel()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,122 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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::diameterModel
|
||||
|
||||
Description
|
||||
Abstract base-class for dispersed-phase particle diameter models.
|
||||
|
||||
SourceFiles
|
||||
diameterModel.C
|
||||
newDiameterModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef diameterModel_H
|
||||
#define diameterModel_H
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "dictionary.H"
|
||||
#include "phaseModel.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class diameterModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class diameterModel
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
const dictionary& dict_;
|
||||
const phaseModel& phase_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("diameterModel");
|
||||
|
||||
|
||||
// Declare runtime construction
|
||||
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
diameterModel,
|
||||
dictionary,
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phaseModel& phase
|
||||
),
|
||||
(dict, phase)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
diameterModel
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phaseModel& phase
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~diameterModel();
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
static autoPtr<diameterModel> New
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phaseModel& phase
|
||||
);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the phase mean diameter field
|
||||
virtual tmp<volScalarField> d() const = 0;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,67 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "diameterModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::diameterModel> Foam::diameterModel::New
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phaseModel& phase
|
||||
)
|
||||
{
|
||||
const word modelType(dict.get<word>("diameterModel"));
|
||||
|
||||
Info << "Selecting diameterModel for phase "
|
||||
<< phase.name()
|
||||
<< ": "
|
||||
<< modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
dict,
|
||||
"diameterModel",
|
||||
modelType,
|
||||
*dictionaryConstructorTablePtr_
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()
|
||||
(
|
||||
dict.optionalSubDict(modelType + "Coeffs"),
|
||||
phase
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,82 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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 "isothermalDiameter.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace diameterModels
|
||||
{
|
||||
defineTypeNameAndDebug(isothermal, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
diameterModel,
|
||||
isothermal,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::diameterModels::isothermal::isothermal
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phaseModel& phase
|
||||
)
|
||||
:
|
||||
diameterModel(dict, phase),
|
||||
d0_("d0", dimLength, dict),
|
||||
p0_("p0", dimPressure, dict)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::diameterModels::isothermal::~isothermal()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::diameterModels::isothermal::d() const
|
||||
{
|
||||
const volScalarField& p = phase_.U().db().lookupObject<volScalarField>
|
||||
(
|
||||
"p"
|
||||
);
|
||||
|
||||
return d0_*cbrt(p0_/p);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,101 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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::diameterModels::isothermal
|
||||
|
||||
Description
|
||||
Isothermal dispersed-phase particle diameter model.
|
||||
|
||||
SourceFiles
|
||||
isothermal.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef diameterModels_isothermal_H
|
||||
#define diameterModels_isothermal_H
|
||||
|
||||
#include "diameterModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace diameterModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class isothermal Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class isothermal
|
||||
:
|
||||
public diameterModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Reference diameter for the isothermal expansion
|
||||
dimensionedScalar d0_;
|
||||
|
||||
//- Reference pressure for the isothermal expansion
|
||||
dimensionedScalar p0_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("isothermal");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
isothermal
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phaseModel& phase
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~isothermal();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
tmp<volScalarField> d() const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace diameterModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,946 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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 "multiphaseSystem.H"
|
||||
#include "alphaContactAngleFvPatchScalarField.H"
|
||||
#include "fixedValueFvsPatchFields.H"
|
||||
#include "Time.H"
|
||||
#include "subCycle.H"
|
||||
#include "MULES.H"
|
||||
#include "surfaceInterpolate.H"
|
||||
#include "fvcGrad.H"
|
||||
#include "fvcSnGrad.H"
|
||||
#include "fvcDiv.H"
|
||||
#include "fvcFlux.H"
|
||||
#include "fvcAverage.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * //
|
||||
|
||||
const Foam::scalar Foam::multiphaseSystem::convertToRad =
|
||||
Foam::constant::mathematical::pi/180.0;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::multiphaseSystem::calcAlphas()
|
||||
{
|
||||
scalar level = 0.0;
|
||||
alphas_ == 0.0;
|
||||
|
||||
for (const phaseModel& phase : phases_)
|
||||
{
|
||||
alphas_ += level * phase;
|
||||
level += 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::multiphaseSystem::solveAlphas()
|
||||
{
|
||||
PtrList<surfaceScalarField> alphaPhiCorrs(phases_.size());
|
||||
int phasei = 0;
|
||||
|
||||
for (phaseModel& phase : phases_)
|
||||
{
|
||||
volScalarField& alpha1 = phase;
|
||||
|
||||
alphaPhiCorrs.set
|
||||
(
|
||||
phasei,
|
||||
new surfaceScalarField
|
||||
(
|
||||
"phi" + alpha1.name() + "Corr",
|
||||
fvc::flux
|
||||
(
|
||||
phi_,
|
||||
phase,
|
||||
"div(phi," + alpha1.name() + ')'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
surfaceScalarField& alphaPhiCorr = alphaPhiCorrs[phasei];
|
||||
|
||||
for (phaseModel& phase2 : phases_)
|
||||
{
|
||||
volScalarField& alpha2 = phase2;
|
||||
|
||||
if (&phase2 == &phase) continue;
|
||||
|
||||
surfaceScalarField phir(phase.phi() - phase2.phi());
|
||||
|
||||
const auto cAlpha = cAlphas_.cfind(interfacePair(phase, phase2));
|
||||
|
||||
if (cAlpha.found())
|
||||
{
|
||||
surfaceScalarField phic
|
||||
(
|
||||
(mag(phi_) + mag(phir))/mesh_.magSf()
|
||||
);
|
||||
|
||||
phir += min(cAlpha()*phic, max(phic))*nHatf(phase, phase2);
|
||||
}
|
||||
|
||||
const word phirScheme
|
||||
(
|
||||
"div(phir," + alpha2.name() + ',' + alpha1.name() + ')'
|
||||
);
|
||||
|
||||
alphaPhiCorr += fvc::flux
|
||||
(
|
||||
-fvc::flux(-phir, phase2, phirScheme),
|
||||
phase,
|
||||
phirScheme
|
||||
);
|
||||
}
|
||||
|
||||
phase.correctInflowOutflow(alphaPhiCorr);
|
||||
|
||||
MULES::limit
|
||||
(
|
||||
1.0/mesh_.time().deltaT().value(),
|
||||
geometricOneField(),
|
||||
phase,
|
||||
phi_,
|
||||
alphaPhiCorr,
|
||||
zeroField(),
|
||||
zeroField(),
|
||||
oneField(),
|
||||
zeroField(),
|
||||
true
|
||||
);
|
||||
|
||||
++phasei;
|
||||
}
|
||||
|
||||
MULES::limitSum(alphaPhiCorrs);
|
||||
|
||||
volScalarField sumAlpha
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"sumAlpha",
|
||||
mesh_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("sumAlpha", dimless, 0)
|
||||
);
|
||||
|
||||
phasei = 0;
|
||||
|
||||
for (phaseModel& phase : phases_)
|
||||
{
|
||||
surfaceScalarField& alphaPhi = alphaPhiCorrs[phasei];
|
||||
alphaPhi += upwind<scalar>(mesh_, phi_).flux(phase);
|
||||
phase.correctInflowOutflow(alphaPhi);
|
||||
|
||||
MULES::explicitSolve
|
||||
(
|
||||
geometricOneField(),
|
||||
phase,
|
||||
alphaPhi
|
||||
);
|
||||
|
||||
phase.alphaPhi() = alphaPhi;
|
||||
|
||||
Info<< phase.name() << " volume fraction, min, max = "
|
||||
<< phase.weightedAverage(mesh_.V()).value()
|
||||
<< ' ' << min(phase).value()
|
||||
<< ' ' << max(phase).value()
|
||||
<< endl;
|
||||
|
||||
sumAlpha += phase;
|
||||
|
||||
++phasei;
|
||||
}
|
||||
|
||||
Info<< "Phase-sum volume fraction, min, max = "
|
||||
<< sumAlpha.weightedAverage(mesh_.V()).value()
|
||||
<< ' ' << min(sumAlpha).value()
|
||||
<< ' ' << max(sumAlpha).value()
|
||||
<< endl;
|
||||
|
||||
// Correct the sum of the phase-fractions to avoid 'drift'
|
||||
volScalarField sumCorr(1.0 - sumAlpha);
|
||||
for (phaseModel& phase : phases_)
|
||||
{
|
||||
volScalarField& alpha = phase;
|
||||
alpha += alpha*sumCorr;
|
||||
}
|
||||
|
||||
calcAlphas();
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::surfaceVectorField> Foam::multiphaseSystem::nHatfv
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const volScalarField& alpha2
|
||||
) const
|
||||
{
|
||||
/*
|
||||
// Cell gradient of alpha
|
||||
volVectorField gradAlpha =
|
||||
alpha2*fvc::grad(alpha1) - alpha1*fvc::grad(alpha2);
|
||||
|
||||
// Interpolated face-gradient of alpha
|
||||
surfaceVectorField gradAlphaf = fvc::interpolate(gradAlpha);
|
||||
*/
|
||||
|
||||
surfaceVectorField gradAlphaf
|
||||
(
|
||||
fvc::interpolate(alpha2)*fvc::interpolate(fvc::grad(alpha1))
|
||||
- fvc::interpolate(alpha1)*fvc::interpolate(fvc::grad(alpha2))
|
||||
);
|
||||
|
||||
// Face unit interface normal
|
||||
return gradAlphaf/(mag(gradAlphaf) + deltaN_);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseSystem::nHatf
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const volScalarField& alpha2
|
||||
) const
|
||||
{
|
||||
// Face unit interface normal flux
|
||||
return nHatfv(alpha1, alpha2) & mesh_.Sf();
|
||||
}
|
||||
|
||||
|
||||
// Correction for the boundary condition on the unit normal nHat on
|
||||
// walls to produce the correct contact angle.
|
||||
|
||||
// The dynamic contact angle is calculated from the component of the
|
||||
// velocity on the direction of the interface, parallel to the wall.
|
||||
|
||||
void Foam::multiphaseSystem::correctContactAngle
|
||||
(
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2,
|
||||
surfaceVectorField::Boundary& nHatb
|
||||
) const
|
||||
{
|
||||
const volScalarField::Boundary& gbf
|
||||
= phase1.boundaryField();
|
||||
|
||||
const fvBoundaryMesh& boundary = mesh_.boundary();
|
||||
|
||||
forAll(boundary, patchi)
|
||||
{
|
||||
if (isA<alphaContactAngleFvPatchScalarField>(gbf[patchi]))
|
||||
{
|
||||
const alphaContactAngleFvPatchScalarField& acap =
|
||||
refCast<const alphaContactAngleFvPatchScalarField>(gbf[patchi]);
|
||||
|
||||
vectorField& nHatPatch = nHatb[patchi];
|
||||
|
||||
vectorField AfHatPatch
|
||||
(
|
||||
mesh_.Sf().boundaryField()[patchi]
|
||||
/mesh_.magSf().boundaryField()[patchi]
|
||||
);
|
||||
|
||||
const auto tp =
|
||||
acap.thetaProps().cfind(interfacePair(phase1, phase2));
|
||||
|
||||
if (!tp.found())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cannot find interface " << interfacePair(phase1, phase2)
|
||||
<< "\n in table of theta properties for patch "
|
||||
<< acap.patch().name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
bool matched = (tp.key().first() == phase1.name());
|
||||
|
||||
scalar theta0 = convertToRad*tp().theta0(matched);
|
||||
scalarField theta(boundary[patchi].size(), theta0);
|
||||
|
||||
scalar uTheta = tp().uTheta();
|
||||
|
||||
// Calculate the dynamic contact angle if required
|
||||
if (uTheta > SMALL)
|
||||
{
|
||||
scalar thetaA = convertToRad*tp().thetaA(matched);
|
||||
scalar thetaR = convertToRad*tp().thetaR(matched);
|
||||
|
||||
// Calculated the component of the velocity parallel to the wall
|
||||
vectorField Uwall
|
||||
(
|
||||
phase1.U().boundaryField()[patchi].patchInternalField()
|
||||
- phase1.U().boundaryField()[patchi]
|
||||
);
|
||||
Uwall -= (AfHatPatch & Uwall)*AfHatPatch;
|
||||
|
||||
// Find the direction of the interface parallel to the wall
|
||||
vectorField nWall
|
||||
(
|
||||
nHatPatch - (AfHatPatch & nHatPatch)*AfHatPatch
|
||||
);
|
||||
|
||||
// Normalise nWall
|
||||
nWall /= (mag(nWall) + SMALL);
|
||||
|
||||
// Calculate Uwall resolved normal to the interface parallel to
|
||||
// the interface
|
||||
scalarField uwall(nWall & Uwall);
|
||||
|
||||
theta += (thetaA - thetaR)*tanh(uwall/uTheta);
|
||||
}
|
||||
|
||||
|
||||
// Reset nHatPatch to correspond to the contact angle
|
||||
|
||||
scalarField a12(nHatPatch & AfHatPatch);
|
||||
|
||||
scalarField b1(cos(theta));
|
||||
|
||||
scalarField b2(nHatPatch.size());
|
||||
|
||||
forAll(b2, facei)
|
||||
{
|
||||
b2[facei] = cos(acos(a12[facei]) - theta[facei]);
|
||||
}
|
||||
|
||||
scalarField det(1.0 - a12*a12);
|
||||
|
||||
scalarField a((b1 - a12*b2)/det);
|
||||
scalarField b((b2 - a12*b1)/det);
|
||||
|
||||
nHatPatch = a*AfHatPatch + b*nHatPatch;
|
||||
|
||||
nHatPatch /= (mag(nHatPatch) + deltaN_.value());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::K
|
||||
(
|
||||
const phaseModel& phase1,
|
||||
const phaseModel& phase2
|
||||
) const
|
||||
{
|
||||
tmp<surfaceVectorField> tnHatfv = nHatfv(phase1, phase2);
|
||||
|
||||
correctContactAngle(phase1, phase2, tnHatfv.ref().boundaryFieldRef());
|
||||
|
||||
// Simple expression for curvature
|
||||
return -fvc::div(tnHatfv & mesh_.Sf());
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::multiphaseSystem::multiphaseSystem
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
)
|
||||
:
|
||||
IOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
U.time().constant(),
|
||||
U.db(),
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
),
|
||||
|
||||
phases_(lookup("phases"), phaseModel::iNew(U.mesh())),
|
||||
|
||||
mesh_(U.mesh()),
|
||||
phi_(phi),
|
||||
|
||||
alphas_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"alphas",
|
||||
mesh_.time().timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("alphas", dimless, 0.0)
|
||||
),
|
||||
|
||||
sigmas_(lookup("sigmas")),
|
||||
dimSigma_(1, 0, -2, 0, 0),
|
||||
cAlphas_(lookup("interfaceCompression")),
|
||||
Cvms_(lookup("virtualMass")),
|
||||
deltaN_
|
||||
(
|
||||
"deltaN",
|
||||
1e-8/cbrt(average(mesh_.V()))
|
||||
)
|
||||
{
|
||||
calcAlphas();
|
||||
alphas_.write();
|
||||
|
||||
interfaceDictTable dragModelsDict(lookup("drag"));
|
||||
|
||||
forAllConstIters(dragModelsDict, iter)
|
||||
{
|
||||
dragModels_.set
|
||||
(
|
||||
iter.key(),
|
||||
dragModel::New
|
||||
(
|
||||
iter(),
|
||||
*phases_.lookup(iter.key().first()),
|
||||
*phases_.lookup(iter.key().second())
|
||||
).ptr()
|
||||
);
|
||||
}
|
||||
|
||||
for (const phaseModel& phase1 : phases_)
|
||||
{
|
||||
for (const phaseModel& phase2 : phases_)
|
||||
{
|
||||
if (&phase2 == &phase1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const interfacePair key(phase1, phase2);
|
||||
|
||||
if (sigmas_.found(key) && !cAlphas_.found(key))
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Compression coefficient not specified for phase pair ("
|
||||
<< phase1.name() << ' ' << phase2.name()
|
||||
<< ") for which a surface tension coefficient is specified"
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::rho() const
|
||||
{
|
||||
auto iter = phases_.cbegin();
|
||||
|
||||
tmp<volScalarField> trho = iter()*iter().rho();
|
||||
volScalarField& rho = trho.ref();
|
||||
|
||||
for (++iter; iter != phases_.cend(); ++iter)
|
||||
{
|
||||
rho += iter()*iter().rho();
|
||||
}
|
||||
|
||||
return trho;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::multiphaseSystem::rho(const label patchi) const
|
||||
{
|
||||
auto iter = phases_.cbegin();
|
||||
|
||||
tmp<scalarField> trho = iter().boundaryField()[patchi]*iter().rho().value();
|
||||
scalarField& rho = trho.ref();
|
||||
|
||||
for (++iter; iter != phases_.cend(); ++iter)
|
||||
{
|
||||
rho += iter().boundaryField()[patchi]*iter().rho().value();
|
||||
}
|
||||
|
||||
return trho;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::nu() const
|
||||
{
|
||||
auto iter = phases_.cbegin();
|
||||
|
||||
tmp<volScalarField> tmu = iter()*(iter().rho()*iter().nu());
|
||||
volScalarField& mu = tmu.ref();
|
||||
|
||||
for (++iter; iter != phases_.cend(); ++iter)
|
||||
{
|
||||
mu += iter()*(iter().rho()*iter().nu());
|
||||
}
|
||||
|
||||
return tmu/rho();
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::multiphaseSystem::nu(const label patchi) const
|
||||
{
|
||||
auto iter = phases_.cbegin();
|
||||
|
||||
tmp<scalarField> tmu =
|
||||
iter().boundaryField()[patchi]
|
||||
*(iter().rho().value()*iter().nu().value());
|
||||
scalarField& mu = tmu.ref();
|
||||
|
||||
for (++iter; iter != phases_.cend(); ++iter)
|
||||
{
|
||||
mu +=
|
||||
iter().boundaryField()[patchi]
|
||||
*(iter().rho().value()*iter().nu().value());
|
||||
}
|
||||
|
||||
return tmu/rho(patchi);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::Cvm
|
||||
(
|
||||
const phaseModel& phase
|
||||
) const
|
||||
{
|
||||
tmp<volScalarField> tCvm
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Cvm",
|
||||
mesh_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar(dimDensity, Zero)
|
||||
)
|
||||
);
|
||||
|
||||
for (const phaseModel& phase2 : phases_)
|
||||
{
|
||||
if (&phase2 == &phase)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
auto iterCvm = Cvms_.cfind(interfacePair(phase, phase2));
|
||||
|
||||
if (iterCvm.found())
|
||||
{
|
||||
tCvm.ref() += iterCvm()*phase2.rho()*phase2;
|
||||
}
|
||||
else
|
||||
{
|
||||
iterCvm = Cvms_.cfind(interfacePair(phase2, phase));
|
||||
|
||||
if (iterCvm.found())
|
||||
{
|
||||
tCvm.ref() += iterCvm()*phase.rho()*phase2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tCvm;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volVectorField> Foam::multiphaseSystem::Svm
|
||||
(
|
||||
const phaseModel& phase
|
||||
) const
|
||||
{
|
||||
tmp<volVectorField> tSvm
|
||||
(
|
||||
new volVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Svm",
|
||||
mesh_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedVector
|
||||
(
|
||||
"Svm",
|
||||
dimensionSet(1, -2, -2, 0, 0),
|
||||
Zero
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
for (const phaseModel& phase2 : phases_)
|
||||
{
|
||||
if (&phase2 == &phase)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
auto Cvm = Cvms_.cfind(interfacePair(phase, phase2));
|
||||
|
||||
if (Cvm.found())
|
||||
{
|
||||
tSvm.ref() += Cvm()*phase2.rho()*phase2*phase2.DDtU();
|
||||
}
|
||||
else
|
||||
{
|
||||
Cvm = Cvms_.cfind(interfacePair(phase2, phase));
|
||||
|
||||
if (Cvm.found())
|
||||
{
|
||||
tSvm.ref() += Cvm()*phase.rho()*phase2*phase2.DDtU();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
volVectorField::Boundary& SvmBf =
|
||||
tSvm.ref().boundaryFieldRef();
|
||||
|
||||
// Remove virtual mass at fixed-flux boundaries
|
||||
forAll(phase.phi().boundaryField(), patchi)
|
||||
{
|
||||
if
|
||||
(
|
||||
isA<fixedValueFvsPatchScalarField>
|
||||
(
|
||||
phase.phi().boundaryField()[patchi]
|
||||
)
|
||||
)
|
||||
{
|
||||
SvmBf[patchi] = Zero;
|
||||
}
|
||||
}
|
||||
|
||||
return tSvm;
|
||||
}
|
||||
|
||||
|
||||
Foam::autoPtr<Foam::multiphaseSystem::dragCoeffFields>
|
||||
Foam::multiphaseSystem::dragCoeffs() const
|
||||
{
|
||||
autoPtr<dragCoeffFields> dragCoeffsPtr(new dragCoeffFields);
|
||||
|
||||
forAllConstIters(dragModels_, iter)
|
||||
{
|
||||
const dragModel& dm = *iter();
|
||||
|
||||
volScalarField* Kptr =
|
||||
(
|
||||
max
|
||||
(
|
||||
// fvc::average(dm.phase1()*dm.phase2()),
|
||||
// fvc::average(dm.phase1())*fvc::average(dm.phase2()),
|
||||
dm.phase1()*dm.phase2(),
|
||||
dm.residualPhaseFraction()
|
||||
)
|
||||
*dm.K
|
||||
(
|
||||
max
|
||||
(
|
||||
mag(dm.phase1().U() - dm.phase2().U()),
|
||||
dm.residualSlip()
|
||||
)
|
||||
)
|
||||
).ptr();
|
||||
|
||||
volScalarField::Boundary& Kbf = Kptr->boundaryFieldRef();
|
||||
|
||||
// Remove drag at fixed-flux boundaries
|
||||
forAll(dm.phase1().phi().boundaryField(), patchi)
|
||||
{
|
||||
if
|
||||
(
|
||||
isA<fixedValueFvsPatchScalarField>
|
||||
(
|
||||
dm.phase1().phi().boundaryField()[patchi]
|
||||
)
|
||||
)
|
||||
{
|
||||
Kbf[patchi] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
dragCoeffsPtr().set(iter.key(), Kptr);
|
||||
}
|
||||
|
||||
return dragCoeffsPtr;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::dragCoeff
|
||||
(
|
||||
const phaseModel& phase,
|
||||
const dragCoeffFields& dragCoeffs
|
||||
) const
|
||||
{
|
||||
tmp<volScalarField> tdragCoeff
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"dragCoeff",
|
||||
mesh_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar
|
||||
(
|
||||
"dragCoeff",
|
||||
dimensionSet(1, -3, -1, 0, 0),
|
||||
0
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
dragModelTable::const_iterator dmIter = dragModels_.begin();
|
||||
dragCoeffFields::const_iterator dcIter = dragCoeffs.begin();
|
||||
for
|
||||
(
|
||||
;
|
||||
dmIter.good() && dcIter.good();
|
||||
++dmIter, ++dcIter
|
||||
)
|
||||
{
|
||||
if
|
||||
(
|
||||
&phase == &dmIter()->phase1()
|
||||
|| &phase == &dmIter()->phase2()
|
||||
)
|
||||
{
|
||||
tdragCoeff.ref() += *dcIter();
|
||||
}
|
||||
}
|
||||
|
||||
return tdragCoeff;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseSystem::surfaceTension
|
||||
(
|
||||
const phaseModel& phase1
|
||||
) const
|
||||
{
|
||||
tmp<surfaceScalarField> tSurfaceTension
|
||||
(
|
||||
new surfaceScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"surfaceTension",
|
||||
mesh_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar
|
||||
(
|
||||
"surfaceTension",
|
||||
dimensionSet(1, -2, -2, 0, 0),
|
||||
0
|
||||
)
|
||||
)
|
||||
);
|
||||
tSurfaceTension.ref().setOriented();
|
||||
|
||||
for (const phaseModel& phase2 : phases_)
|
||||
{
|
||||
if (&phase2 == &phase1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const auto sigma = sigmas_.cfind(interfacePair(phase1, phase2));
|
||||
|
||||
if (sigma.found())
|
||||
{
|
||||
tSurfaceTension.ref() +=
|
||||
dimensionedScalar("sigma", dimSigma_, *sigma)
|
||||
*fvc::interpolate(K(phase1, phase2))*
|
||||
(
|
||||
fvc::interpolate(phase2)*fvc::snGrad(phase1)
|
||||
- fvc::interpolate(phase1)*fvc::snGrad(phase2)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return tSurfaceTension;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::multiphaseSystem::nearInterface() const
|
||||
{
|
||||
tmp<volScalarField> tnearInt
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"nearInterface",
|
||||
mesh_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("nearInterface", dimless, 0.0)
|
||||
)
|
||||
);
|
||||
|
||||
for (const phaseModel& phase : phases_)
|
||||
{
|
||||
tnearInt.ref() =
|
||||
max(tnearInt(), pos0(phase - 0.01)*pos0(0.99 - phase));
|
||||
}
|
||||
|
||||
return tnearInt;
|
||||
}
|
||||
|
||||
|
||||
void Foam::multiphaseSystem::solve()
|
||||
{
|
||||
for (phaseModel& phase : phases_)
|
||||
{
|
||||
phase.correct();
|
||||
}
|
||||
|
||||
const Time& runTime = mesh_.time();
|
||||
|
||||
const dictionary& alphaControls = mesh_.solverDict("alpha");
|
||||
label nAlphaSubCycles(alphaControls.get<label>("nAlphaSubCycles"));
|
||||
|
||||
if (nAlphaSubCycles > 1)
|
||||
{
|
||||
dimensionedScalar totalDeltaT = runTime.deltaT();
|
||||
|
||||
PtrList<volScalarField> alpha0s(phases_.size());
|
||||
PtrList<surfaceScalarField> alphaPhiSums(phases_.size());
|
||||
|
||||
label phasei = 0;
|
||||
for (phaseModel& phase : phases_)
|
||||
{
|
||||
volScalarField& alpha = phase;
|
||||
|
||||
alpha0s.set
|
||||
(
|
||||
phasei,
|
||||
new volScalarField(alpha.oldTime())
|
||||
);
|
||||
|
||||
alphaPhiSums.set
|
||||
(
|
||||
phasei,
|
||||
new surfaceScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"phiSum" + alpha.name(),
|
||||
runTime.timeName(),
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0)
|
||||
)
|
||||
);
|
||||
|
||||
++phasei;
|
||||
}
|
||||
|
||||
for
|
||||
(
|
||||
subCycleTime alphaSubCycle
|
||||
(
|
||||
const_cast<Time&>(runTime),
|
||||
nAlphaSubCycles
|
||||
);
|
||||
!(++alphaSubCycle).end();
|
||||
)
|
||||
{
|
||||
solveAlphas();
|
||||
|
||||
label phasei = 0;
|
||||
for (const phaseModel& phase : phases_)
|
||||
{
|
||||
alphaPhiSums[phasei] += phase.alphaPhi()/nAlphaSubCycles;
|
||||
|
||||
++phasei;
|
||||
}
|
||||
}
|
||||
|
||||
phasei = 0;
|
||||
for (phaseModel& phase : phases_)
|
||||
{
|
||||
volScalarField& alpha = phase;
|
||||
|
||||
phase.alphaPhi() = alphaPhiSums[phasei];
|
||||
|
||||
// Correct the time index of the field
|
||||
// to correspond to the global time
|
||||
alpha.timeIndex() = runTime.timeIndex();
|
||||
|
||||
// Reset the old-time field value
|
||||
alpha.oldTime() = alpha0s[phasei];
|
||||
alpha.oldTime().timeIndex() = runTime.timeIndex();
|
||||
|
||||
++phasei;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
solveAlphas();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Foam::multiphaseSystem::read()
|
||||
{
|
||||
if (regIOobject::read())
|
||||
{
|
||||
bool readOK = true;
|
||||
|
||||
PtrList<entry> phaseData(lookup("phases"));
|
||||
label phasei = 0;
|
||||
|
||||
for (phaseModel& phase : phases_)
|
||||
{
|
||||
readOK &= phase.read(phaseData[phasei++].dict());
|
||||
}
|
||||
|
||||
lookup("sigmas") >> sigmas_;
|
||||
lookup("interfaceCompression") >> cAlphas_;
|
||||
lookup("virtualMass") >> Cvms_;
|
||||
|
||||
return readOK;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,319 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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::multiphaseSystem
|
||||
|
||||
Description
|
||||
Incompressible multi-phase mixture with built in solution for the
|
||||
phase fractions with interface compression for interface-capturing.
|
||||
|
||||
Derived from transportModel so that it can be unused in conjunction with
|
||||
the incompressible turbulence models.
|
||||
|
||||
Surface tension and contact-angle is handled for the interface
|
||||
between each phase-pair.
|
||||
|
||||
SourceFiles
|
||||
multiphaseSystem.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef multiphaseSystem_H
|
||||
#define multiphaseSystem_H
|
||||
|
||||
#include "incompressible/transportModel/transportModel.H"
|
||||
#include "IOdictionary.H"
|
||||
#include "phaseModel.H"
|
||||
#include "PtrDictionary.H"
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "dragModel.H"
|
||||
#include "HashPtrTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class multiphaseSystem Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class multiphaseSystem
|
||||
:
|
||||
public IOdictionary,
|
||||
public transportModel
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
class interfacePair
|
||||
:
|
||||
public Pair<word>
|
||||
{
|
||||
public:
|
||||
|
||||
class symmHash
|
||||
:
|
||||
public Hash<interfacePair>
|
||||
{
|
||||
public:
|
||||
|
||||
symmHash()
|
||||
{}
|
||||
|
||||
label operator()(const interfacePair& key) const
|
||||
{
|
||||
return word::hash()(key.first()) + word::hash()(key.second());
|
||||
}
|
||||
};
|
||||
|
||||
class hash
|
||||
:
|
||||
public Hash<interfacePair>
|
||||
{
|
||||
public:
|
||||
|
||||
hash()
|
||||
{}
|
||||
|
||||
label operator()(const interfacePair& key) const
|
||||
{
|
||||
return word::hash()(key.first(), word::hash()(key.second()));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
interfacePair()
|
||||
{}
|
||||
|
||||
interfacePair(const word& alpha1Name, const word& alpha2Name)
|
||||
:
|
||||
Pair<word>(alpha1Name, alpha2Name)
|
||||
{}
|
||||
|
||||
interfacePair(const phaseModel& alpha1, const phaseModel& alpha2)
|
||||
:
|
||||
Pair<word>(alpha1.name(), alpha2.name())
|
||||
{}
|
||||
|
||||
|
||||
// Friend Operators
|
||||
|
||||
friend bool operator==
|
||||
(
|
||||
const interfacePair& a,
|
||||
const interfacePair& b
|
||||
)
|
||||
{
|
||||
return
|
||||
(
|
||||
((a.first() == b.first()) && (a.second() == b.second()))
|
||||
|| ((a.first() == b.second()) && (a.second() == b.first()))
|
||||
);
|
||||
}
|
||||
|
||||
friend bool operator!=
|
||||
(
|
||||
const interfacePair& a,
|
||||
const interfacePair& b
|
||||
)
|
||||
{
|
||||
return (!(a == b));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
typedef HashPtrTable<dragModel, interfacePair, interfacePair::symmHash>
|
||||
dragModelTable;
|
||||
|
||||
typedef HashPtrTable<volScalarField, interfacePair, interfacePair::symmHash>
|
||||
dragCoeffFields;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private data
|
||||
|
||||
//- Dictionary of phases
|
||||
PtrDictionary<phaseModel> phases_;
|
||||
|
||||
const fvMesh& mesh_;
|
||||
const surfaceScalarField& phi_;
|
||||
|
||||
volScalarField alphas_;
|
||||
|
||||
typedef HashTable<scalar, interfacePair, interfacePair::symmHash>
|
||||
scalarCoeffSymmTable;
|
||||
|
||||
typedef HashTable<scalar, interfacePair, interfacePair::hash>
|
||||
scalarCoeffTable;
|
||||
|
||||
scalarCoeffSymmTable sigmas_;
|
||||
dimensionSet dimSigma_;
|
||||
|
||||
scalarCoeffSymmTable cAlphas_;
|
||||
|
||||
scalarCoeffTable Cvms_;
|
||||
|
||||
typedef HashTable<dictionary, interfacePair, interfacePair::symmHash>
|
||||
interfaceDictTable;
|
||||
|
||||
dragModelTable dragModels_;
|
||||
|
||||
//- Stabilisation for normalisation of the interface normal
|
||||
const dimensionedScalar deltaN_;
|
||||
|
||||
//- Conversion factor for degrees into radians
|
||||
static const scalar convertToRad;
|
||||
|
||||
|
||||
// Private member functions
|
||||
|
||||
void calcAlphas();
|
||||
|
||||
void solveAlphas();
|
||||
|
||||
tmp<surfaceVectorField> nHatfv
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const volScalarField& alpha2
|
||||
) const;
|
||||
|
||||
tmp<surfaceScalarField> nHatf
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const volScalarField& alpha2
|
||||
) const;
|
||||
|
||||
void correctContactAngle
|
||||
(
|
||||
const phaseModel& alpha1,
|
||||
const phaseModel& alpha2,
|
||||
surfaceVectorField::Boundary& nHatb
|
||||
) const;
|
||||
|
||||
tmp<volScalarField> K
|
||||
(
|
||||
const phaseModel& alpha1,
|
||||
const phaseModel& alpha2
|
||||
) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
multiphaseSystem
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~multiphaseSystem() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the phases
|
||||
const PtrDictionary<phaseModel>& phases() const
|
||||
{
|
||||
return phases_;
|
||||
}
|
||||
|
||||
//- Return the phases
|
||||
PtrDictionary<phaseModel>& phases()
|
||||
{
|
||||
return phases_;
|
||||
}
|
||||
|
||||
//- Return the mixture density
|
||||
tmp<volScalarField> rho() const;
|
||||
|
||||
//- Return the mixture density for patch
|
||||
tmp<scalarField> rho(const label patchi) const;
|
||||
|
||||
//- Return the mixture laminar viscosity
|
||||
tmp<volScalarField> nu() const;
|
||||
|
||||
//- Return the laminar viscosity for patch
|
||||
tmp<scalarField> nu(const label patchi) const;
|
||||
|
||||
//- Return the virtual-mass coefficient for the given phase
|
||||
tmp<volScalarField> Cvm(const phaseModel& phase) const;
|
||||
|
||||
//- Return the virtual-mass source for the given phase
|
||||
tmp<volVectorField> Svm(const phaseModel& phase) const;
|
||||
|
||||
//- Return the table of drag models
|
||||
const dragModelTable& dragModels() const
|
||||
{
|
||||
return dragModels_;
|
||||
}
|
||||
|
||||
//- Return the drag coefficients for all of the interfaces
|
||||
autoPtr<dragCoeffFields> dragCoeffs() const;
|
||||
|
||||
//- Return the sum of the drag coefficients for the given phase
|
||||
tmp<volScalarField> dragCoeff
|
||||
(
|
||||
const phaseModel& phase,
|
||||
const dragCoeffFields& dragCoeffs
|
||||
) const;
|
||||
|
||||
tmp<surfaceScalarField> surfaceTension(const phaseModel& phase) const;
|
||||
|
||||
//- Indicator of the proximity of the interface
|
||||
// Field values are 1 near and 0 away for the interface.
|
||||
tmp<volScalarField> nearInterface() const;
|
||||
|
||||
//- Solve for the mixture phase-fractions
|
||||
void solve();
|
||||
|
||||
//- Dummy correct
|
||||
void correct()
|
||||
{}
|
||||
|
||||
//- Read base transportProperties dictionary
|
||||
bool read();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,263 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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 "phaseModel.H"
|
||||
#include "diameterModel.H"
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
#include "slipFvPatchFields.H"
|
||||
#include "partialSlipFvPatchFields.H"
|
||||
#include "surfaceInterpolate.H"
|
||||
#include "fvcFlux.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::phaseModel::phaseModel
|
||||
(
|
||||
const word& phaseName,
|
||||
const dictionary& phaseDict,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("alpha", phaseName),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
),
|
||||
name_(phaseName),
|
||||
phaseDict_(phaseDict),
|
||||
nu_
|
||||
(
|
||||
"nu",
|
||||
dimViscosity,
|
||||
phaseDict_
|
||||
),
|
||||
kappa_
|
||||
(
|
||||
"kappa",
|
||||
dimensionSet(1, 1, -3, -1, 0),
|
||||
phaseDict_
|
||||
),
|
||||
Cp_
|
||||
(
|
||||
"Cp",
|
||||
dimSpecificHeatCapacity,
|
||||
phaseDict_
|
||||
),
|
||||
rho_
|
||||
(
|
||||
"rho",
|
||||
dimDensity,
|
||||
phaseDict_
|
||||
),
|
||||
U_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("U", phaseName),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
),
|
||||
DDtU_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("DDtU", phaseName),
|
||||
mesh.time().timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedVector(dimVelocity/dimTime, Zero)
|
||||
),
|
||||
alphaPhi_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("alphaPhi", phaseName),
|
||||
mesh.time().timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero)
|
||||
)
|
||||
{
|
||||
alphaPhi_.setOriented();
|
||||
|
||||
const word phiName = IOobject::groupName("phi", name_);
|
||||
|
||||
IOobject phiHeader
|
||||
(
|
||||
phiName,
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
);
|
||||
|
||||
if (phiHeader.typeHeaderOk<surfaceScalarField>(true))
|
||||
{
|
||||
Info<< "Reading face flux field " << phiName << endl;
|
||||
|
||||
phiPtr_.reset
|
||||
(
|
||||
new surfaceScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
phiName,
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Calculating face flux field " << phiName << endl;
|
||||
|
||||
wordList phiTypes
|
||||
(
|
||||
U_.boundaryField().size(),
|
||||
calculatedFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
forAll(U_.boundaryField(), i)
|
||||
{
|
||||
if
|
||||
(
|
||||
isA<fixedValueFvPatchVectorField>(U_.boundaryField()[i])
|
||||
|| isA<slipFvPatchVectorField>(U_.boundaryField()[i])
|
||||
|| isA<partialSlipFvPatchVectorField>(U_.boundaryField()[i])
|
||||
)
|
||||
{
|
||||
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
|
||||
}
|
||||
}
|
||||
|
||||
phiPtr_.reset
|
||||
(
|
||||
new surfaceScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
phiName,
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
fvc::flux(U_),
|
||||
phiTypes
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
dPtr_ = diameterModel::New
|
||||
(
|
||||
phaseDict_,
|
||||
*this
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::phaseModel::~phaseModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const
|
||||
{
|
||||
NotImplemented;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Foam::phaseModel::correct()
|
||||
{
|
||||
//nuModel_->correct();
|
||||
}
|
||||
|
||||
|
||||
bool Foam::phaseModel::read(const dictionary& phaseDict)
|
||||
{
|
||||
phaseDict_ = phaseDict;
|
||||
|
||||
//if (nuModel_->read(phaseDict_))
|
||||
{
|
||||
phaseDict_.readEntry("nu", nu_.value());
|
||||
phaseDict_.readEntry("kappa", kappa_.value());
|
||||
phaseDict_.readEntry("Cp", Cp_.value());
|
||||
phaseDict_.readEntry("rho", rho_.value());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// return false;
|
||||
}
|
||||
|
||||
|
||||
void Foam::phaseModel::correctInflowOutflow(surfaceScalarField& alphaPhi) const
|
||||
{
|
||||
surfaceScalarField::Boundary& alphaPhiBf = alphaPhi.boundaryFieldRef();
|
||||
const volScalarField::Boundary& alphaBf = boundaryField();
|
||||
const surfaceScalarField::Boundary& phiBf = phi().boundaryField();
|
||||
|
||||
forAll(alphaPhiBf, patchi)
|
||||
{
|
||||
fvsPatchScalarField& alphaPhip = alphaPhiBf[patchi];
|
||||
|
||||
if (!alphaPhip.coupled())
|
||||
{
|
||||
alphaPhip = phiBf[patchi]*alphaBf[patchi];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::phaseModel::d() const
|
||||
{
|
||||
return dPtr_().d();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,235 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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::phaseModel
|
||||
|
||||
SourceFiles
|
||||
phaseModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef phaseModel_H
|
||||
#define phaseModel_H
|
||||
|
||||
#include "dictionary.H"
|
||||
#include "dictionaryEntry.H"
|
||||
#include "dimensionedScalar.H"
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declarations
|
||||
class diameterModel;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class phaseModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class phaseModel
|
||||
:
|
||||
public volScalarField
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Name of phase
|
||||
word name_;
|
||||
|
||||
dictionary phaseDict_;
|
||||
|
||||
//- Kinematic viscosity
|
||||
dimensionedScalar nu_;
|
||||
|
||||
//- Thermal conductivity
|
||||
dimensionedScalar kappa_;
|
||||
|
||||
//- Heat capacity
|
||||
dimensionedScalar Cp_;
|
||||
|
||||
//- Density
|
||||
dimensionedScalar rho_;
|
||||
|
||||
//- Velocity
|
||||
volVectorField U_;
|
||||
|
||||
//- Substantive derivative of the velocity
|
||||
volVectorField DDtU_;
|
||||
|
||||
//- Volumetric flux of the phase
|
||||
surfaceScalarField alphaPhi_;
|
||||
|
||||
//- Volumetric flux for the phase
|
||||
autoPtr<surfaceScalarField> phiPtr_;
|
||||
|
||||
//- Diameter model
|
||||
autoPtr<diameterModel> dPtr_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
phaseModel
|
||||
(
|
||||
const word& phaseName,
|
||||
const dictionary& phaseDict,
|
||||
const fvMesh& mesh
|
||||
);
|
||||
|
||||
//- Return clone
|
||||
autoPtr<phaseModel> clone() const;
|
||||
|
||||
//- Return a pointer to a new phase created on freestore
|
||||
// from Istream
|
||||
class iNew
|
||||
{
|
||||
const fvMesh& mesh_;
|
||||
|
||||
public:
|
||||
|
||||
iNew
|
||||
(
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
mesh_(mesh)
|
||||
{}
|
||||
|
||||
autoPtr<phaseModel> operator()(Istream& is) const
|
||||
{
|
||||
dictionaryEntry ent(dictionary::null, is);
|
||||
return autoPtr<phaseModel>
|
||||
(
|
||||
new phaseModel(ent.keyword(), ent, mesh_)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~phaseModel();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
const word& name() const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
const word& keyword() const
|
||||
{
|
||||
return name();
|
||||
}
|
||||
|
||||
tmp<volScalarField> d() const;
|
||||
|
||||
const dimensionedScalar& nu() const
|
||||
{
|
||||
return nu_;
|
||||
}
|
||||
|
||||
const dimensionedScalar& kappa() const
|
||||
{
|
||||
return kappa_;
|
||||
}
|
||||
|
||||
const dimensionedScalar& Cp() const
|
||||
{
|
||||
return Cp_;
|
||||
}
|
||||
|
||||
const dimensionedScalar& rho() const
|
||||
{
|
||||
return rho_;
|
||||
}
|
||||
|
||||
const volVectorField& U() const
|
||||
{
|
||||
return U_;
|
||||
}
|
||||
|
||||
volVectorField& U()
|
||||
{
|
||||
return U_;
|
||||
}
|
||||
|
||||
const volVectorField& DDtU() const
|
||||
{
|
||||
return DDtU_;
|
||||
}
|
||||
|
||||
volVectorField& DDtU()
|
||||
{
|
||||
return DDtU_;
|
||||
}
|
||||
|
||||
const surfaceScalarField& phi() const
|
||||
{
|
||||
return *phiPtr_;
|
||||
}
|
||||
|
||||
surfaceScalarField& phi()
|
||||
{
|
||||
return *phiPtr_;
|
||||
}
|
||||
|
||||
const surfaceScalarField& alphaPhi() const
|
||||
{
|
||||
return alphaPhi_;
|
||||
}
|
||||
|
||||
surfaceScalarField& alphaPhi()
|
||||
{
|
||||
return alphaPhi_;
|
||||
}
|
||||
|
||||
//- Ensure that the flux at inflow/outflow BCs is preserved
|
||||
void correctInflowOutflow(surfaceScalarField& alphaPhi) const;
|
||||
|
||||
//- Correct the phase properties
|
||||
void correct();
|
||||
|
||||
//-Inherit read from volScalarField
|
||||
using volScalarField::read;
|
||||
|
||||
//- Read base transportProperties dictionary
|
||||
bool read(const dictionary& phaseDict);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
9
src/phaseSystemModels/multiphaseInter/Allwclean
Executable file
9
src/phaseSystemModels/multiphaseInter/Allwclean
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wclean libso phasesSystem
|
||||
wclean libso massTransferModels
|
||||
wclean libso compressibleMultiPhaseTurbulenceModels
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
11
src/phaseSystemModels/multiphaseInter/Allwmake
Executable file
11
src/phaseSystemModels/multiphaseInter/Allwmake
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmakeLnInclude massTransferModels
|
||||
wmake $targetType phasesSystem
|
||||
wmake $targetType massTransferModels
|
||||
wmake $targetType compressibleMultiPhaseTurbulenceModels
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -0,0 +1,3 @@
|
||||
compressibleMultiPhaseTurbulenceModels.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libcompressibleMultiPhaseTurbulenceModels
|
||||
@ -0,0 +1,21 @@
|
||||
EXE_INC = \
|
||||
-I../phasesSystem/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lfluidThermophysicalModels \
|
||||
-lspecie \
|
||||
-lincompressibleTransportModels \
|
||||
-lcompressibleTransportModels \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels
|
||||
@ -0,0 +1,102 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd
|
||||
-------------------------------------------------------------------------------
|
||||
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 "CompressibleTurbulenceModel.H"
|
||||
#include "compressibleTurbulenceModel.H"
|
||||
#include "multiphaseSystem.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "makeTurbulenceModel.H"
|
||||
|
||||
#include "ThermalDiffusivity.H"
|
||||
|
||||
#include "laminarModel.H"
|
||||
#include "RASModel.H"
|
||||
#include "LESModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
defineTurbulenceModelTypes
|
||||
(
|
||||
geometricOneField,
|
||||
volScalarField,
|
||||
compressibleTurbulenceModel,
|
||||
CompressibleTurbulenceModel,
|
||||
ThermalDiffusivity,
|
||||
multiphaseSystem
|
||||
);
|
||||
|
||||
makeBaseTurbulenceModel
|
||||
(
|
||||
geometricOneField,
|
||||
volScalarField,
|
||||
compressibleTurbulenceModel,
|
||||
CompressibleTurbulenceModel,
|
||||
ThermalDiffusivity,
|
||||
multiphaseSystem
|
||||
);
|
||||
|
||||
#define makeLaminarModel(Type) \
|
||||
makeTemplatedLaminarModel \
|
||||
(multiphaseSystemCompressibleTurbulenceModel, laminar, Type)
|
||||
|
||||
#define makeRASModel(Type) \
|
||||
makeTemplatedTurbulenceModel \
|
||||
(multiphaseSystemCompressibleTurbulenceModel, RAS, Type)
|
||||
|
||||
#define makeLESModel(Type) \
|
||||
makeTemplatedTurbulenceModel \
|
||||
(multiphaseSystemCompressibleTurbulenceModel, LES, Type)
|
||||
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// Laminar models
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
#include "Stokes.H"
|
||||
makeLaminarModel(Stokes);
|
||||
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// RAS models
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
#include "kEpsilon.H"
|
||||
makeRASModel(kEpsilon);
|
||||
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// LES models
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
#include "Smagorinsky.H"
|
||||
makeLESModel(Smagorinsky);
|
||||
|
||||
#include "kEqn.H"
|
||||
makeLESModel(kEqn);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,329 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "phasePair.H"
|
||||
#include "pureMixture.H"
|
||||
#include "multiComponentMixture.H"
|
||||
#include "rhoThermo.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
template<class ThermoType>
|
||||
const typename Foam::multiComponentMixture<ThermoType>::thermoType&
|
||||
Foam::InterfaceCompositionModel<Thermo, OtherThermo>::getLocalThermo
|
||||
(
|
||||
const word& speciesName,
|
||||
const multiComponentMixture<ThermoType>& globalThermo
|
||||
) const
|
||||
{
|
||||
return
|
||||
globalThermo.getLocalThermo
|
||||
(
|
||||
globalThermo.species()
|
||||
[
|
||||
speciesName
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
template<class ThermoType>
|
||||
const typename Foam::pureMixture<ThermoType>::thermoType&
|
||||
Foam::InterfaceCompositionModel<Thermo, OtherThermo>::getLocalThermo
|
||||
(
|
||||
const word& speciesName,
|
||||
const pureMixture<ThermoType>& globalThermo
|
||||
) const
|
||||
{
|
||||
return globalThermo.cellMixture(0);
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
template<class ThermoType>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::InterfaceCompositionModel<Thermo, OtherThermo>::getSpecieMassFraction
|
||||
(
|
||||
const word& speciesName,
|
||||
const multiComponentMixture<ThermoType>& mixture
|
||||
) const
|
||||
{
|
||||
const fvMesh& mesh = fromThermo_.p().mesh();
|
||||
|
||||
auto tY = tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tY",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(dimless, Zero),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
auto& Ys = tY.ref();
|
||||
|
||||
Ys = mixture.Y(speciesName);
|
||||
|
||||
return tY;
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
template<class ThermoType>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::InterfaceCompositionModel<Thermo, OtherThermo>::getSpecieMassFraction
|
||||
(
|
||||
const word& speciesName,
|
||||
const pureMixture<ThermoType>& mixture
|
||||
) const
|
||||
{
|
||||
const fvMesh& mesh = fromThermo_.p().mesh();
|
||||
|
||||
return tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tY",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("one", dimless, scalar(1)),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
template<class ThermoType>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::InterfaceCompositionModel<Thermo, OtherThermo>::MwMixture
|
||||
(
|
||||
const pureMixture<ThermoType>& mixture
|
||||
) const
|
||||
{
|
||||
const fvMesh& mesh = fromThermo_.p().mesh();
|
||||
|
||||
return tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tM",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar
|
||||
(
|
||||
"Mw",
|
||||
dimMass/dimMoles,
|
||||
1e-3*mixture.cellMixture(0).W()
|
||||
),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
template<class ThermoType>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::InterfaceCompositionModel<Thermo, OtherThermo>::MwMixture
|
||||
(
|
||||
const multiComponentMixture<ThermoType>& mixture
|
||||
) const
|
||||
{
|
||||
return refCast<const basicSpecieMixture>(mixture).W();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
Foam::InterfaceCompositionModel<Thermo, OtherThermo>::InterfaceCompositionModel
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phasePair& pair
|
||||
)
|
||||
:
|
||||
interfaceCompositionModel(dict, pair),
|
||||
fromThermo_
|
||||
(
|
||||
pair.from().mesh().lookupObject<Thermo>
|
||||
(
|
||||
IOobject::groupName
|
||||
(
|
||||
basicThermo::dictName,
|
||||
pair.from().name()
|
||||
)
|
||||
)
|
||||
),
|
||||
toThermo_
|
||||
(
|
||||
pair.to().mesh().lookupObject<OtherThermo>
|
||||
(
|
||||
IOobject::groupName
|
||||
(
|
||||
basicThermo::dictName,
|
||||
pair.to().name()
|
||||
)
|
||||
)
|
||||
),
|
||||
Le_("Le", dimless, 1.0, dict)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::InterfaceCompositionModel<Thermo, OtherThermo>::D
|
||||
(
|
||||
const word& speciesName
|
||||
) const
|
||||
{
|
||||
const typename Thermo::thermoType& fromThermo =
|
||||
getLocalThermo
|
||||
(
|
||||
speciesName,
|
||||
fromThermo_
|
||||
);
|
||||
|
||||
const volScalarField& p(fromThermo_.p());
|
||||
|
||||
const volScalarField& T(fromThermo_.T());
|
||||
|
||||
auto tmpD = tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("D", pair_.name()),
|
||||
p.time().timeName(),
|
||||
p.mesh()
|
||||
),
|
||||
p.mesh(),
|
||||
dimensionedScalar(dimArea/dimTime, Zero)
|
||||
);
|
||||
|
||||
auto& D = tmpD.ref();
|
||||
|
||||
forAll(p, cellI)
|
||||
{
|
||||
D[cellI] =
|
||||
fromThermo.alphah(p[cellI], T[cellI])
|
||||
/fromThermo.rho(p[cellI], T[cellI]);
|
||||
}
|
||||
|
||||
D /= Le_;
|
||||
D.correctBoundaryConditions();
|
||||
|
||||
return tmpD;
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::InterfaceCompositionModel<Thermo, OtherThermo>::L
|
||||
(
|
||||
const word& speciesName,
|
||||
const volScalarField& Tf
|
||||
) const
|
||||
{
|
||||
const typename Thermo::thermoType& fromThermo =
|
||||
getLocalThermo(speciesName, fromThermo_);
|
||||
const typename OtherThermo::thermoType& toThermo =
|
||||
getLocalThermo(speciesName, toThermo_);
|
||||
|
||||
const volScalarField& p(fromThermo_.p());
|
||||
|
||||
auto tmpL = tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("L", pair_.name()),
|
||||
p.time().timeName(),
|
||||
p.mesh()
|
||||
),
|
||||
p.mesh(),
|
||||
dimensionedScalar(dimEnergy/dimMass, Zero),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
auto& L = tmpL.ref();
|
||||
|
||||
// from Thermo (from) to Thermo (to)
|
||||
forAll(p, cellI)
|
||||
{
|
||||
L[cellI] = fromThermo.Hc() - toThermo.Hc();
|
||||
}
|
||||
|
||||
L.correctBoundaryConditions();
|
||||
|
||||
return tmpL;
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::InterfaceCompositionModel<Thermo, OtherThermo>::dY
|
||||
(
|
||||
const word& speciesName,
|
||||
const volScalarField& Tf
|
||||
) const
|
||||
{
|
||||
NotImplemented;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::InterfaceCompositionModel<Thermo, OtherThermo>::Yf
|
||||
(
|
||||
const word& speciesName,
|
||||
const volScalarField& Tf
|
||||
) const
|
||||
{
|
||||
NotImplemented;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,276 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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
|
||||
Base class for interface composition models, templated on the two
|
||||
thermodynamic models either side of the interface.
|
||||
|
||||
SourceFiles
|
||||
InterfaceCompositionModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef InterfaceCompositionModel_H
|
||||
#define InterfaceCompositionModel_H
|
||||
|
||||
#include "interfaceCompositionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class phaseModel;
|
||||
class phasePair;
|
||||
template <class ThermoType> class pureMixture;
|
||||
template <class ThermoType> class multiComponentMixture;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class InterfaceCompositionModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
class InterfaceCompositionModel
|
||||
:
|
||||
public interfaceCompositionModel
|
||||
{
|
||||
protected:
|
||||
|
||||
// Private data
|
||||
|
||||
//- Thermo (from)
|
||||
const Thermo& fromThermo_;
|
||||
|
||||
//- Other Thermo (to)
|
||||
const OtherThermo& toThermo_;
|
||||
|
||||
//- Lewis number
|
||||
const dimensionedScalar Le_;
|
||||
|
||||
|
||||
// Private member functions
|
||||
|
||||
//- Get a reference to the local thermo for a pure mixture
|
||||
template<class ThermoType>
|
||||
const typename pureMixture<ThermoType>::thermoType&
|
||||
getLocalThermo
|
||||
(
|
||||
const word& speciesName,
|
||||
const pureMixture<ThermoType>& globalThermo
|
||||
) const;
|
||||
|
||||
//- Get a reference to the local thermo for a multi component mixture
|
||||
template<class ThermoType>
|
||||
const typename multiComponentMixture<ThermoType>::thermoType&
|
||||
getLocalThermo
|
||||
(
|
||||
const word& speciesName,
|
||||
const multiComponentMixture<ThermoType>& globalThermo
|
||||
) const;
|
||||
|
||||
//- Return mass fraction for a pureMixture equal to one
|
||||
template<class ThermoType>
|
||||
tmp<volScalarField> getSpecieMassFraction
|
||||
(
|
||||
const word& speciesName,
|
||||
const pureMixture<ThermoType>& thermo
|
||||
) const;
|
||||
|
||||
//- Return mass fraction for speciesName
|
||||
template<class ThermoType>
|
||||
tmp<volScalarField> getSpecieMassFraction
|
||||
(
|
||||
const word& speciesName,
|
||||
const multiComponentMixture<ThermoType>& thermo
|
||||
) const;
|
||||
|
||||
//- Return moleculas weight of the mixture for pureMixture [Kg/mol]
|
||||
template<class ThermoType>
|
||||
tmp<volScalarField> MwMixture
|
||||
(
|
||||
const pureMixture<ThermoType>& thermo
|
||||
) const;
|
||||
|
||||
//- Return moleculas weight of the mixture for multiComponentMixture
|
||||
// [Kg/mol]
|
||||
template<class ThermoType>
|
||||
tmp<volScalarField> MwMixture
|
||||
(
|
||||
const multiComponentMixture<ThermoType>&
|
||||
) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Construct from components
|
||||
InterfaceCompositionModel(const dictionary& dict, const phasePair& pair);
|
||||
|
||||
//- Destructor
|
||||
~InterfaceCompositionModel() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Mass fraction difference between the interface and the field
|
||||
virtual tmp<volScalarField> dY
|
||||
(
|
||||
const word& speciesName,
|
||||
const volScalarField& Tf
|
||||
) const;
|
||||
|
||||
//- Reference mass fraction for species based models
|
||||
virtual tmp<volScalarField> Yf
|
||||
(
|
||||
const word& speciesName,
|
||||
const volScalarField& Tf
|
||||
) const;
|
||||
|
||||
//- Mass diffusivity of the local thermo
|
||||
virtual tmp<volScalarField> D
|
||||
(
|
||||
const word& speciesName
|
||||
) const;
|
||||
|
||||
//- Latent heat (to - from)(thermo - otherThermo)
|
||||
virtual tmp<volScalarField> L
|
||||
(
|
||||
const word& speciesName,
|
||||
const volScalarField& Tf
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Instantiation for multi-component (from) to single-component (to)
|
||||
#define makeInterfaceDispSpecieMixtureType(Type, Thermo, Comp, Mix, Phys, OtherThermo, OtherComp, OtherMix, OtherPhys)\
|
||||
\
|
||||
typedef Thermo<Comp, SpecieMixture<Mix<Phys>>> \
|
||||
Type##Thermo##Comp##Mix##Phys; \
|
||||
\
|
||||
typedef OtherThermo<OtherComp, OtherMix<OtherPhys>> \
|
||||
Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys; \
|
||||
\
|
||||
addInterfaceCompositionToRunTimeSelectionTable \
|
||||
( \
|
||||
Type, \
|
||||
Type##Thermo##Comp##Mix##Phys, \
|
||||
Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys \
|
||||
)
|
||||
|
||||
|
||||
// Instantiation for single-component (from) to multi-component (to)
|
||||
#define makeInterfaceContSpecieMixtureType(Type, Thermo, Comp, Mix, Phys, OtherThermo, OtherComp, OtherMix, OtherPhys)\
|
||||
\
|
||||
typedef Thermo<Comp, Mix<Phys>> \
|
||||
Type##Thermo##Comp##Mix##Phys; \
|
||||
\
|
||||
typedef OtherThermo<OtherComp, SpecieMixture<OtherMix<OtherPhys>>> \
|
||||
Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys; \
|
||||
\
|
||||
addInterfaceCompositionToRunTimeSelectionTable \
|
||||
( \
|
||||
Type, \
|
||||
Type##Thermo##Comp##Mix##Phys, \
|
||||
Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys \
|
||||
)
|
||||
|
||||
|
||||
// Instantiation for single-component-single-component pairs
|
||||
#define makeInterfacePureType(Type, Thermo, Comp, Mix, Phys, OtherThermo, OtherComp, OtherMix, OtherPhys)\
|
||||
\
|
||||
typedef Thermo<Comp, Mix<Phys>> \
|
||||
Type##Thermo##Comp##Mix##Phys; \
|
||||
\
|
||||
typedef OtherThermo<OtherComp, OtherMix<OtherPhys>> \
|
||||
Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys; \
|
||||
\
|
||||
addInterfaceCompositionToRunTimeSelectionTable \
|
||||
( \
|
||||
Type, \
|
||||
Type##Thermo##Comp##Mix##Phys, \
|
||||
Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys \
|
||||
)
|
||||
|
||||
|
||||
// Instantiation for multi-component-multi-component pairs
|
||||
#define makeSpecieInterfaceSpecieMixtures(Type, Thermo, Comp, Mix, Phys, OtherThermo, OtherComp, OtherMix, OtherPhys)\
|
||||
\
|
||||
typedef Thermo<Comp, SpecieMixture<Mix<Phys>>> \
|
||||
Type##Thermo##Comp##Mix##Phys; \
|
||||
\
|
||||
typedef OtherThermo<OtherComp, SpecieMixture<OtherMix<OtherPhys>>> \
|
||||
Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys; \
|
||||
\
|
||||
addInterfaceCompositionToRunTimeSelectionTable \
|
||||
( \
|
||||
Type, \
|
||||
Type##Thermo##Comp##Mix##Phys, \
|
||||
Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys \
|
||||
)
|
||||
|
||||
|
||||
// Addition to the run-time selection table
|
||||
#define addInterfaceCompositionToRunTimeSelectionTable(Type, Thermo, OtherThermo)\
|
||||
\
|
||||
typedef Type<Thermo, OtherThermo> \
|
||||
Type##Thermo##OtherThermo; \
|
||||
\
|
||||
defineTemplateTypeNameAndDebugWithName \
|
||||
( \
|
||||
Type##Thermo##OtherThermo, \
|
||||
( \
|
||||
word(Type##Thermo##OtherThermo::typeName_()) + "<" \
|
||||
+ word(Thermo::typeName) + "," \
|
||||
+ word(OtherThermo::typeName) + ">" \
|
||||
).c_str(), \
|
||||
0 \
|
||||
); \
|
||||
\
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
interfaceCompositionModel, \
|
||||
Type##Thermo##OtherThermo, \
|
||||
dictionary \
|
||||
)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "InterfaceCompositionModel.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,481 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "thermoPhysicsTypes.H"
|
||||
|
||||
#include "rhoConst.H"
|
||||
#include "perfectFluid.H"
|
||||
#include "Boussinesq.H"
|
||||
|
||||
#include "pureMixture.H"
|
||||
#include "multiComponentMixture.H"
|
||||
#include "reactingMixture.H"
|
||||
#include "SpecieMixture.H"
|
||||
|
||||
#include "rhoThermo.H"
|
||||
#include "rhoReactionThermo.H"
|
||||
#include "heRhoThermo.H"
|
||||
|
||||
#include "solidThermo.H"
|
||||
#include "heSolidThermo.H"
|
||||
#include "solidThermoPhysicsTypes.H"
|
||||
|
||||
#include "kineticGasEvaporation.H"
|
||||
#include "Lee.H"
|
||||
#include "interfaceHeatResistance.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
typedef
|
||||
constTransport
|
||||
<
|
||||
species::thermo
|
||||
<
|
||||
hConstThermo
|
||||
<
|
||||
rhoConst<specie>
|
||||
>,
|
||||
sensibleEnthalpy
|
||||
>
|
||||
> constRhoHThermoPhysics;
|
||||
|
||||
|
||||
typedef
|
||||
constTransport
|
||||
<
|
||||
species::thermo
|
||||
<
|
||||
hConstThermo
|
||||
<
|
||||
Boussinesq<specie>
|
||||
>,
|
||||
sensibleEnthalpy
|
||||
>
|
||||
> BoussinesqFluidEThermoPhysics;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
using namespace meltingEvaporationModels;
|
||||
|
||||
//NOTE: First thermo (from) and second otherThermo (to)
|
||||
|
||||
// kineticGasEvaporation model definitions
|
||||
|
||||
// From pure liquid (rhoConst) to a multi-component gas incomp phase
|
||||
makeInterfaceContSpecieMixtureType
|
||||
(
|
||||
kineticGasEvaporation,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
constRhoHThermoPhysics,
|
||||
heRhoThermo,
|
||||
rhoReactionThermo,
|
||||
multiComponentMixture,
|
||||
constIncompressibleGasHThermoPhysics
|
||||
);
|
||||
|
||||
// From pure liquid (BoussinesqFluid) to a multi-component gas incomp
|
||||
// phase
|
||||
makeInterfaceContSpecieMixtureType
|
||||
(
|
||||
kineticGasEvaporation,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
BoussinesqFluidEThermoPhysics,
|
||||
heRhoThermo,
|
||||
rhoReactionThermo,
|
||||
multiComponentMixture,
|
||||
constIncompressibleGasHThermoPhysics
|
||||
);
|
||||
|
||||
|
||||
// From pure liquid (rhoConst) to pure gas (incompressible ideal gas)
|
||||
makeInterfacePureType
|
||||
(
|
||||
kineticGasEvaporation,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
constRhoHThermoPhysics,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
constIncompressibleGasHThermoPhysics
|
||||
);
|
||||
|
||||
// From pure liquid (const rho) to pure gas (rhoConst) gas
|
||||
makeInterfacePureType
|
||||
(
|
||||
kineticGasEvaporation,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
constRhoHThermoPhysics,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
constRhoHThermoPhysics
|
||||
);
|
||||
|
||||
|
||||
// From pure liquid (Boussinesq) to pure gas (incompressible ideal gas)
|
||||
makeInterfacePureType
|
||||
(
|
||||
kineticGasEvaporation,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
BoussinesqFluidEThermoPhysics,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
constIncompressibleGasHThermoPhysics
|
||||
);
|
||||
|
||||
// From pure liquid (Boussinesq) to pure gas (rho const)
|
||||
makeInterfacePureType
|
||||
(
|
||||
kineticGasEvaporation,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
BoussinesqFluidEThermoPhysics,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
constRhoHThermoPhysics
|
||||
);
|
||||
|
||||
|
||||
// Lee model definitions
|
||||
|
||||
// From pure phase (rho const) to phase (rho const)
|
||||
makeInterfacePureType
|
||||
(
|
||||
Lee,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
constRhoHThermoPhysics,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
constRhoHThermoPhysics
|
||||
);
|
||||
|
||||
// From pure phase (rho const) to phase (Boussinesq)
|
||||
makeInterfacePureType
|
||||
(
|
||||
Lee,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
constRhoHThermoPhysics,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
BoussinesqFluidEThermoPhysics
|
||||
);
|
||||
|
||||
|
||||
// From pure phase (solidThermo) to phase (Boussinesq)
|
||||
makeInterfacePureType
|
||||
(
|
||||
Lee,
|
||||
heSolidThermo,
|
||||
solidThermo,
|
||||
pureMixture,
|
||||
hConstSolidThermoPhysics,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
BoussinesqFluidEThermoPhysics
|
||||
);
|
||||
|
||||
// From pure phase (solidThermo) to phase (rho const)
|
||||
makeInterfacePureType
|
||||
(
|
||||
Lee,
|
||||
heSolidThermo,
|
||||
solidThermo,
|
||||
pureMixture,
|
||||
hConstSolidThermoPhysics,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
constRhoHThermoPhysics
|
||||
);
|
||||
|
||||
// From pure phase (all-poly solidThermo) to phase (ico-rho)
|
||||
makeInterfacePureType
|
||||
(
|
||||
Lee,
|
||||
heSolidThermo,
|
||||
solidThermo,
|
||||
pureMixture,
|
||||
hPolyTranspPolyIcoSolidThermoPhysics,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
icoPoly8HThermoPhysics
|
||||
);
|
||||
|
||||
// From pure phase (exp-Transp, hPower solidThermo) to phase (ico-rho)
|
||||
makeInterfacePureType
|
||||
(
|
||||
Lee,
|
||||
heSolidThermo,
|
||||
solidThermo,
|
||||
pureMixture,
|
||||
hPowerSolidThermoPhysics,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
icoPoly8HThermoPhysics
|
||||
);
|
||||
|
||||
|
||||
// From pure phase (const rho) to multi phase (incomp ideal gas)
|
||||
makeInterfaceContSpecieMixtureType
|
||||
(
|
||||
Lee,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
constRhoHThermoPhysics,
|
||||
heRhoThermo,
|
||||
rhoReactionThermo,
|
||||
multiComponentMixture,
|
||||
constIncompressibleGasHThermoPhysics
|
||||
);
|
||||
|
||||
|
||||
// From pure phase (Boussinesq) to phase (solidThermo)
|
||||
makeInterfacePureType
|
||||
(
|
||||
Lee,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
BoussinesqFluidEThermoPhysics,
|
||||
heSolidThermo,
|
||||
solidThermo,
|
||||
pureMixture,
|
||||
hConstSolidThermoPhysics
|
||||
);
|
||||
|
||||
// From pure phase (rho const) to phase (solidThermo)
|
||||
makeInterfacePureType
|
||||
(
|
||||
Lee,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
constRhoHThermoPhysics,
|
||||
heSolidThermo,
|
||||
solidThermo,
|
||||
pureMixture,
|
||||
hConstSolidThermoPhysics
|
||||
);
|
||||
|
||||
//From pure liquid phase (ico-rho) to pure phase (exp-Transp, hPower solidThermo)
|
||||
makeInterfacePureType
|
||||
(
|
||||
Lee,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
icoPoly8HThermoPhysics,
|
||||
heSolidThermo,
|
||||
solidThermo,
|
||||
pureMixture,
|
||||
hPowerSolidThermoPhysics
|
||||
);
|
||||
|
||||
|
||||
|
||||
// interfaceHeatResistance model definitions
|
||||
|
||||
// From pure phase (rho const) to phase (rho const)
|
||||
makeInterfacePureType
|
||||
(
|
||||
interfaceHeatResistance,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
constRhoHThermoPhysics,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
constRhoHThermoPhysics
|
||||
);
|
||||
|
||||
// From pure phase (rho const) to phase (Boussinesq)
|
||||
makeInterfacePureType
|
||||
(
|
||||
interfaceHeatResistance,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
constRhoHThermoPhysics,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
BoussinesqFluidEThermoPhysics
|
||||
);
|
||||
|
||||
|
||||
// From pure phase (solidThermo) to phase (Boussinesq)
|
||||
makeInterfacePureType
|
||||
(
|
||||
interfaceHeatResistance,
|
||||
heSolidThermo,
|
||||
solidThermo,
|
||||
pureMixture,
|
||||
hConstSolidThermoPhysics,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
BoussinesqFluidEThermoPhysics
|
||||
);
|
||||
|
||||
// From pure phase (solidThermo) to phase (rho const)
|
||||
makeInterfacePureType
|
||||
(
|
||||
interfaceHeatResistance,
|
||||
heSolidThermo,
|
||||
solidThermo,
|
||||
pureMixture,
|
||||
hConstSolidThermoPhysics,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
constRhoHThermoPhysics
|
||||
);
|
||||
|
||||
// From pure phase (all-poly solidThermo) to phase (ico-rho)
|
||||
makeInterfacePureType
|
||||
(
|
||||
interfaceHeatResistance,
|
||||
heSolidThermo,
|
||||
solidThermo,
|
||||
pureMixture,
|
||||
hPolyTranspPolyIcoSolidThermoPhysics,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
icoPoly8HThermoPhysics
|
||||
);
|
||||
|
||||
// From pure phase (exp-Transp, hPower solidThermo) to phase (ico-rho)
|
||||
makeInterfacePureType
|
||||
(
|
||||
interfaceHeatResistance,
|
||||
heSolidThermo,
|
||||
solidThermo,
|
||||
pureMixture,
|
||||
hPowerSolidThermoPhysics,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
icoPoly8HThermoPhysics
|
||||
);
|
||||
|
||||
|
||||
// From pure phase (const rho) to multi phase (incomp ideal gas)
|
||||
makeInterfaceContSpecieMixtureType
|
||||
(
|
||||
interfaceHeatResistance,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
constRhoHThermoPhysics,
|
||||
heRhoThermo,
|
||||
rhoReactionThermo,
|
||||
multiComponentMixture,
|
||||
constIncompressibleGasHThermoPhysics
|
||||
);
|
||||
|
||||
|
||||
// From pure phase (Boussinesq) to phase (solidThermo)
|
||||
makeInterfacePureType
|
||||
(
|
||||
interfaceHeatResistance,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
BoussinesqFluidEThermoPhysics,
|
||||
heSolidThermo,
|
||||
solidThermo,
|
||||
pureMixture,
|
||||
hConstSolidThermoPhysics
|
||||
);
|
||||
|
||||
// From pure phase (rho const) to phase (solidThermo)
|
||||
makeInterfacePureType
|
||||
(
|
||||
interfaceHeatResistance,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
constRhoHThermoPhysics,
|
||||
heSolidThermo,
|
||||
solidThermo,
|
||||
pureMixture,
|
||||
hConstSolidThermoPhysics
|
||||
);
|
||||
|
||||
//From pure liquid phase (ico-rho) to pure phase (exp-Transp, hPower solidThermo)
|
||||
makeInterfacePureType
|
||||
(
|
||||
interfaceHeatResistance,
|
||||
heRhoThermo,
|
||||
rhoThermo,
|
||||
pureMixture,
|
||||
icoPoly8HThermoPhysics,
|
||||
heSolidThermo,
|
||||
solidThermo,
|
||||
pureMixture,
|
||||
hPowerSolidThermoPhysics
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,189 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "Lee.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
Foam::meltingEvaporationModels::Lee<Thermo, OtherThermo>::Lee
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phasePair& pair
|
||||
)
|
||||
:
|
||||
InterfaceCompositionModel<Thermo, OtherThermo>(dict, pair),
|
||||
C_("C", inv(dimTime), dict),
|
||||
Tactivate_("Tactivate", dimTemperature, dict),
|
||||
alphaMin_(dict.getOrDefault<scalar>("alphaMin", 0))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::meltingEvaporationModels::Lee<Thermo, OtherThermo>::Kexp
|
||||
(
|
||||
const volScalarField& refValue
|
||||
)
|
||||
{
|
||||
{
|
||||
const volScalarField from
|
||||
(
|
||||
min(max(this->pair().from(), scalar(0)), scalar(1))
|
||||
);
|
||||
|
||||
const volScalarField coeff
|
||||
(
|
||||
C_*from*this->pair().from().rho()*pos(from - alphaMin_)
|
||||
*(refValue - Tactivate_)
|
||||
/Tactivate_
|
||||
);
|
||||
|
||||
if (sign(C_.value()) > 0)
|
||||
{
|
||||
return
|
||||
(
|
||||
coeff*pos(refValue - Tactivate_)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return
|
||||
(
|
||||
coeff*pos(Tactivate_ - refValue)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::meltingEvaporationModels::Lee<Thermo, OtherThermo>::KSp
|
||||
(
|
||||
label variable,
|
||||
const volScalarField& refValue
|
||||
)
|
||||
{
|
||||
if (this->modelVariable_ == variable)
|
||||
{
|
||||
volScalarField from
|
||||
(
|
||||
min(max(this->pair().from(), scalar(0)), scalar(1))
|
||||
);
|
||||
|
||||
const volScalarField coeff
|
||||
(
|
||||
C_*from*this->pair().from().rho()*pos(from - alphaMin_)
|
||||
/Tactivate_
|
||||
);
|
||||
|
||||
if (sign(C_.value()) > 0)
|
||||
{
|
||||
return
|
||||
(
|
||||
coeff*pos(refValue - Tactivate_)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return
|
||||
(
|
||||
coeff*pos(Tactivate_ - refValue)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return tmp<volScalarField> ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::meltingEvaporationModels::Lee<Thermo, OtherThermo>::KSu
|
||||
(
|
||||
label variable,
|
||||
const volScalarField& refValue
|
||||
)
|
||||
{
|
||||
if (this->modelVariable_ == variable)
|
||||
{
|
||||
volScalarField from
|
||||
(
|
||||
min(max(this->pair().from(), scalar(0)), scalar(1))
|
||||
);
|
||||
|
||||
const volScalarField coeff
|
||||
(
|
||||
C_*from*this->pair().from().rho()*pos(from - alphaMin_)
|
||||
);
|
||||
|
||||
if (sign(C_.value()) > 0)
|
||||
{
|
||||
return
|
||||
(
|
||||
-coeff*pos(refValue - Tactivate_)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return
|
||||
(
|
||||
coeff*pos(Tactivate_ - refValue)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return tmp<volScalarField> ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
const Foam::dimensionedScalar&
|
||||
Foam::meltingEvaporationModels::Lee<Thermo, OtherThermo>::Tactivate() const
|
||||
{
|
||||
return Tactivate_;
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
bool
|
||||
Foam::meltingEvaporationModels::Lee<Thermo, OtherThermo>::includeDivU()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,191 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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::meltingEvaporationModels::Lee
|
||||
|
||||
Description
|
||||
Mass transfer Lee model. Simple model driven by field value difference as:
|
||||
|
||||
\f[
|
||||
\dot{m} = C \rho \alpha (T - T_{activate})/T_{activate}
|
||||
\f]
|
||||
|
||||
where C is a model constant.
|
||||
|
||||
if C > 0:
|
||||
\f[
|
||||
\dot{m} = C \rho \alpha (T - T_{activate})/T_{activate}
|
||||
\f]
|
||||
for \f[ T > T_{activate} \f]
|
||||
|
||||
and
|
||||
|
||||
\f[ mDot = 0.0 \f] for \f[ T < T_{activate} \f]
|
||||
|
||||
|
||||
if C < 0:
|
||||
\f[
|
||||
\dot{m} = -C \rho \alpha (T_{activate} - T)/T_{activate}
|
||||
\f]
|
||||
for \f[ T < T_{activate} \f]
|
||||
|
||||
and
|
||||
\f[ \dot{m} = 0.0 \f] for \f[ T > T_{activate} \f]
|
||||
|
||||
Based on the reference:
|
||||
-# W. H. Lee. "A Pressure Iteration Scheme for Two-Phase Modeling".
|
||||
Technical Report LA-UR 79-975. Los Alamos Scientific Laboratory,
|
||||
Los Alamos, New Mexico. 1979.
|
||||
|
||||
Usage
|
||||
Example usage:
|
||||
\verbatim
|
||||
massTransferModel
|
||||
(
|
||||
(solid to liquid)
|
||||
{
|
||||
type Lee;
|
||||
C 40;
|
||||
Tactivate 302.78;
|
||||
}
|
||||
);
|
||||
\endverbatim
|
||||
|
||||
Where:
|
||||
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
Tactivate | Activation temperature | yes
|
||||
C | Model constant | yes
|
||||
includeVolChange | Volumen change | no | yes
|
||||
species | Specie name on the other phase | no | none
|
||||
\endtable
|
||||
|
||||
SourceFiles
|
||||
Lee.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef meltingEvaporationModels_Lee_H
|
||||
#define meltingEvaporationModels_Lee_H
|
||||
|
||||
#include "InterfaceCompositionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace meltingEvaporationModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class Lee Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
class Lee
|
||||
:
|
||||
public InterfaceCompositionModel<Thermo, OtherThermo>
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Condensation coefficient [1/s]
|
||||
dimensionedScalar C_;
|
||||
|
||||
//- Phase transition temperature
|
||||
const dimensionedScalar Tactivate_;
|
||||
|
||||
//- Phase minimum value for activation
|
||||
scalar alphaMin_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("Lee");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
Lee
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phasePair& pair
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~Lee() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Explicit total mass transfer coefficient
|
||||
virtual tmp<volScalarField> Kexp
|
||||
(
|
||||
const volScalarField& field
|
||||
);
|
||||
|
||||
//- Implicit mass transfer coefficient
|
||||
virtual tmp<volScalarField> KSp
|
||||
(
|
||||
label modelVariable,
|
||||
const volScalarField& field
|
||||
);
|
||||
|
||||
//- Explicit mass transfer coefficient
|
||||
virtual tmp<volScalarField> KSu
|
||||
(
|
||||
label modelVariable,
|
||||
const volScalarField& field
|
||||
);
|
||||
|
||||
//- Return T transition between phases
|
||||
virtual const dimensionedScalar& Tactivate() const;
|
||||
|
||||
//- Add/subtract alpha*div(U) as a source term
|
||||
//- for alpha, substituting div(U) = mDot(1/rho1 - 1/rho2)
|
||||
virtual bool includeDivU();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace meltingEvaporationModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "Lee.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,6 @@
|
||||
interfaceCompositionModel/interfaceCompositionModel.C
|
||||
interfaceCompositionModel/interfaceCompositionModelNew.C
|
||||
|
||||
InterfaceCompositionModel/InterfaceCompositionModels.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libmassTransferModels
|
||||
@ -0,0 +1,20 @@
|
||||
EXE_INC = \
|
||||
-I../phasesSystem/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/geometricVoF/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lfluidThermophysicalModels \
|
||||
-lreactionThermophysicalModels \
|
||||
-lsolidThermo \
|
||||
-lsolidSpecie \
|
||||
-lgeometricVoF
|
||||
@ -0,0 +1,106 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "phasePair.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(interfaceCompositionModel, 0);
|
||||
defineRunTimeSelectionTable(interfaceCompositionModel, dictionary);
|
||||
}
|
||||
|
||||
|
||||
const Foam::Enum<Foam::interfaceCompositionModel::modelVariable>
|
||||
Foam::interfaceCompositionModel::modelVariableNames
|
||||
{
|
||||
{ modelVariable::T, "temperature" },
|
||||
{ modelVariable::P, "pressure" },
|
||||
{ modelVariable::Y, "massFraction" },
|
||||
{ modelVariable::alpha, "alphaVolumeFraction" },
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::interfaceCompositionModel::interfaceCompositionModel
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phasePair& pair
|
||||
)
|
||||
:
|
||||
modelVariable_
|
||||
(
|
||||
modelVariableNames.getOrDefault
|
||||
(
|
||||
"variable",
|
||||
dict,
|
||||
modelVariable::T
|
||||
)
|
||||
),
|
||||
includeVolChange_(dict.getOrDefault("includeVolChange", true)),
|
||||
pair_(pair),
|
||||
speciesName_(dict.getOrDefault<word>("species", "none")),
|
||||
mesh_(pair_.from().mesh())
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::word Foam::interfaceCompositionModel::transferSpecie() const
|
||||
{
|
||||
return speciesName_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::phasePair& Foam::interfaceCompositionModel::pair() const
|
||||
{
|
||||
return pair_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::word Foam::interfaceCompositionModel::variable() const
|
||||
{
|
||||
return modelVariableNames[modelVariable_];
|
||||
}
|
||||
|
||||
|
||||
bool Foam::interfaceCompositionModel::includeDivU()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::interfaceCompositionModel::includeVolChange()
|
||||
{
|
||||
return includeVolChange_;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,221 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 models. Mass transfer models are
|
||||
interface models between two thermos.
|
||||
Abstract class for mass transfer functions
|
||||
|
||||
SourceFiles
|
||||
interfaceCompositionModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef interfaceCompositionModel_H
|
||||
#define interfaceCompositionModel_H
|
||||
|
||||
#include "volFields.H"
|
||||
#include "dictionary.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "Enum.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward Declarations
|
||||
class phaseModel;
|
||||
class phasePair;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class interfaceCompositionModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class interfaceCompositionModel
|
||||
{
|
||||
public:
|
||||
|
||||
// Public type
|
||||
|
||||
//- Enumeration for variable based mass transfer models
|
||||
enum modelVariable
|
||||
{
|
||||
T, /* temperature based */
|
||||
P, /* pressure based */
|
||||
Y, /* mass fraction based */
|
||||
alpha /* alpha source */
|
||||
};
|
||||
|
||||
static const Enum<modelVariable> modelVariableNames;
|
||||
|
||||
//- Enumeration for model variables
|
||||
modelVariable modelVariable_;
|
||||
|
||||
//- Add volume change in pEq
|
||||
bool includeVolChange_;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected Data
|
||||
|
||||
//- Phase pair
|
||||
const phasePair& pair_;
|
||||
|
||||
//- Names of the transferring specie
|
||||
word speciesName_;
|
||||
|
||||
//- Reference to mesh
|
||||
const fvMesh& mesh_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("interfaceCompositionModel");
|
||||
|
||||
|
||||
// Declare runtime construction
|
||||
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
interfaceCompositionModel,
|
||||
dictionary,
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phasePair& pair
|
||||
),
|
||||
(dict, pair)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from a dictionary and a phase pair
|
||||
interfaceCompositionModel
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phasePair& pair
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~interfaceCompositionModel() = default;
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
static autoPtr<interfaceCompositionModel> New
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phasePair& pair
|
||||
);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
|
||||
//- Return the transferring species name
|
||||
const word transferSpecie() const;
|
||||
|
||||
//- Return pair
|
||||
const phasePair& pair() const;
|
||||
|
||||
//- Interface mass fraction
|
||||
virtual tmp<volScalarField> Yf
|
||||
(
|
||||
const word& speciesName,
|
||||
const volScalarField& Tf
|
||||
) const = 0;
|
||||
|
||||
//- Mass fraction difference between the interface and the field
|
||||
virtual tmp<volScalarField> dY
|
||||
(
|
||||
const word& speciesName,
|
||||
const volScalarField& Tf
|
||||
) const = 0;
|
||||
|
||||
//- Mass diffusivity
|
||||
virtual tmp<volScalarField> D
|
||||
(
|
||||
const word& speciesName
|
||||
) const = 0;
|
||||
|
||||
//- Latent heat (delta Hc)
|
||||
virtual tmp<volScalarField> L
|
||||
(
|
||||
const word& speciesName,
|
||||
const volScalarField& Tf
|
||||
) const = 0;
|
||||
|
||||
//- Explicit full mass transfer
|
||||
virtual tmp<volScalarField> Kexp
|
||||
(
|
||||
const volScalarField& field
|
||||
) = 0;
|
||||
|
||||
//- Implicit mass transfer
|
||||
virtual tmp<volScalarField> KSp
|
||||
(
|
||||
label modelVariable,
|
||||
const volScalarField& field
|
||||
) = 0;
|
||||
|
||||
//- Explicit mass transfer
|
||||
virtual tmp<volScalarField> KSu
|
||||
(
|
||||
label modelVariable,
|
||||
const volScalarField& field
|
||||
) = 0;
|
||||
|
||||
//- Reference value
|
||||
virtual const dimensionedScalar& Tactivate() const = 0;
|
||||
|
||||
//- Add/subtract alpha*div(U) as a source term
|
||||
//- for alpha, substituting div(U) = mDot(1/rho1 - 1/rho2)
|
||||
virtual bool includeDivU();
|
||||
|
||||
//- Add volume change in pEq
|
||||
bool includeVolChange();
|
||||
|
||||
//- Returns the variable on which the model is based
|
||||
const word variable() const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,72 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "phasePair.H"
|
||||
#include "rhoThermo.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::interfaceCompositionModel>
|
||||
Foam::interfaceCompositionModel::New
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phasePair& pair
|
||||
)
|
||||
{
|
||||
const word modelType
|
||||
(
|
||||
dict.get<word>("type")
|
||||
+ "<"
|
||||
+ pair.phase1().thermo().type()
|
||||
+ ","
|
||||
+ pair.phase2().thermo().type()
|
||||
+ ">"
|
||||
);
|
||||
|
||||
Info<< "Selecting interfaceCompositionModel for "
|
||||
<< pair << ": " << modelType << endl;
|
||||
|
||||
const auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
dict,
|
||||
"interfaceCompositionModel",
|
||||
modelType,
|
||||
*dictionaryConstructorTablePtr_
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()(dict, pair);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,337 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020 Henning Scheufler
|
||||
-------------------------------------------------------------------------------
|
||||
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 "interfaceHeatResistance.H"
|
||||
#include "constants.H"
|
||||
#include "cutCellIso.H"
|
||||
#include "volPointInterpolation.H"
|
||||
#include "wallPolyPatch.H"
|
||||
#include "fvcSmooth.H"
|
||||
|
||||
using namespace Foam::constant;
|
||||
|
||||
|
||||
// * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
void Foam::meltingEvaporationModels::
|
||||
interfaceHeatResistance<Thermo, OtherThermo>
|
||||
::updateInterface(const volScalarField& T)
|
||||
{
|
||||
const fvMesh& mesh = this->mesh_;
|
||||
|
||||
const volScalarField& alpha = this->pair().from();
|
||||
|
||||
scalarField ap
|
||||
(
|
||||
volPointInterpolation::New(mesh).interpolate(alpha)
|
||||
);
|
||||
|
||||
cutCellIso cutCell(mesh, ap);
|
||||
|
||||
forAll(interfaceArea_, celli)
|
||||
{
|
||||
label status = cutCell.calcSubCell(celli, isoAlpha_);
|
||||
interfaceArea_[celli] = 0;
|
||||
if (status == 0) // cell is cut
|
||||
{
|
||||
interfaceArea_[celli] =
|
||||
mag(cutCell.faceArea())/mesh.V()[celli];
|
||||
}
|
||||
}
|
||||
|
||||
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||
|
||||
forAll(pbm, patchi)
|
||||
{
|
||||
if (isA<wallPolyPatch>(pbm[patchi]))
|
||||
{
|
||||
const polyPatch& pp = pbm[patchi];
|
||||
forAll(pp.faceCells(), faceI)
|
||||
{
|
||||
const label pCelli = pp.faceCells()[faceI];
|
||||
bool interface(false);
|
||||
if
|
||||
(
|
||||
sign(R_.value()) > 0
|
||||
&& (T[pCelli] - Tactivate_.value()) > 0
|
||||
)
|
||||
{
|
||||
interface = true;
|
||||
}
|
||||
|
||||
if
|
||||
(
|
||||
sign(R_.value()) < 0
|
||||
&& (T[pCelli] - Tactivate_.value()) < 0
|
||||
)
|
||||
{
|
||||
interface = true;
|
||||
}
|
||||
|
||||
if
|
||||
(
|
||||
interface
|
||||
&&
|
||||
(
|
||||
alpha[pCelli] < 2*isoAlpha_
|
||||
&& alpha[pCelli] > 0.5*isoAlpha_
|
||||
)
|
||||
)
|
||||
{
|
||||
interfaceArea_[pCelli] =
|
||||
mag(pp.faceAreas()[faceI])/mesh.V()[pCelli];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
Foam::meltingEvaporationModels::interfaceHeatResistance<Thermo, OtherThermo>
|
||||
::interfaceHeatResistance
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phasePair& pair
|
||||
)
|
||||
:
|
||||
InterfaceCompositionModel<Thermo, OtherThermo>(dict, pair),
|
||||
R_("R", dimPower/dimArea/dimTemperature, dict),
|
||||
Tactivate_("Tactivate", dimTemperature, dict),
|
||||
interfaceArea_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"interfaceArea",
|
||||
this->mesh_.time().timeName(),
|
||||
this->mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
this->mesh_,
|
||||
dimensionedScalar(dimless/dimLength, Zero)
|
||||
),
|
||||
mDotc_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"mDotc",
|
||||
this->mesh_.time().timeName(),
|
||||
this->mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
this->mesh_,
|
||||
dimensionedScalar(dimDensity/dimTime, Zero)
|
||||
),
|
||||
mDotcSpread_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"mDotcSpread",
|
||||
this->mesh_.time().timeName(),
|
||||
this->mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
this->mesh_,
|
||||
dimensionedScalar(dimDensity/dimTime, Zero)
|
||||
),
|
||||
htc_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"htc",
|
||||
this->mesh_.time().timeName(),
|
||||
this->mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
this->mesh_,
|
||||
dimensionedScalar(dimMass/dimArea/dimTemperature/dimTime, Zero)
|
||||
),
|
||||
isoAlpha_(dict.getOrDefault<scalar>("isoAlpha", 0.5)),
|
||||
spread_(dict.getOrDefault<scalar>("spread", 3))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::meltingEvaporationModels::interfaceHeatResistance<Thermo, OtherThermo>
|
||||
::Kexp(const volScalarField& T)
|
||||
{
|
||||
|
||||
const fvMesh& mesh = this->mesh_;
|
||||
|
||||
updateInterface(T);
|
||||
|
||||
auto tdeltaT = tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tdeltaT",
|
||||
mesh.time().timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(dimTemperature, Zero)
|
||||
);
|
||||
auto& deltaT = tdeltaT.ref();
|
||||
|
||||
const dimensionedScalar T0(dimTemperature, Zero);
|
||||
|
||||
if (sign(R_.value()) > 0)
|
||||
{
|
||||
deltaT = max(T - Tactivate_, T0);
|
||||
}
|
||||
else
|
||||
{
|
||||
deltaT = max(Tactivate_ - T, T0);
|
||||
}
|
||||
|
||||
word fullSpeciesName = this->transferSpecie();
|
||||
auto tempOpen = fullSpeciesName.find('.');
|
||||
const word speciesName(fullSpeciesName.substr(0, tempOpen));
|
||||
|
||||
tmp<volScalarField> L = this->L(speciesName, T);
|
||||
|
||||
htc_ = R_/L();
|
||||
|
||||
const volScalarField& to = this->pair().to();
|
||||
const volScalarField& from = this->pair().from();
|
||||
|
||||
dimensionedScalar D
|
||||
(
|
||||
"D",
|
||||
dimArea,
|
||||
spread_/sqr(gAverage(this->mesh_.nonOrthDeltaCoeffs()))
|
||||
);
|
||||
|
||||
const dimensionedScalar MdotMin("MdotMin", mDotc_.dimensions(), 1e-3);
|
||||
|
||||
if (max(mDotc_) > MdotMin)
|
||||
{
|
||||
fvc::spreadSource
|
||||
(
|
||||
mDotcSpread_,
|
||||
mDotc_,
|
||||
from,
|
||||
to,
|
||||
D,
|
||||
1e-3
|
||||
);
|
||||
}
|
||||
|
||||
mDotc_ = interfaceArea_*htc_*deltaT;
|
||||
|
||||
return tmp<volScalarField>::New(mDotc_);
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::meltingEvaporationModels::interfaceHeatResistance<Thermo, OtherThermo>
|
||||
::KSp
|
||||
(
|
||||
label variable,
|
||||
const volScalarField& refValue
|
||||
)
|
||||
{
|
||||
if (this->modelVariable_ == variable)
|
||||
{
|
||||
const volScalarField coeff(htc_*interfaceArea_);
|
||||
|
||||
if (sign(R_.value()) > 0)
|
||||
{
|
||||
return(coeff*pos(refValue - Tactivate_));
|
||||
}
|
||||
else
|
||||
{
|
||||
return(coeff*pos(Tactivate_ - refValue));
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::meltingEvaporationModels::interfaceHeatResistance<Thermo, OtherThermo>
|
||||
::KSu
|
||||
(
|
||||
label variable,
|
||||
const volScalarField& refValue
|
||||
)
|
||||
{
|
||||
if (this->modelVariable_ == variable)
|
||||
{
|
||||
const volScalarField coeff(htc_*interfaceArea_*Tactivate_);
|
||||
|
||||
if (sign(R_.value()) > 0)
|
||||
{
|
||||
return(-coeff*pos(refValue - Tactivate_));
|
||||
}
|
||||
else
|
||||
{
|
||||
return(coeff*pos(Tactivate_ - refValue));
|
||||
}
|
||||
}
|
||||
else if (interfaceCompositionModel::P == variable)
|
||||
{
|
||||
return tmp<volScalarField>::New(mDotcSpread_);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
const Foam::dimensionedScalar&
|
||||
Foam::meltingEvaporationModels::interfaceHeatResistance<Thermo, OtherThermo>
|
||||
::Tactivate() const
|
||||
{
|
||||
return Tactivate_;
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
bool
|
||||
Foam::meltingEvaporationModels::
|
||||
interfaceHeatResistance<Thermo, OtherThermo>::includeDivU()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,196 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020 Henning Scheufler
|
||||
-------------------------------------------------------------------------------
|
||||
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::meltingEvaporationModels::interfaceHeatResistance
|
||||
|
||||
Description
|
||||
Interface Heat Resistance type of condensation/saturation model using
|
||||
spread source distribution following:
|
||||
|
||||
References:
|
||||
\verbatim
|
||||
Hardt, S., Wondra, F. (2008).
|
||||
Evaporation model for interfacial flows based on a continuum-
|
||||
field representation of the source term
|
||||
Journal of Computational Physics 227 (2008), 5871-5895
|
||||
\endverbatim
|
||||
|
||||
|
||||
Usage
|
||||
|
||||
Example usage:
|
||||
\verbatim
|
||||
massTransferModel
|
||||
(
|
||||
(liquid to gas)
|
||||
{
|
||||
type interfaceHeatResistance;
|
||||
R 2e6;
|
||||
Tactivate 373;
|
||||
}
|
||||
);
|
||||
\endverbatim
|
||||
|
||||
where:
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
R | Heat transfer coefficient | yes
|
||||
includeVolChange | Volumen change | no | yes
|
||||
isoAlpha | iso-alpha for interface | no | 0.5
|
||||
Tactivate | Saturation temperature | yes
|
||||
species | Specie name on the other phase | no | none
|
||||
spread | Cells to spread the source for pEq | no | 3
|
||||
\endtable
|
||||
|
||||
SourceFiles
|
||||
interfaceHeatResistance.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef meltingEvaporationModels_interfaceHeatResistance_H
|
||||
#define meltingEvaporationModels_interfaceHeatResistance_H
|
||||
|
||||
#include "InterfaceCompositionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward Declarations
|
||||
class phasePair;
|
||||
|
||||
namespace meltingEvaporationModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class interfaceHeatResistance Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
class interfaceHeatResistance
|
||||
:
|
||||
public InterfaceCompositionModel<Thermo, OtherThermo>
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Heat transfer coefficient [1/s/K]
|
||||
dimensionedScalar R_;
|
||||
|
||||
//- Activation temperature
|
||||
const dimensionedScalar Tactivate_;
|
||||
|
||||
//- Interface area
|
||||
volScalarField interfaceArea_;
|
||||
|
||||
//- Mass source
|
||||
volScalarField mDotc_;
|
||||
|
||||
//- Spread mass source
|
||||
volScalarField mDotcSpread_;
|
||||
|
||||
//- Heat transfer coefficient
|
||||
volScalarField htc_;
|
||||
|
||||
//- Interface Iso-value
|
||||
scalar isoAlpha_;
|
||||
|
||||
//- Spread for mass source
|
||||
scalar spread_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Update interface
|
||||
void updateInterface(const volScalarField& T);
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("interfaceHeatResistance");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
interfaceHeatResistance
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phasePair& pair
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~interfaceHeatResistance() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Explicit total mass transfer coefficient
|
||||
virtual tmp<volScalarField> Kexp
|
||||
(
|
||||
const volScalarField& field
|
||||
);
|
||||
|
||||
//- Implicit mass transfer coefficient
|
||||
virtual tmp<volScalarField> KSp
|
||||
(
|
||||
label modelVariable,
|
||||
const volScalarField& field
|
||||
);
|
||||
|
||||
//- Explicit mass transfer coefficient
|
||||
virtual tmp<volScalarField> KSu
|
||||
(
|
||||
label modelVariable,
|
||||
const volScalarField& field
|
||||
);
|
||||
|
||||
//- Return Tactivate
|
||||
virtual const dimensionedScalar& Tactivate() const;
|
||||
|
||||
//- Add/subtract alpha*div(U) as a source term
|
||||
//- for alpha, substituting div(U) = mDot(1/rho1 - 1/rho2)
|
||||
virtual bool includeDivU();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace meltingEvaporationModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "interfaceHeatResistance.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,339 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "kineticGasEvaporation.H"
|
||||
#include "constants.H"
|
||||
#include "cutCellIso.H"
|
||||
#include "volPointInterpolation.H"
|
||||
#include "wallPolyPatch.H"
|
||||
#include "fvcSmooth.H"
|
||||
|
||||
using namespace Foam::constant;
|
||||
|
||||
|
||||
// * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
void Foam::meltingEvaporationModels::kineticGasEvaporation<Thermo, OtherThermo>
|
||||
::updateInterface(const volScalarField& T)
|
||||
{
|
||||
const fvMesh& mesh = this->mesh_;
|
||||
|
||||
const volScalarField& alpha = this->pair().from();
|
||||
|
||||
scalarField ap
|
||||
(
|
||||
volPointInterpolation::New(mesh).interpolate(alpha)
|
||||
);
|
||||
|
||||
cutCellIso cutCell(mesh, ap);
|
||||
|
||||
forAll(interfaceArea_, celli)
|
||||
{
|
||||
label status = cutCell.calcSubCell(celli, isoAlpha_);
|
||||
interfaceArea_[celli] = 0;
|
||||
if (status == 0) // cell is cut
|
||||
{
|
||||
interfaceArea_[celli] =
|
||||
mag(cutCell.faceArea())/mesh.V()[celli];
|
||||
}
|
||||
}
|
||||
|
||||
for (const polyPatch& pp : mesh.boundaryMesh())
|
||||
{
|
||||
if (isA<wallPolyPatch>(pp))
|
||||
{
|
||||
forAll(pp.faceCells(), faceI)
|
||||
{
|
||||
const label pCelli = pp.faceCells()[faceI];
|
||||
bool interface(false);
|
||||
if
|
||||
(
|
||||
sign(C_.value()) > 0
|
||||
&& (T[pCelli] - Tactivate_.value()) > 0
|
||||
)
|
||||
{
|
||||
interface = true;
|
||||
}
|
||||
|
||||
if
|
||||
(
|
||||
sign(C_.value()) < 0
|
||||
&& (T[pCelli] - Tactivate_.value()) < 0
|
||||
)
|
||||
{
|
||||
interface = true;
|
||||
}
|
||||
|
||||
if
|
||||
(
|
||||
interface
|
||||
&&
|
||||
(
|
||||
alpha[pCelli] < 2*isoAlpha_
|
||||
&& alpha[pCelli] > 0.5*isoAlpha_
|
||||
)
|
||||
)
|
||||
{
|
||||
interfaceArea_[pCelli] =
|
||||
mag(pp.faceAreas()[faceI])/mesh.V()[pCelli];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
Foam::meltingEvaporationModels::kineticGasEvaporation<Thermo, OtherThermo>
|
||||
::kineticGasEvaporation
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phasePair& pair
|
||||
)
|
||||
:
|
||||
InterfaceCompositionModel<Thermo, OtherThermo>(dict, pair),
|
||||
C_("C", dimless, dict),
|
||||
Tactivate_("Tactivate", dimTemperature, dict),
|
||||
Mv_("Mv", dimMass/dimMoles, -1, dict),
|
||||
interfaceArea_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"interfaceArea",
|
||||
this->mesh_.time().timeName(),
|
||||
this->mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
this->mesh_,
|
||||
dimensionedScalar(dimless/dimLength, Zero)
|
||||
),
|
||||
htc_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"htc",
|
||||
this->mesh_.time().timeName(),
|
||||
this->mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
this->mesh_,
|
||||
dimensionedScalar(dimMass/dimArea/dimTemperature/dimTime, Zero)
|
||||
),
|
||||
mDotc_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"mDotc",
|
||||
this->mesh_.time().timeName(),
|
||||
this->mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
this->mesh_,
|
||||
dimensionedScalar(dimDensity/dimTime, Zero)
|
||||
),
|
||||
isoAlpha_(dict.getOrDefault<scalar>("isoAlpha", 0.5))
|
||||
{
|
||||
word speciesName = IOobject::member(this->transferSpecie());
|
||||
|
||||
// Get the "to" thermo
|
||||
const typename OtherThermo::thermoType& toThermo =
|
||||
this->getLocalThermo
|
||||
(
|
||||
speciesName,
|
||||
this->toThermo_
|
||||
);
|
||||
|
||||
// Convert from g/mol to Kg/mol
|
||||
Mv_.value() = toThermo.W()*1e-3;
|
||||
|
||||
if (Mv_.value() == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< " Please provide the molar weight (Mv) of vapour [g/mol] "
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::meltingEvaporationModels::kineticGasEvaporation<Thermo, OtherThermo>
|
||||
::Kexp(const volScalarField& T)
|
||||
{
|
||||
|
||||
const fvMesh& mesh = this->mesh_;
|
||||
|
||||
const dimensionedScalar HerztKnudsConst
|
||||
(
|
||||
sqrt
|
||||
(
|
||||
2.0*mathematical::pi
|
||||
* pow3(Tactivate_)
|
||||
* constant::physicoChemical::R/Mv_
|
||||
)
|
||||
);
|
||||
|
||||
word speciesName = IOobject::member(this->transferSpecie());
|
||||
tmp<volScalarField> L = this->L(speciesName, T);
|
||||
|
||||
updateInterface(T);
|
||||
|
||||
tmp<volScalarField> tRhov
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tRhov",
|
||||
mesh.time().timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(dimDensity, Zero)
|
||||
)
|
||||
);
|
||||
volScalarField& rhov = tRhov.ref();
|
||||
|
||||
tmp<volScalarField> tdeltaT
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tdeltaT",
|
||||
mesh.time().timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(dimTemperature, Zero)
|
||||
)
|
||||
);
|
||||
volScalarField& deltaT = tdeltaT.ref();
|
||||
|
||||
dimensionedScalar T0("T0", dimTemperature, Zero);
|
||||
|
||||
if (sign(C_.value()) > 0)
|
||||
{
|
||||
rhov = this->pair().to().rho();
|
||||
deltaT = max(T - Tactivate_, T0);
|
||||
}
|
||||
else
|
||||
{
|
||||
rhov = this->pair().from().rho();
|
||||
deltaT = max(Tactivate_ - T, T0);
|
||||
}
|
||||
|
||||
htc_ = 2*mag(C_)/(2-mag(C_))*(L()*rhov/HerztKnudsConst);
|
||||
|
||||
mDotc_ = htc_*deltaT*interfaceArea_;
|
||||
|
||||
return tmp<volScalarField>(new volScalarField(mDotc_));
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::meltingEvaporationModels::kineticGasEvaporation<Thermo, OtherThermo>::KSp
|
||||
(
|
||||
label variable,
|
||||
const volScalarField& refValue
|
||||
)
|
||||
{
|
||||
if (this->modelVariable_ == variable)
|
||||
{
|
||||
const volScalarField coeff(htc_*interfaceArea_);
|
||||
|
||||
if (sign(C_.value()) > 0)
|
||||
{
|
||||
return(coeff*pos(refValue - Tactivate_));
|
||||
}
|
||||
else
|
||||
{
|
||||
return(coeff*pos(Tactivate_ - refValue));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return tmp<volScalarField> ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::meltingEvaporationModels::kineticGasEvaporation<Thermo, OtherThermo>::KSu
|
||||
(
|
||||
label variable,
|
||||
const volScalarField& refValue
|
||||
)
|
||||
{
|
||||
if (this->modelVariable_ == variable)
|
||||
{
|
||||
const volScalarField coeff(htc_*interfaceArea_*Tactivate_);
|
||||
|
||||
if (sign(C_.value()) > 0)
|
||||
{
|
||||
return(-coeff*pos(refValue - Tactivate_));
|
||||
}
|
||||
else
|
||||
{
|
||||
return(coeff*pos(Tactivate_ - refValue));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return tmp<volScalarField> ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
const Foam::dimensionedScalar&
|
||||
Foam::meltingEvaporationModels::kineticGasEvaporation<Thermo, OtherThermo>
|
||||
::Tactivate() const
|
||||
{
|
||||
return Tactivate_;
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
bool
|
||||
Foam::meltingEvaporationModels::
|
||||
kineticGasEvaporation<Thermo, OtherThermo>::includeDivU()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,235 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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::meltingEvaporationModels::kineticGasEvaporation
|
||||
|
||||
Description
|
||||
Considering the Hertz Knudsen formula, which gives the
|
||||
evaporation-condensation flux based on the kinetic theory for flat
|
||||
interface:
|
||||
|
||||
\f[
|
||||
Flux = C \sqrt{\frac{M}{2 \pi R T_{activate}}}(p - p_{sat})
|
||||
\f]
|
||||
|
||||
where:
|
||||
\vartable
|
||||
Flux | mass flux rate [kg/s/m2]
|
||||
M | molecular weight
|
||||
T_{activate} | saturation temperature
|
||||
C | accommodation coefficient
|
||||
R | universal gas constant
|
||||
p_{sat} | saturation pressure
|
||||
p | vapor partial pressure
|
||||
\endvartable
|
||||
|
||||
The Clapeyron-Clausius equation relates the pressure to the temperature
|
||||
for the saturation condition:
|
||||
|
||||
\f[
|
||||
\frac{dp}{dT} = - \frac{L}{T (\nu_v - \nu_l)}
|
||||
\f]
|
||||
|
||||
where:
|
||||
\vartable
|
||||
L | latent heat
|
||||
\nu_v | inverse of the vapor density
|
||||
\nu_l | inverse of the liquid density
|
||||
\endvartable
|
||||
|
||||
|
||||
Using the above relations:
|
||||
|
||||
\f[
|
||||
Flux =
|
||||
2 \frac{C}{2 - C}
|
||||
\sqrt{\frac{M}{2 \pi R {T_activate}^3}} L (\rho_{v})
|
||||
(T - T_{activate})
|
||||
\f]
|
||||
|
||||
This assumes liquid and vapour are in equilibrium, then the accommodation
|
||||
coefficient are equivalent for the interface. This relation is known as the
|
||||
Hertz-Knudsen-Schrage.
|
||||
|
||||
Based on the reference:
|
||||
- Van P. Carey, Liquid-Vapor Phase Change Phenomena, ISBN 0-89116836,
|
||||
1992, pp. 112-121.
|
||||
|
||||
|
||||
Usage
|
||||
|
||||
Example usage:
|
||||
\verbatim
|
||||
massTransferModel
|
||||
(
|
||||
(liquid to gas)
|
||||
{
|
||||
type kineticGasEvaporation;
|
||||
species vapour.gas;
|
||||
C 0.1;
|
||||
isoAlpha 0.1;
|
||||
Tactivate 373;
|
||||
}
|
||||
);
|
||||
\endverbatim
|
||||
|
||||
where:
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
C | Coefficient (C > 0 for evaporation, C < 0 for
|
||||
condensation) | yes
|
||||
includeVolChange | Volumen change | no | yes
|
||||
isoAlpha | iso-alpha for interface | no | 0.5
|
||||
Tactivate | Saturation temperature | yes
|
||||
species | Specie name on the other phase | no | none
|
||||
\endtable
|
||||
|
||||
SourceFiles
|
||||
kineticGasEvaporation.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef meltingEvaporationModels_kineticGasEvaporation_H
|
||||
#define meltingEvaporationModels_kineticGasEvaporation_H
|
||||
|
||||
#include "InterfaceCompositionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward Declarations
|
||||
class phasePair;
|
||||
|
||||
namespace meltingEvaporationModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class kineticGasEvaporation Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Thermo, class OtherThermo>
|
||||
class kineticGasEvaporation
|
||||
:
|
||||
public InterfaceCompositionModel<Thermo, OtherThermo>
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Evaporation coefficient
|
||||
dimensionedScalar C_;
|
||||
|
||||
//- Activation temperature
|
||||
const dimensionedScalar Tactivate_;
|
||||
|
||||
//- Molar weight of the vapour in the continuous phase
|
||||
dimensionedScalar Mv_;
|
||||
|
||||
//- Interface area
|
||||
volScalarField interfaceArea_;
|
||||
|
||||
//- Heat transfer coefficient
|
||||
volScalarField htc_;
|
||||
|
||||
//- Mass source
|
||||
volScalarField mDotc_;
|
||||
|
||||
//- Interface Iso-value
|
||||
scalar isoAlpha_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Update interface
|
||||
void updateInterface(const volScalarField& T);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("kineticGasEvaporation");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
kineticGasEvaporation
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phasePair& pair
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~kineticGasEvaporation() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Explicit total mass transfer coefficient
|
||||
virtual tmp<volScalarField> Kexp
|
||||
(
|
||||
const volScalarField& field
|
||||
);
|
||||
|
||||
//- Implicit mass transfer coefficient
|
||||
virtual tmp<volScalarField> KSp
|
||||
(
|
||||
label modelVariable,
|
||||
const volScalarField& field
|
||||
);
|
||||
|
||||
//- Explicit mass transfer coefficient
|
||||
virtual tmp<volScalarField> KSu
|
||||
(
|
||||
label modelVariable,
|
||||
const volScalarField& field
|
||||
);
|
||||
|
||||
//- Return Tactivate
|
||||
virtual const dimensionedScalar& Tactivate() const;
|
||||
|
||||
//- Add/subtract alpha*div(U) as a source term
|
||||
//- for alpha, substituting div(U) = mDot(1/rho1 - 1/rho2)
|
||||
virtual bool includeDivU();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace meltingEvaporationModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "kineticGasEvaporation.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,19 @@
|
||||
phaseModel/phaseModel/phaseModel.C
|
||||
phaseModel/phaseModel/phaseModelNew.C
|
||||
phaseModel/phaseModel/phaseModels.C
|
||||
|
||||
phasePair/phasePair.C
|
||||
phasePair/phasePairKey.C
|
||||
phasePair/orderedPhasePair.C
|
||||
|
||||
phaseSystem/phaseSystem.C
|
||||
|
||||
multiphaseSystem/multiphaseSystem.C
|
||||
multiphaseSystem/multiphaseSystemNew.C
|
||||
multiphaseSystem/multiphaseSystems.C
|
||||
|
||||
interfaceModels/porousModels/porousModel/porousModel.C
|
||||
interfaceModels/porousModels/porousModel/porousModelNew.C
|
||||
interfaceModels/porousModels/VollerPrakash/VollerPrakash.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libincompressibleMultiphaseSystems
|
||||
@ -0,0 +1,30 @@
|
||||
EXE_INC = \
|
||||
-I../massTransferModels/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \
|
||||
-I$(LIB_SRC)/combustionModels/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lfluidThermophysicalModels \
|
||||
-lreactionThermophysicalModels \
|
||||
-lsolidThermo \
|
||||
-lcompressibleTransportModels \
|
||||
-lincompressibleTransportModels \
|
||||
-linterfaceProperties \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lcombustionModels
|
||||
@ -0,0 +1,744 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "MassTransferPhaseSystem.H"
|
||||
#include "HashPtrTable.H"
|
||||
#include "fvcDiv.H"
|
||||
#include "fvmSup.H"
|
||||
#include "fvMatrix.H"
|
||||
#include "volFields.H"
|
||||
#include "fundamentalConstants.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class BasePhaseSystem>
|
||||
Foam::MassTransferPhaseSystem<BasePhaseSystem>::MassTransferPhaseSystem
|
||||
(
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
BasePhaseSystem(mesh)
|
||||
{
|
||||
this->generatePairsAndSubModels("massTransferModel", massTransferModels_);
|
||||
|
||||
forAllConstIters(massTransferModels_, iterModel)
|
||||
{
|
||||
if (!dmdt_.found(iterModel()->pair()))
|
||||
{
|
||||
dmdt_.set
|
||||
(
|
||||
iterModel()->pair(),
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("dmdt",iterModel()->pair().name()),
|
||||
this->mesh().time().timeName(),
|
||||
this->mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
this->mesh(),
|
||||
dimensionedScalar(dimDensity/dimTime, Zero)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * //
|
||||
|
||||
template<class BasePhaseSystem>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::MassTransferPhaseSystem<BasePhaseSystem>::calculateL
|
||||
(
|
||||
const volScalarField& dmdtNetki,
|
||||
const phasePairKey& keyik,
|
||||
const phasePairKey& keyki,
|
||||
const volScalarField& T
|
||||
) const
|
||||
{
|
||||
auto tL = tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tL",
|
||||
this->mesh().time().timeName(),
|
||||
this->mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
this->mesh(),
|
||||
dimensionedScalar(dimEnergy/dimMass, Zero)
|
||||
);
|
||||
auto& L = tL.ref();
|
||||
|
||||
if (massTransferModels_.found(keyik))
|
||||
{
|
||||
const autoPtr<interfaceCompositionModel>& interfacePtr =
|
||||
massTransferModels_[keyik];
|
||||
|
||||
word speciesName = interfacePtr->transferSpecie();
|
||||
|
||||
const word species(speciesName.substr(0, speciesName.find('.')));
|
||||
|
||||
L -= neg(dmdtNetki)*interfacePtr->L(species, T);
|
||||
}
|
||||
|
||||
if (massTransferModels_.found(keyki))
|
||||
{
|
||||
const autoPtr<interfaceCompositionModel>& interfacePtr =
|
||||
massTransferModels_[keyki];
|
||||
|
||||
word speciesName = interfacePtr->transferSpecie();
|
||||
|
||||
const word species(speciesName.substr(0, speciesName.find('.')));
|
||||
|
||||
L += pos(dmdtNetki)*interfacePtr->L(species, T);
|
||||
}
|
||||
|
||||
return tL;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
template<class BasePhaseSystem>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::MassTransferPhaseSystem<BasePhaseSystem>::dmdt
|
||||
(
|
||||
const phasePairKey& key
|
||||
) const
|
||||
{
|
||||
auto tdmdt = tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"dmdt",
|
||||
this->mesh().time().timeName(),
|
||||
this->mesh()
|
||||
),
|
||||
this->mesh(),
|
||||
dimensionedScalar(dimDensity/dimTime, Zero)
|
||||
);
|
||||
auto& dmdt = tdmdt.ref();
|
||||
|
||||
if (dmdt_.found(key))
|
||||
{
|
||||
dmdt = *dmdt_[key];
|
||||
}
|
||||
|
||||
return tdmdt;
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseSystem>
|
||||
Foam::tmp<Foam::fvScalarMatrix>
|
||||
Foam::MassTransferPhaseSystem<BasePhaseSystem>::heatTransfer
|
||||
(
|
||||
const volScalarField& T
|
||||
)
|
||||
{
|
||||
auto teqn = tmp<fvScalarMatrix>::New(T, dimEnergy/dimTime);
|
||||
auto& eqn = teqn.ref();
|
||||
|
||||
forAllConstIters(this->phaseModels_, iteri)
|
||||
{
|
||||
const phaseModel& phasei = iteri()();
|
||||
|
||||
auto iterk = iteri;
|
||||
|
||||
for (++iterk; iterk != this->phaseModels_.end(); ++iterk)
|
||||
{
|
||||
if (iteri()().name() != iterk()().name())
|
||||
{
|
||||
const phaseModel& phasek = iterk()();
|
||||
|
||||
// Phase i to phase k
|
||||
const phasePairKey keyik(phasei.name(), phasek.name(), true);
|
||||
|
||||
// Phase k to phase i
|
||||
const phasePairKey keyki(phasek.name(), phasei.name(), true);
|
||||
|
||||
// Net mass transfer from k to i phase
|
||||
auto tdmdtNetki = tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tdmdtYki",
|
||||
this->mesh().time().timeName(),
|
||||
this->mesh()
|
||||
),
|
||||
this->mesh(),
|
||||
dimensionedScalar(dimDensity/dimTime, Zero)
|
||||
);
|
||||
auto& dmdtNetki = tdmdtNetki.ref();
|
||||
|
||||
auto tSp = tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Sp",
|
||||
this->mesh().time().timeName(),
|
||||
this->mesh()
|
||||
),
|
||||
this->mesh(),
|
||||
dimensionedScalar(dimDensity/dimTime/dimTemperature, Zero)
|
||||
);
|
||||
auto& Sp = tSp.ref();
|
||||
|
||||
auto tSu = tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Su",
|
||||
this->mesh().time().timeName(),
|
||||
this->mesh()
|
||||
),
|
||||
this->mesh(),
|
||||
dimensionedScalar(dimDensity/dimTime, Zero)
|
||||
);
|
||||
auto& Su = tSu.ref();
|
||||
|
||||
|
||||
if (massTransferModels_.found(keyik))
|
||||
{
|
||||
autoPtr<interfaceCompositionModel>& interfacePtr =
|
||||
massTransferModels_[keyik];
|
||||
|
||||
dmdtNetki -= *dmdt_[keyik];
|
||||
|
||||
tmp<volScalarField> KSp =
|
||||
interfacePtr->KSp(interfaceCompositionModel::T, T);
|
||||
|
||||
if (KSp.valid())
|
||||
{
|
||||
Sp -= KSp.ref();
|
||||
}
|
||||
|
||||
tmp<volScalarField> KSu =
|
||||
interfacePtr->KSu(interfaceCompositionModel::T, T);
|
||||
|
||||
if (KSu.valid())
|
||||
{
|
||||
Su -= KSu.ref();
|
||||
}
|
||||
|
||||
// If linearization is not provided used full explicit
|
||||
if (!KSp.valid() && !KSu.valid())
|
||||
{
|
||||
Su -= *dmdt_[keyik];
|
||||
}
|
||||
}
|
||||
|
||||
// Looking for mass transfer in the other direction (k to i)
|
||||
if (massTransferModels_.found(keyki))
|
||||
{
|
||||
autoPtr<interfaceCompositionModel>& interfacePtr =
|
||||
massTransferModels_[keyki];
|
||||
|
||||
dmdtNetki += *dmdt_[keyki];
|
||||
|
||||
|
||||
tmp<volScalarField> KSp =
|
||||
interfacePtr->KSp(interfaceCompositionModel::T, T);
|
||||
|
||||
if (KSp.valid())
|
||||
{
|
||||
Sp += KSp.ref();
|
||||
}
|
||||
|
||||
tmp<volScalarField> KSu =
|
||||
interfacePtr->KSu(interfaceCompositionModel::T, T);
|
||||
|
||||
if (KSu.valid())
|
||||
{
|
||||
Su += KSu.ref();
|
||||
}
|
||||
|
||||
// If linearization is not provided used full explicit
|
||||
if (!KSp.valid() && !KSu.valid())
|
||||
{
|
||||
Su += *dmdt_[keyki];
|
||||
}
|
||||
}
|
||||
|
||||
tmp<volScalarField> L = calculateL(dmdtNetki, keyik, keyki, T);
|
||||
|
||||
//eqn -= dmdtNetki*L;
|
||||
eqn -= fvm::Sp(Sp*L.ref(), T) + Su*L.ref();
|
||||
}
|
||||
}
|
||||
}
|
||||
return teqn;
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseSystem>
|
||||
Foam::tmp<Foam::fvScalarMatrix>
|
||||
Foam::MassTransferPhaseSystem<BasePhaseSystem>::volTransfer
|
||||
(
|
||||
const volScalarField& p
|
||||
)
|
||||
{
|
||||
auto teqn = tmp<fvScalarMatrix>::New(p, dimVolume/dimTime);
|
||||
auto& eqn = teqn.ref();
|
||||
|
||||
auto tSp = tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Sp",
|
||||
this->mesh().time().timeName(),
|
||||
this->mesh()
|
||||
),
|
||||
this->mesh(),
|
||||
dimensionedScalar(dimless/dimTime/dimPressure, Zero)
|
||||
);
|
||||
auto& Sp = tSp.ref();
|
||||
|
||||
auto tSu = tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Su",
|
||||
this->mesh().time().timeName(),
|
||||
this->mesh()
|
||||
),
|
||||
this->mesh(),
|
||||
dimensionedScalar(dimless/dimTime, Zero)
|
||||
);
|
||||
auto& Su = tSu.ref();
|
||||
|
||||
forAllConstIters(this->totalPhasePairs(), iter)
|
||||
{
|
||||
const phasePair& pair = iter()();
|
||||
|
||||
const phaseModel& phase1 = pair.phase1();
|
||||
const phaseModel& phase2 = pair.phase2();
|
||||
|
||||
const phasePairKey key12
|
||||
(
|
||||
phase1.name(),
|
||||
phase2.name(),
|
||||
true
|
||||
);
|
||||
|
||||
if (massTransferModels_.found(key12))
|
||||
{
|
||||
autoPtr<interfaceCompositionModel>& interfacePtr =
|
||||
massTransferModels_[key12];
|
||||
|
||||
tmp<volScalarField> KSp =
|
||||
interfacePtr->KSp(interfaceCompositionModel::P, p);
|
||||
|
||||
if (KSp.valid())
|
||||
{
|
||||
Sp -=
|
||||
KSp.ref()
|
||||
*(
|
||||
- this->coeffs(phase1.name())
|
||||
+ this->coeffs(phase2.name())
|
||||
);
|
||||
}
|
||||
|
||||
tmp<volScalarField> KSu =
|
||||
interfacePtr->KSu(interfaceCompositionModel::P, p);
|
||||
|
||||
if (KSu.valid())
|
||||
{
|
||||
Su -=
|
||||
KSu.ref()
|
||||
*(
|
||||
- this->coeffs(phase1.name())
|
||||
+ this->coeffs(phase2.name())
|
||||
);
|
||||
}
|
||||
|
||||
// If linearization is not provided used full explicit
|
||||
if (!KSp.valid() && !KSu.valid())
|
||||
{
|
||||
Su -=
|
||||
*dmdt_[key12]
|
||||
*(
|
||||
- this->coeffs(phase1.name())
|
||||
+ this->coeffs(phase2.name())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const phasePairKey key21
|
||||
(
|
||||
phase2.name(),
|
||||
phase1.name(),
|
||||
true
|
||||
);
|
||||
|
||||
if (massTransferModels_.found(key21))
|
||||
{
|
||||
autoPtr<interfaceCompositionModel>& interfacePtr =
|
||||
massTransferModels_[key21];
|
||||
|
||||
tmp<volScalarField> KSp =
|
||||
interfacePtr->KSp(interfaceCompositionModel::P, p);
|
||||
|
||||
if (KSp.valid())
|
||||
{
|
||||
Sp +=
|
||||
KSp.ref()
|
||||
*(
|
||||
- this->coeffs(phase1.name())
|
||||
+ this->coeffs(phase2.name())
|
||||
);
|
||||
}
|
||||
|
||||
tmp<volScalarField> KSu =
|
||||
interfacePtr->KSu(interfaceCompositionModel::P, p);
|
||||
|
||||
if (KSu.valid())
|
||||
{
|
||||
Su +=
|
||||
KSu.ref()
|
||||
*(
|
||||
- this->coeffs(phase1.name())
|
||||
+ this->coeffs(phase2.name())
|
||||
);
|
||||
}
|
||||
|
||||
// If linearization is not provided used full explicit
|
||||
if (!KSp.valid() && !KSu.valid())
|
||||
{
|
||||
Su +=
|
||||
*dmdt_[key21]
|
||||
*(
|
||||
- this->coeffs(phase1.name())
|
||||
+ this->coeffs(phase2.name())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
eqn += fvm::Sp(Sp, p) + Su;
|
||||
return teqn;
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseSystem>
|
||||
void Foam::MassTransferPhaseSystem<BasePhaseSystem>::correctMassSources
|
||||
(
|
||||
const volScalarField& T
|
||||
)
|
||||
{
|
||||
forAllConstIters(this->phaseModels_, iteri)
|
||||
{
|
||||
const phaseModel& phasei = iteri()();
|
||||
|
||||
auto iterk = iteri;
|
||||
|
||||
for (++iterk; iterk != this->phaseModels_.end(); ++iterk)
|
||||
{
|
||||
if (iteri()().name() != iterk()().name())
|
||||
{
|
||||
const phaseModel& phasek = iterk()();
|
||||
|
||||
// Phase i to phase k
|
||||
const phasePairKey keyik(phasei.name(), phasek.name(), true);
|
||||
|
||||
// Phase k to phase i
|
||||
const phasePairKey keyki(phasek.name(), phasei.name(), true);
|
||||
|
||||
if (massTransferModels_.found(keyik))
|
||||
{
|
||||
autoPtr<interfaceCompositionModel>& interfacePtr =
|
||||
massTransferModels_[keyik];
|
||||
|
||||
tmp<volScalarField> Kexp = interfacePtr->Kexp(T);
|
||||
|
||||
*dmdt_[keyik] = Kexp.ref();
|
||||
|
||||
}
|
||||
|
||||
if (massTransferModels_.found(keyki))
|
||||
{
|
||||
autoPtr<interfaceCompositionModel>& interfacePtr =
|
||||
massTransferModels_[keyki];
|
||||
|
||||
// Explicit temperature mass transfer rate
|
||||
const tmp<volScalarField> Kexp = interfacePtr->Kexp(T);
|
||||
|
||||
*dmdt_[keyki] = Kexp.ref();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseSystem>
|
||||
void Foam::MassTransferPhaseSystem<BasePhaseSystem>::alphaTransfer
|
||||
(
|
||||
SuSpTable& Su,
|
||||
SuSpTable& Sp
|
||||
)
|
||||
{
|
||||
// This term adds/subtracts alpha*div(U) as a source term
|
||||
// for alpha, substituting div(U) = mDot(1/rho1 - 1/rho2)
|
||||
bool includeDivU(true);
|
||||
|
||||
forAllConstIters(this->totalPhasePairs(), iter)
|
||||
{
|
||||
const phasePair& pair = iter()();
|
||||
|
||||
const phaseModel& phase1 = pair.phase1();
|
||||
const phaseModel& phase2 = pair.phase2();
|
||||
|
||||
const volScalarField& alpha1 = pair.phase1();
|
||||
const volScalarField& alpha2 = pair.phase2();
|
||||
|
||||
tmp<volScalarField> tCoeffs1 = this->coeffs(phase1.name());
|
||||
const volScalarField& coeffs1 = tCoeffs1();
|
||||
|
||||
tmp<volScalarField> tCoeffs2 = this->coeffs(phase2.name());
|
||||
const volScalarField& coeffs2 = tCoeffs2();
|
||||
|
||||
// Phase 1 to phase 2
|
||||
const phasePairKey key12
|
||||
(
|
||||
phase1.name(),
|
||||
phase2.name(),
|
||||
true
|
||||
);
|
||||
|
||||
tmp<volScalarField> tdmdt12(this->dmdt(key12));
|
||||
volScalarField& dmdt12 = tdmdt12.ref();
|
||||
|
||||
if (massTransferModels_.found(key12))
|
||||
{
|
||||
autoPtr<interfaceCompositionModel>& interfacePtr =
|
||||
massTransferModels_[key12];
|
||||
|
||||
tmp<volScalarField> KSu =
|
||||
interfacePtr->KSu(interfaceCompositionModel::alpha, phase1);
|
||||
|
||||
if (KSu.valid())
|
||||
{
|
||||
dmdt12 = KSu.ref();
|
||||
}
|
||||
|
||||
includeDivU = interfacePtr->includeDivU();
|
||||
}
|
||||
|
||||
|
||||
// Phase 2 to phase 1
|
||||
const phasePairKey key21
|
||||
(
|
||||
phase2.name(),
|
||||
phase1.name(),
|
||||
true
|
||||
);
|
||||
|
||||
tmp<volScalarField> tdmdt21(this->dmdt(key21));
|
||||
volScalarField& dmdt21 = tdmdt21.ref();
|
||||
|
||||
if (massTransferModels_.found(key21))
|
||||
{
|
||||
autoPtr<interfaceCompositionModel>& interfacePtr =
|
||||
massTransferModels_[key21];
|
||||
|
||||
tmp<volScalarField> KSu =
|
||||
interfacePtr->KSu(interfaceCompositionModel::alpha, phase2);
|
||||
|
||||
if (KSu.valid())
|
||||
{
|
||||
dmdt21 = KSu.ref();
|
||||
}
|
||||
|
||||
includeDivU = interfacePtr->includeDivU();
|
||||
}
|
||||
|
||||
volScalarField::Internal& SpPhase1 = Sp[phase1.name()];
|
||||
|
||||
volScalarField::Internal& SuPhase1 = Su[phase1.name()];
|
||||
|
||||
volScalarField::Internal& SpPhase2 = Sp[phase2.name()];
|
||||
|
||||
volScalarField::Internal& SuPhase2 = Su[phase2.name()];
|
||||
|
||||
const volScalarField dmdtNet(dmdt21 - dmdt12);
|
||||
|
||||
const volScalarField coeffs12(coeffs1 - coeffs2);
|
||||
|
||||
const surfaceScalarField& phi = this->phi();
|
||||
|
||||
if (includeDivU)
|
||||
{
|
||||
SuPhase1 +=
|
||||
fvc::div(phi)*min(max(alpha1, scalar(0)), scalar(1));
|
||||
|
||||
SuPhase2 +=
|
||||
fvc::div(phi)*min(max(alpha2, scalar(0)), scalar(1));
|
||||
}
|
||||
|
||||
// NOTE: dmdtNet is distributed in terms =
|
||||
// Source for phase 1 =
|
||||
// dmdtNet/rho1
|
||||
// - alpha1*dmdtNet(1/rho1 - 1/rho2)
|
||||
|
||||
forAll(dmdtNet, celli)
|
||||
{
|
||||
scalar dmdt21 = dmdtNet[celli];
|
||||
scalar coeffs12Cell = coeffs12[celli];
|
||||
|
||||
scalar alpha1Limited = max(min(alpha1[celli], 1.0), 0.0);
|
||||
|
||||
// exp.
|
||||
SuPhase1[celli] += coeffs1[celli]*dmdt21;
|
||||
|
||||
if (includeDivU)
|
||||
{
|
||||
if (dmdt21 > 0)
|
||||
{
|
||||
if (coeffs12Cell > 0)
|
||||
{
|
||||
// imp
|
||||
SpPhase1[celli] -= dmdt21*coeffs12Cell;
|
||||
}
|
||||
else if (coeffs12Cell < 0)
|
||||
{
|
||||
// exp
|
||||
SuPhase1[celli] -=
|
||||
dmdt21*coeffs12Cell*alpha1Limited;
|
||||
}
|
||||
}
|
||||
else if (dmdt21 < 0)
|
||||
{
|
||||
if (coeffs12Cell > 0)
|
||||
{
|
||||
// exp
|
||||
SuPhase1[celli] -=
|
||||
dmdt21*coeffs12Cell*alpha1Limited;
|
||||
}
|
||||
else if (coeffs12Cell < 0)
|
||||
{
|
||||
// imp
|
||||
SpPhase1[celli] -= dmdt21*coeffs12Cell;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
forAll(dmdtNet, celli)
|
||||
{
|
||||
scalar dmdt12 = -dmdtNet[celli];
|
||||
scalar coeffs21Cell = -coeffs12[celli];
|
||||
|
||||
scalar alpha2Limited = max(min(alpha2[celli], 1.0), 0.0);
|
||||
|
||||
// exp
|
||||
SuPhase2[celli] += coeffs2[celli]*dmdt12;
|
||||
|
||||
if (includeDivU)
|
||||
{
|
||||
if (dmdt12 > 0)
|
||||
{
|
||||
if (coeffs21Cell > 0)
|
||||
{
|
||||
// imp
|
||||
SpPhase2[celli] -= dmdt12*coeffs21Cell;
|
||||
}
|
||||
else if (coeffs21Cell < 0)
|
||||
{
|
||||
// exp
|
||||
SuPhase2[celli] -=
|
||||
dmdt12*coeffs21Cell*alpha2Limited;
|
||||
}
|
||||
}
|
||||
else if (dmdt12 < 0)
|
||||
{
|
||||
if (coeffs21Cell > 0)
|
||||
{
|
||||
// exp
|
||||
SuPhase2[celli] -=
|
||||
coeffs21Cell*dmdt12*alpha2Limited;
|
||||
}
|
||||
else if (coeffs21Cell < 0)
|
||||
{
|
||||
// imp
|
||||
SpPhase2[celli] -= dmdt12*coeffs21Cell;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Update ddtAlphaMax
|
||||
this->ddtAlphaMax_ =
|
||||
max(gMax((dmdt21*coeffs1)()), gMax((dmdt12*coeffs2)()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseSystem>
|
||||
void Foam::MassTransferPhaseSystem<BasePhaseSystem>::massSpeciesTransfer
|
||||
(
|
||||
const phaseModel& phase,
|
||||
volScalarField::Internal& Su,
|
||||
volScalarField::Internal& Sp,
|
||||
const word speciesName
|
||||
)
|
||||
{
|
||||
// Fill the volumetric mass transfer for species
|
||||
forAllConstIters(massTransferModels_, iter)
|
||||
{
|
||||
if (iter()->transferSpecie() == speciesName)
|
||||
{
|
||||
// Explicit source
|
||||
Su +=
|
||||
this->Su()[phase.name()]
|
||||
+ this->Sp()[phase.name()]*phase.oldTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseSystem>
|
||||
bool Foam::MassTransferPhaseSystem<BasePhaseSystem>::includeVolChange()
|
||||
{
|
||||
bool includeVolChange(true);
|
||||
forAllIters(massTransferModels_, iter)
|
||||
{
|
||||
if (!iter()->includeVolChange())
|
||||
{
|
||||
includeVolChange = false;
|
||||
}
|
||||
}
|
||||
return includeVolChange;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,172 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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::MassTransferPhaseSystem
|
||||
|
||||
Description
|
||||
Class for mass transfer between phases
|
||||
|
||||
SourceFiles
|
||||
MassTransferPhaseSystem.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef MassTransferPhaseSystem_H
|
||||
#define MassTransferPhaseSystem_H
|
||||
|
||||
#include "phaseSystem.H"
|
||||
#include "HashPtrTable.H"
|
||||
#include "interfaceCompositionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class MassTransferPhaseSystem Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class BasePhaseSystem>
|
||||
class MassTransferPhaseSystem
|
||||
:
|
||||
public BasePhaseSystem
|
||||
{
|
||||
public:
|
||||
|
||||
// Public typedefs
|
||||
|
||||
typedef
|
||||
HashTable
|
||||
<
|
||||
autoPtr<interfaceCompositionModel>,
|
||||
phasePairKey,
|
||||
phasePairKey::hash
|
||||
>
|
||||
massTransferModelTable;
|
||||
|
||||
|
||||
typedef HashTable<volScalarField::Internal> SuSpTable;
|
||||
|
||||
protected:
|
||||
|
||||
// Protected typedefs
|
||||
|
||||
typedef
|
||||
HashPtrTable
|
||||
<
|
||||
volScalarField,
|
||||
phasePairKey,
|
||||
phasePairKey::hash
|
||||
>
|
||||
dmdtTable;
|
||||
|
||||
|
||||
// Protected Data
|
||||
|
||||
//- Overall inter-phase mass transfer rates [Kg/s]
|
||||
dmdtTable dmdt_;
|
||||
|
||||
//- Mass transfer models
|
||||
massTransferModelTable massTransferModels_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Calculate L between phases
|
||||
tmp<volScalarField> calculateL
|
||||
(
|
||||
const volScalarField& dmdtNetki,
|
||||
const phasePairKey& keyik,
|
||||
const phasePairKey& keyki,
|
||||
const volScalarField& T
|
||||
) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from fvMesh
|
||||
explicit MassTransferPhaseSystem(const fvMesh&);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~MassTransferPhaseSystem() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return total interfacial mass flow rate
|
||||
tmp<volScalarField> dmdt(const phasePairKey& key) const;
|
||||
|
||||
|
||||
// Mass transfer functions
|
||||
|
||||
//- Return the heat transfer matrix
|
||||
// NOTE: Call KSu and KSp with T as variable,if not provided uses dmdt.
|
||||
virtual tmp<fvScalarMatrix> heatTransfer(const volScalarField& T);
|
||||
|
||||
//- Return the volumetric rate transfer matrix
|
||||
// NOTE: Call KSu and KSp with p as variable,if not provided uses dmdt.
|
||||
virtual tmp<fvScalarMatrix> volTransfer(const volScalarField& p);
|
||||
|
||||
//- Correct/calculates mass sources dmdt for phases
|
||||
// NOTE: Call the kexp() for all the mass transfer models.
|
||||
virtual void correctMassSources(const volScalarField& T);
|
||||
|
||||
//- Calculate mass transfer for alpha's
|
||||
virtual void alphaTransfer(SuSpTable& Su, SuSpTable& Sp);
|
||||
|
||||
//- Calculate mass transfer for species
|
||||
virtual void massSpeciesTransfer
|
||||
(
|
||||
const phaseModel& phase,
|
||||
volScalarField::Internal& Su,
|
||||
volScalarField::Internal& Sp,
|
||||
const word speciesName
|
||||
);
|
||||
|
||||
//- Add volume change in pEq
|
||||
virtual bool includeVolChange();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "MassTransferPhaseSystem.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,75 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "VollerPrakash.H"
|
||||
#include "phasePair.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace porousModels
|
||||
{
|
||||
defineTypeNameAndDebug(VollerPrakash, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
porousModel,
|
||||
VollerPrakash,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::porousModels::VollerPrakash::VollerPrakash
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
porousModel(dict, mesh),
|
||||
Cu_(dict.get<scalar>("Cu")),
|
||||
solidPhase_(dict.get<word>("solidPhase"))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::porousModels::VollerPrakash::S() const
|
||||
{
|
||||
const volScalarField& solidAlpha =
|
||||
mesh_.lookupObject<volScalarField>(solidPhase_);
|
||||
|
||||
return Cu_*sqr(solidAlpha)/(pow3(1.0 - solidAlpha) + 1e-3);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,131 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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::porousModels::VollerPrakash
|
||||
|
||||
Description
|
||||
Porous model to apply a porous media on a solid phase.
|
||||
|
||||
Based on the references:
|
||||
-# V.R. Voller and C. Prakash, A fixed grid numerical modelling
|
||||
methodology for convection-diffusion mushy phase-change problems,
|
||||
Int. J. Heat Mass Transfer 30(8):17091719, 1987.
|
||||
-# C.R. Swaminathan. and V.R. Voller, A general enthalpy model for
|
||||
modeling solidification processes, Metallurgical Transactions
|
||||
23B:651664, 1992.
|
||||
Usage
|
||||
Example usage:
|
||||
\verbatim
|
||||
interfacePorous
|
||||
(
|
||||
(solid and liquid)
|
||||
{
|
||||
type VollerPrakash;
|
||||
solidPhase alpha.solid;
|
||||
Cu 1e7;
|
||||
}
|
||||
);
|
||||
\endverbatim
|
||||
|
||||
Where:
|
||||
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
solidPhase | Solid phase name | yes
|
||||
Cu | Model constant | yes
|
||||
\endtable
|
||||
|
||||
SourceFiles
|
||||
VollerPrakash.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef porousModels_VollerPrakash_H
|
||||
#define porousModels_VollerPrakash_H
|
||||
|
||||
#include "porousModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace porousModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class VollerPrakash Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class VollerPrakash
|
||||
:
|
||||
public porousModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Constant surface tension value
|
||||
const scalar Cu_;
|
||||
|
||||
//- Solid phase name
|
||||
word solidPhase_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("VollerPrakash");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from a dictionary and a phase pair
|
||||
VollerPrakash
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~VollerPrakash() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Aspect ratio
|
||||
virtual tmp<volScalarField> S() const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace porousModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,71 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "porousModel.H"
|
||||
#include "phasePair.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(porousModel, 0);
|
||||
defineRunTimeSelectionTable(porousModel, dictionary);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::porousModel::porousModel
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
regIOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName(typeName, dict.name()),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
),
|
||||
mesh_(mesh)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::porousModel::writeData(Ostream& os) const
|
||||
{
|
||||
return os.good();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,127 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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::porousModel
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
porousModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef porousModel_H
|
||||
#define porousModel_H
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "volFields.H"
|
||||
#include "dictionary.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class fvMesh;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class porousModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class porousModel
|
||||
:
|
||||
public regIOobject
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Reference to mesh
|
||||
const fvMesh& mesh_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("porousModel");
|
||||
|
||||
|
||||
// Declare runtime construction
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
porousModel,
|
||||
dictionary,
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh
|
||||
),
|
||||
(dict, mesh)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from a dictionary and a phase pair
|
||||
porousModel
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~porousModel() = default;
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
static autoPtr<porousModel> New
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh
|
||||
);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Momemtum source
|
||||
virtual tmp<volScalarField> S() const = 0;
|
||||
|
||||
//- Dummy write for regIOobject
|
||||
bool writeData(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,61 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "porousModel.H"
|
||||
#include "phasePair.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::porousModel> Foam::porousModel::New
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
{
|
||||
const word modelType(dict.get<word>("type"));
|
||||
|
||||
Info<< "Selecting porousModel for "
|
||||
<< ": " << modelType << endl;
|
||||
|
||||
const auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
dict,
|
||||
"porousModel",
|
||||
modelType,
|
||||
*dictionaryConstructorTablePtr_
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()(dict, mesh);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,86 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "phasePair.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceTensionModels
|
||||
{
|
||||
defineTypeNameAndDebug(constantSurfaceTensionCoefficient, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
surfaceTensionModel,
|
||||
constantSurfaceTensionCoefficient,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::surfaceTensionModels::constantSurfaceTensionCoefficient::
|
||||
constantSurfaceTensionCoefficient
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phasePair& pair,
|
||||
const bool registerObject
|
||||
)
|
||||
:
|
||||
surfaceTensionModel(dict, pair, registerObject),
|
||||
sigma_("sigma", dimMass/sqr(dimTime), dict)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::surfaceTensionModels::constantSurfaceTensionCoefficient::sigma() const
|
||||
{
|
||||
const fvMesh& mesh(this->pair_.phase1().mesh());
|
||||
|
||||
return
|
||||
tmp<volScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"zero",
|
||||
mesh.time().timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
sigma_
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,100 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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::surfaceTensionModels::constantSurfaceTensionCoefficient
|
||||
|
||||
Description
|
||||
Constant value surface tension model.
|
||||
|
||||
SourceFiles
|
||||
constantSurfaceTensionCoefficient.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef surfaceTensionModels_constantSurfaceTensionCoefficient_H
|
||||
#define surfaceTensionModels_constantSurfaceTensionCoefficient_H
|
||||
|
||||
#include "surfaceTensionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceTensionModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class constantSurfaceTensionCoefficient Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class constantSurfaceTensionCoefficient
|
||||
:
|
||||
public surfaceTensionModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Constant surface tension value
|
||||
const dimensionedScalar sigma_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("constant");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from a dictionary and a phase pair
|
||||
constantSurfaceTensionCoefficient
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phasePair& pair,
|
||||
const bool registerObject
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~constantSurfaceTensionCoefficient() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Aspect ratio
|
||||
virtual tmp<volScalarField> sigma() const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceTensionModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,73 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "surfaceTensionModel.H"
|
||||
#include "phasePair.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(surfaceTensionModel, 0);
|
||||
defineRunTimeSelectionTable(surfaceTensionModel, dictionary);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::surfaceTensionModel::surfaceTensionModel
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phasePair& pair,
|
||||
const bool registerObject
|
||||
)
|
||||
:
|
||||
regIOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName(typeName, pair.name()),
|
||||
pair.phase1().mesh().time().timeName(),
|
||||
pair.phase1().mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
registerObject
|
||||
)
|
||||
),
|
||||
pair_(pair)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::surfaceTensionModel::writeData(Ostream& os) const
|
||||
{
|
||||
return os.good();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,130 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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::surfaceTensionModel
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
surfaceTensionModel.C
|
||||
surfaceTensionModelNew.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef surfaceTensionModel_H
|
||||
#define surfaceTensionModel_H
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "volFields.H"
|
||||
#include "dictionary.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class phasePair;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class surfaceTensionModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class surfaceTensionModel
|
||||
:
|
||||
public regIOobject
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Phase pair
|
||||
const phasePair& pair_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("surfaceTensionModel");
|
||||
|
||||
|
||||
// Declare runtime construction
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
surfaceTensionModel,
|
||||
dictionary,
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phasePair& pair,
|
||||
const bool registerObject
|
||||
),
|
||||
(dict, pair, registerObject)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from a dictionary and a phase pair
|
||||
surfaceTensionModel
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phasePair& pair,
|
||||
const bool registerObject
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~surfaceTensionModel() = default;
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
static autoPtr<surfaceTensionModel> New
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phasePair& pair
|
||||
);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Aspect ratio
|
||||
virtual tmp<volScalarField> sigma() const = 0;
|
||||
|
||||
//- Dummy write for regIOobject
|
||||
bool writeData(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,61 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "surfaceTensionModel.H"
|
||||
#include "phasePair.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::surfaceTensionModel> Foam::surfaceTensionModel::New
|
||||
(
|
||||
const dictionary& dict,
|
||||
const phasePair& pair
|
||||
)
|
||||
{
|
||||
const word modelType(dict.get<word>("type"));
|
||||
|
||||
Info<< "Selecting surfaceTensionModel for "
|
||||
<< pair << ": " << modelType << endl;
|
||||
|
||||
const auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
dict,
|
||||
"surfaceTensionModel",
|
||||
modelType,
|
||||
*dictionaryConstructorTablePtr_
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()(dict, pair, true);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,502 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "multiphaseSystem.H"
|
||||
|
||||
#include "fixedValueFvsPatchFields.H"
|
||||
#include "Time.H"
|
||||
#include "subCycle.H"
|
||||
#include "fvcMeshPhi.H"
|
||||
|
||||
#include "surfaceInterpolate.H"
|
||||
#include "fvcGrad.H"
|
||||
#include "fvcSnGrad.H"
|
||||
#include "fvcDiv.H"
|
||||
#include "fvcDdt.H"
|
||||
#include "fvcFlux.H"
|
||||
#include "fvmDdt.H"
|
||||
#include "fvcAverage.H"
|
||||
#include "fvMatrix.H"
|
||||
#include "fvmSup.H"
|
||||
#include "CMULES.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(multiphaseSystem, 0);
|
||||
defineRunTimeSelectionTable(multiphaseSystem, dictionary);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::multiphaseSystem::multiphaseSystem
|
||||
(
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
phaseSystem(mesh),
|
||||
cAlphas_(),
|
||||
ddtAlphaMax_(0.0),
|
||||
limitedPhiAlphas_(phaseModels_.size()),
|
||||
Su_(phaseModels_.size()),
|
||||
Sp_(phaseModels_.size())
|
||||
{
|
||||
label phasei = 0;
|
||||
phases_.setSize(phaseModels_.size());
|
||||
forAllIters(phaseModels_, iter)
|
||||
{
|
||||
phaseModel& pm = iter()();
|
||||
phases_.set(phasei++, &pm);
|
||||
}
|
||||
|
||||
mesh.solverDict("alpha").readEntry("cAlphas", cAlphas_);
|
||||
|
||||
// Initiate Su and Sp
|
||||
forAllConstIters(phaseModels_, iter)
|
||||
{
|
||||
const phaseModel& pm = iter()();
|
||||
|
||||
Su_.insert
|
||||
(
|
||||
pm.name(),
|
||||
volScalarField::Internal
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Su" + pm.name(),
|
||||
mesh_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar(dimless/dimTime, Zero)
|
||||
)
|
||||
);
|
||||
|
||||
Sp_.insert
|
||||
(
|
||||
pm.name(),
|
||||
volScalarField::Internal
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Sp" + pm.name(),
|
||||
mesh_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar(dimless/dimTime, Zero)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::multiphaseSystem::calculateSuSp()
|
||||
{
|
||||
this->alphaTransfer(Su_, Sp_);
|
||||
}
|
||||
|
||||
|
||||
void Foam::multiphaseSystem::solve()
|
||||
{
|
||||
const dictionary& alphaControls = mesh_.solverDict("alpha");
|
||||
label nAlphaSubCycles(alphaControls.get<label>("nAlphaSubCycles"));
|
||||
|
||||
volScalarField& alpha = phases_.first();
|
||||
|
||||
if (nAlphaSubCycles > 1)
|
||||
{
|
||||
surfaceScalarField rhoPhiSum
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rhoPhiSum",
|
||||
mesh_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar(rhoPhi_.dimensions(), Zero)
|
||||
);
|
||||
|
||||
dimensionedScalar totalDeltaT = mesh_.time().deltaT();
|
||||
|
||||
for
|
||||
(
|
||||
subCycle<volScalarField> alphaSubCycle(alpha, nAlphaSubCycles);
|
||||
!(++alphaSubCycle).end();
|
||||
)
|
||||
{
|
||||
solveAlphas();
|
||||
rhoPhiSum += (mesh_.time().deltaT()/totalDeltaT)*rhoPhi_;
|
||||
}
|
||||
|
||||
rhoPhi_ = rhoPhiSum;
|
||||
}
|
||||
else
|
||||
{
|
||||
solveAlphas();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Foam::multiphaseSystem::solveAlphas()
|
||||
{
|
||||
|
||||
const dictionary& alphaControls = mesh_.solverDict("alpha");
|
||||
alphaControls.readEntry("cAlphas", cAlphas_);
|
||||
label nAlphaCorr(alphaControls.get<label>("nAlphaCorr"));
|
||||
|
||||
PtrList<surfaceScalarField> phiAlphaCorrs(phases_.size());
|
||||
|
||||
const surfaceScalarField& phi = this->phi();
|
||||
|
||||
surfaceScalarField phic(mag((phi)/mesh_.magSf()));
|
||||
|
||||
// Do not compress interface at non-coupled boundary faces
|
||||
// (inlets, outlets etc.)
|
||||
surfaceScalarField::Boundary& phicBf = phic.boundaryFieldRef();
|
||||
forAll(phic.boundaryField(), patchi)
|
||||
{
|
||||
fvsPatchScalarField& phicp = phicBf[patchi];
|
||||
|
||||
if (!phicp.coupled())
|
||||
{
|
||||
phicp == 0;
|
||||
}
|
||||
}
|
||||
|
||||
for (int acorr=0; acorr<nAlphaCorr; acorr++)
|
||||
{
|
||||
label phasei = 0;
|
||||
for (phaseModel& phase1 : phases_)
|
||||
{
|
||||
const volScalarField& alpha1 = phase1;
|
||||
|
||||
phiAlphaCorrs.set
|
||||
(
|
||||
phasei,
|
||||
new surfaceScalarField
|
||||
(
|
||||
"phi" + alpha1.name() + "Corr",
|
||||
fvc::flux
|
||||
(
|
||||
phi,
|
||||
alpha1,
|
||||
"div(phi," + alpha1.name() + ')'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
surfaceScalarField& phiAlphaCorr = phiAlphaCorrs[phasei];
|
||||
|
||||
for (phaseModel& phase2 : phases_)
|
||||
{
|
||||
const volScalarField& alpha2 = phase2;
|
||||
|
||||
if (&phase2 == &phase1) continue;
|
||||
|
||||
const phasePairKey key12(phase1.name(), phase2.name());
|
||||
|
||||
if (!cAlphas_.found(key12))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Phase compression factor (cAlpha) not found for : "
|
||||
<< key12
|
||||
<< exit(FatalError);
|
||||
}
|
||||
scalar cAlpha = cAlphas_.find(key12)();
|
||||
|
||||
phic = min(cAlpha*phic, max(phic));
|
||||
|
||||
surfaceScalarField phir(phic*nHatf(alpha1, alpha2));
|
||||
|
||||
word phirScheme
|
||||
(
|
||||
"div(phir," + alpha2.name() + ',' + alpha1.name() + ')'
|
||||
);
|
||||
|
||||
phiAlphaCorr += fvc::flux
|
||||
(
|
||||
-fvc::flux(-phir, alpha2, phirScheme),
|
||||
alpha1,
|
||||
phirScheme
|
||||
);
|
||||
}
|
||||
|
||||
// Ensure that the flux at inflow BCs is preserved
|
||||
forAll(phiAlphaCorr.boundaryField(), patchi)
|
||||
{
|
||||
fvsPatchScalarField& phiAlphaCorrp =
|
||||
phiAlphaCorr.boundaryFieldRef()[patchi];
|
||||
|
||||
if (!phiAlphaCorrp.coupled())
|
||||
{
|
||||
const scalarField& phi1p = phi.boundaryField()[patchi];
|
||||
const scalarField& alpha1p =
|
||||
alpha1.boundaryField()[patchi];
|
||||
|
||||
forAll(phiAlphaCorrp, facei)
|
||||
{
|
||||
if (phi1p[facei] < 0)
|
||||
{
|
||||
phiAlphaCorrp[facei] = alpha1p[facei]*phi1p[facei];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
++phasei;
|
||||
}
|
||||
|
||||
// Set Su and Sp to zero
|
||||
for (const phaseModel& phase : phases_)
|
||||
{
|
||||
Su_[phase.name()] = dimensionedScalar("Su", dimless/dimTime, Zero);
|
||||
Sp_[phase.name()] = dimensionedScalar("Sp", dimless/dimTime, Zero);
|
||||
|
||||
// Add alpha*div(U)
|
||||
//const volScalarField& alpha = phase;
|
||||
//Su_[phase.name()] +=
|
||||
// fvc::div(phi)*min(max(alpha, scalar(0)), scalar(1));
|
||||
}
|
||||
|
||||
// Fill Su and Sp
|
||||
calculateSuSp();
|
||||
|
||||
// Limit phiAlphaCorr on each phase
|
||||
phasei = 0;
|
||||
for (phaseModel& phase : phases_)
|
||||
{
|
||||
volScalarField& alpha1 = phase;
|
||||
|
||||
surfaceScalarField& phiAlphaCorr = phiAlphaCorrs[phasei];
|
||||
|
||||
volScalarField::Internal& Su = Su_[phase.name()];
|
||||
volScalarField::Internal& Sp = Sp_[phase.name()];
|
||||
|
||||
MULES::limit
|
||||
(
|
||||
1.0/mesh_.time().deltaT().value(),
|
||||
geometricOneField(),
|
||||
alpha1,
|
||||
phi,
|
||||
phiAlphaCorr,
|
||||
Sp,
|
||||
Su,
|
||||
oneField(),
|
||||
zeroField(),
|
||||
true
|
||||
);
|
||||
++phasei;
|
||||
}
|
||||
|
||||
MULES::limitSum(phiAlphaCorrs);
|
||||
|
||||
volScalarField sumAlpha
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"sumAlpha",
|
||||
mesh_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar(dimless, Zero)
|
||||
);
|
||||
|
||||
phasei = 0;
|
||||
for (phaseModel& phase : phases_)
|
||||
{
|
||||
volScalarField& alpha1 = phase;
|
||||
|
||||
const volScalarField::Internal& Su = Su_[phase.name()];
|
||||
|
||||
const volScalarField::Internal& Sp = Sp_[phase.name()];
|
||||
|
||||
surfaceScalarField& phiAlpha = phiAlphaCorrs[phasei];
|
||||
|
||||
// Add a bounded upwind U-mean flux
|
||||
//phiAlpha += upwind<scalar>(mesh_, phi).flux(alpha1);
|
||||
fvScalarMatrix alpha1Eqn
|
||||
(
|
||||
fv::EulerDdtScheme<scalar>(mesh_).fvmDdt(alpha1)
|
||||
+ fv::gaussConvectionScheme<scalar>
|
||||
(
|
||||
mesh_,
|
||||
phi,
|
||||
upwind<scalar>(mesh_, phi)
|
||||
).fvmDiv(phi, alpha1)
|
||||
==
|
||||
Su + fvm::Sp(Sp, alpha1)
|
||||
);
|
||||
|
||||
alpha1Eqn.solve();
|
||||
|
||||
phiAlpha += alpha1Eqn.flux();
|
||||
|
||||
MULES::explicitSolve
|
||||
(
|
||||
geometricOneField(),
|
||||
alpha1,
|
||||
phi,
|
||||
phiAlpha,
|
||||
Sp,
|
||||
Su,
|
||||
oneField(),
|
||||
zeroField()
|
||||
);
|
||||
|
||||
phase.alphaPhi() = phiAlpha;
|
||||
|
||||
++phasei;
|
||||
}
|
||||
|
||||
if (acorr == nAlphaCorr - 1)
|
||||
{
|
||||
volScalarField sumAlpha
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"sumAlpha",
|
||||
mesh_.time().timeName(),
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar(dimless, Zero)
|
||||
);
|
||||
|
||||
// Reset rhoPhi
|
||||
rhoPhi_ = dimensionedScalar("rhoPhi", dimMass/dimTime, Zero);
|
||||
|
||||
for (phaseModel& phase : phases_)
|
||||
{
|
||||
volScalarField& alpha1 = phase;
|
||||
sumAlpha += alpha1;
|
||||
|
||||
// Update rhoPhi
|
||||
rhoPhi_ += fvc::interpolate(phase.rho()) * phase.alphaPhi();
|
||||
}
|
||||
|
||||
Info<< "Phase-sum volume fraction, min, max = "
|
||||
<< sumAlpha.weightedAverage(mesh_.V()).value()
|
||||
<< ' ' << min(sumAlpha).value()
|
||||
<< ' ' << max(sumAlpha).value()
|
||||
<< endl;
|
||||
|
||||
volScalarField sumCorr(1.0 - sumAlpha);
|
||||
|
||||
for (phaseModel& phase : phases_)
|
||||
{
|
||||
volScalarField& alpha = phase;
|
||||
alpha += alpha*sumCorr;
|
||||
|
||||
Info<< alpha.name() << " volume fraction = "
|
||||
<< alpha.weightedAverage(mesh_.V()).value()
|
||||
<< " Min(alpha) = " << min(alpha).value()
|
||||
<< " Max(alpha) = " << max(alpha).value()
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const Foam::UPtrList<Foam::phaseModel>& Foam::multiphaseSystem::phases() const
|
||||
{
|
||||
return phases_;
|
||||
}
|
||||
|
||||
|
||||
Foam::UPtrList<Foam::phaseModel>& Foam::multiphaseSystem::phases()
|
||||
{
|
||||
return phases_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::phaseModel& Foam::multiphaseSystem::phase(const label i) const
|
||||
{
|
||||
return phases_[i];
|
||||
}
|
||||
|
||||
|
||||
Foam::phaseModel& Foam::multiphaseSystem::phase(const label i)
|
||||
{
|
||||
return phases_[i];
|
||||
}
|
||||
|
||||
|
||||
Foam::dimensionedScalar Foam::multiphaseSystem::ddtAlphaMax() const
|
||||
{
|
||||
return ddtAlphaMax_;
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::multiphaseSystem::maxDiffNo() const
|
||||
{
|
||||
auto iter = phaseModels_.cbegin();
|
||||
|
||||
scalar maxVal = max(iter()->diffNo()).value();
|
||||
|
||||
for (++iter; iter != phaseModels_.cend(); ++iter)
|
||||
{
|
||||
maxVal = max(maxVal, max(iter()->diffNo()).value());
|
||||
}
|
||||
|
||||
return maxVal * mesh_.time().deltaT().value();
|
||||
}
|
||||
|
||||
|
||||
const Foam::multiphaseSystem::compressionFluxTable&
|
||||
Foam::multiphaseSystem::limitedPhiAlphas() const
|
||||
{
|
||||
return limitedPhiAlphas_;
|
||||
}
|
||||
|
||||
|
||||
Foam::multiphaseSystem::SuSpTable& Foam::multiphaseSystem::Su()
|
||||
{
|
||||
return Su_;
|
||||
}
|
||||
|
||||
|
||||
Foam::multiphaseSystem::SuSpTable& Foam::multiphaseSystem::Sp()
|
||||
{
|
||||
return Sp_;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::multiphaseSystem::read()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,178 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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::multiphaseSystem
|
||||
|
||||
Description
|
||||
Class which solves the volume fraction equations for multiple phases
|
||||
|
||||
SourceFiles
|
||||
multiphaseSystem.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef multiphaseSystem_H
|
||||
#define multiphaseSystem_H
|
||||
|
||||
#include "phaseSystem.H"
|
||||
#include "UPtrList.H"
|
||||
#include "phasePairKey.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class multiphaseSystem Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class multiphaseSystem
|
||||
:
|
||||
public phaseSystem
|
||||
{
|
||||
protected:
|
||||
|
||||
typedef HashTable<volScalarField::Internal> SuSpTable;
|
||||
|
||||
typedef HashTable<scalar, phasePairKey, phasePairKey::hash>
|
||||
scalarTable;
|
||||
|
||||
typedef HashTable<surfaceScalarField> compressionFluxTable;
|
||||
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Unallocated phase list
|
||||
UPtrList<phaseModel> phases_;
|
||||
|
||||
//- Table for compression factors between phases
|
||||
scalarTable cAlphas_;
|
||||
|
||||
//- Maximum volumen rate change
|
||||
dimensionedScalar ddtAlphaMax_;
|
||||
|
||||
//- Compression fluxed for phases
|
||||
compressionFluxTable limitedPhiAlphas_;
|
||||
|
||||
//- Su phase source terms
|
||||
SuSpTable Su_;
|
||||
|
||||
//- Sp phase source terms
|
||||
SuSpTable Sp_;
|
||||
|
||||
|
||||
// Protected members
|
||||
|
||||
//- Calculate Sp and Su
|
||||
void calculateSuSp();
|
||||
|
||||
//- Solve alphas
|
||||
void solveAlphas();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("multiphaseSystem");
|
||||
|
||||
// Declare runtime construction
|
||||
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
multiphaseSystem,
|
||||
dictionary,
|
||||
(
|
||||
const fvMesh& mesh
|
||||
),
|
||||
(mesh)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from fvMesh
|
||||
multiphaseSystem(const fvMesh&);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~multiphaseSystem() = default;
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
static autoPtr<multiphaseSystem> New(const fvMesh& mesh);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Solve for the phase fractions
|
||||
virtual void solve();
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
//- Return phases
|
||||
const UPtrList<phaseModel>& phases() const;
|
||||
|
||||
//- Return phases
|
||||
UPtrList<phaseModel>& phases();
|
||||
|
||||
//- Constant access phase model i
|
||||
const phaseModel& phase(const label i) const;
|
||||
|
||||
//- Access phase model i
|
||||
phaseModel& phase(const label i);
|
||||
|
||||
//- Access to ddtAlphaMax
|
||||
dimensionedScalar ddtAlphaMax() const;
|
||||
|
||||
//- Maximum diffusion number
|
||||
scalar maxDiffNo() const;
|
||||
|
||||
//- Access to compression fluxes for phaes
|
||||
const compressionFluxTable& limitedPhiAlphas() const;
|
||||
|
||||
//- Access Su
|
||||
SuSpTable& Su();
|
||||
|
||||
//- Access Sp
|
||||
SuSpTable& Sp();
|
||||
|
||||
//- Read thermophysical properties dictionary
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,71 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "multiphaseSystem.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::multiphaseSystem> Foam::multiphaseSystem::New
|
||||
(
|
||||
const fvMesh& mesh
|
||||
)
|
||||
{
|
||||
const IOdictionary dict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
phasePropertiesName,
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE,
|
||||
false // Do not register
|
||||
)
|
||||
);
|
||||
|
||||
const word systemType(dict.get<word>("type"));
|
||||
|
||||
Info<< "Selecting multiphaseSystem " << systemType << endl;
|
||||
|
||||
const auto cstrIter = dictionaryConstructorTablePtr_->cfind(systemType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
dict,
|
||||
"multiphaseSystem",
|
||||
systemType,
|
||||
*dictionaryConstructorTablePtr_
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<multiphaseSystem>(cstrIter()(mesh));
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,51 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "addToRunTimeSelectionTable.H"
|
||||
|
||||
#include "phaseSystem.H"
|
||||
#include "multiphaseSystem.H"
|
||||
#include "MassTransferPhaseSystem.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
typedef
|
||||
MassTransferPhaseSystem<multiphaseSystem> massTransferMultiphaseSystem;
|
||||
|
||||
addNamedToRunTimeSelectionTable
|
||||
(
|
||||
multiphaseSystem,
|
||||
massTransferMultiphaseSystem,
|
||||
dictionary,
|
||||
massTransferMultiphaseSystem
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,137 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "MovingPhaseModel.H"
|
||||
|
||||
#include "phaseSystem.H"
|
||||
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
#include "slipFvPatchFields.H"
|
||||
#include "partialSlipFvPatchFields.H"
|
||||
|
||||
#include "fvmDdt.H"
|
||||
#include "fvmDiv.H"
|
||||
|
||||
#include "fvmSup.H"
|
||||
#include "fvcDdt.H"
|
||||
#include "fvcDiv.H"
|
||||
#include "surfaceInterpolate.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class BasePhaseModel>
|
||||
Foam::MovingPhaseModel<BasePhaseModel>::MovingPhaseModel
|
||||
(
|
||||
const phaseSystem& fluid,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
BasePhaseModel(fluid, phaseName),
|
||||
U_(fluid.mesh().lookupObject<volVectorField>("U")),
|
||||
phi_(fluid.mesh().lookupObject<surfaceScalarField>("phi")),
|
||||
alphaPhi_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("alphaPhi", phaseModel::name()),
|
||||
fluid.mesh().time().timeName(),
|
||||
fluid.mesh()
|
||||
),
|
||||
fluid.mesh(),
|
||||
dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class BasePhaseModel>
|
||||
void Foam::MovingPhaseModel<BasePhaseModel>::correct()
|
||||
{
|
||||
BasePhaseModel::correct();
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel>
|
||||
Foam::tmp<Foam::surfaceScalarField>
|
||||
Foam::MovingPhaseModel<BasePhaseModel>::phi() const
|
||||
{
|
||||
return tmp<surfaceScalarField>(phi_);
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel>
|
||||
const Foam::surfaceScalarField&
|
||||
Foam::MovingPhaseModel<BasePhaseModel>::phi()
|
||||
{
|
||||
return phi_;
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel>
|
||||
Foam::tmp<Foam::surfaceScalarField>
|
||||
Foam::MovingPhaseModel<BasePhaseModel>::alphaPhi() const
|
||||
{
|
||||
return tmp<surfaceScalarField>(alphaPhi_);
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel>
|
||||
Foam::surfaceScalarField&
|
||||
Foam::MovingPhaseModel<BasePhaseModel>::alphaPhi()
|
||||
{
|
||||
return alphaPhi_;
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel>
|
||||
Foam::tmp<Foam::volVectorField>
|
||||
Foam::MovingPhaseModel<BasePhaseModel>::U() const
|
||||
{
|
||||
return tmp<volVectorField>(U_);
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel>
|
||||
Foam::tmp<Foam::surfaceScalarField> Foam::MovingPhaseModel<BasePhaseModel>::
|
||||
diffNo() const
|
||||
{
|
||||
return tmp<surfaceScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("diffNo", phaseModel::name()),
|
||||
U_.mesh().time().timeName(),
|
||||
U_.mesh()
|
||||
),
|
||||
U_.mesh(),
|
||||
dimensionedScalar(dimless, Zero)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,129 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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::MovingPhaseModel
|
||||
|
||||
Description
|
||||
Class which represents a moving fluid phase. Holds the velocity, fluxes and
|
||||
turbulence model. Provides access to the turbulent quantities.
|
||||
|
||||
Possible future extensions include separating the turbulent fuctionality
|
||||
into another layer.
|
||||
|
||||
SourceFiles
|
||||
MovingPhaseModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef MovingPhaseModel_H
|
||||
#define MovingPhaseModel_H
|
||||
|
||||
#include "phaseModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class phaseModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class BasePhaseModel>
|
||||
class MovingPhaseModel
|
||||
:
|
||||
public BasePhaseModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Reference to U
|
||||
const volVectorField& U_;
|
||||
|
||||
//- Reference to phi
|
||||
const surfaceScalarField& phi_;
|
||||
|
||||
//- Volumetric flux
|
||||
surfaceScalarField alphaPhi_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
MovingPhaseModel
|
||||
(
|
||||
const phaseSystem& fluid,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~MovingPhaseModel() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct the phase properties other than the thermo and turbulence
|
||||
virtual void correct();
|
||||
|
||||
|
||||
// Momentum
|
||||
|
||||
//- Constant access the volumetric flux
|
||||
virtual tmp<surfaceScalarField> phi() const;
|
||||
|
||||
//- Access the volumetric flux
|
||||
virtual const surfaceScalarField& phi();
|
||||
|
||||
//- Constant access the volumetric flux of the phase
|
||||
virtual tmp<surfaceScalarField> alphaPhi() const;
|
||||
|
||||
//- Access the volumetric flux of the phase
|
||||
virtual surfaceScalarField& alphaPhi();
|
||||
|
||||
//- Access const reference to U
|
||||
virtual tmp<volVectorField> U() const;
|
||||
|
||||
//- Diffusion number
|
||||
virtual tmp<surfaceScalarField> diffNo() const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "MovingPhaseModel.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,415 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "MultiComponentPhaseModel.H"
|
||||
|
||||
#include "phaseSystem.H"
|
||||
#include "multiphaseSystem.H"
|
||||
#include "fvmDdt.H"
|
||||
#include "fvmDiv.H"
|
||||
#include "fvmSup.H"
|
||||
#include "fvmLaplacian.H"
|
||||
#include "fvcDdt.H"
|
||||
#include "fvcDiv.H"
|
||||
#include "fvcDDt.H"
|
||||
#include "fvMatrix.H"
|
||||
#include "fvcFlux.H"
|
||||
#include "CMULES.H"
|
||||
#include "subCycle.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class BasePhaseModel, class phaseThermo>
|
||||
Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>::
|
||||
MultiComponentPhaseModel
|
||||
(
|
||||
const phaseSystem& fluid,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
BasePhaseModel(fluid, phaseName),
|
||||
species_(),
|
||||
inertIndex_(-1)
|
||||
{
|
||||
thermoPtr_.set
|
||||
(
|
||||
phaseThermo::New
|
||||
(
|
||||
fluid.mesh(),
|
||||
phaseName,
|
||||
basicThermo::phasePropertyName(basicThermo::dictName, phaseName)
|
||||
).ptr()
|
||||
);
|
||||
|
||||
if (thermoPtr_->composition().species().empty())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< " The selected thermo is pure. Use a multicomponent thermo."
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
species_ = thermoPtr_->composition().species();
|
||||
|
||||
inertIndex_ = species_[thermoPtr_().template get<word>("inertSpecie")];
|
||||
|
||||
X_.setSize(thermoPtr_->composition().species().size());
|
||||
|
||||
// Initiate X's using Y's to set BC's
|
||||
forAll(species_, i)
|
||||
{
|
||||
X_.set
|
||||
(
|
||||
i,
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("X" + species_[i], phaseName),
|
||||
fluid.mesh().time().timeName(),
|
||||
fluid.mesh()
|
||||
),
|
||||
Y()[i]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Init vol fractions from mass fractions
|
||||
calculateVolumeFractions();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
template<class BasePhaseModel, class phaseThermo>
|
||||
void Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>
|
||||
::calculateVolumeFractions()
|
||||
{
|
||||
volScalarField Xtotal(0.0*X_[0]);
|
||||
const volScalarField W(thermo().W());
|
||||
|
||||
forAll(X_, i)
|
||||
{
|
||||
const dimensionedScalar Wi
|
||||
(
|
||||
"W",
|
||||
dimMass/dimMoles,
|
||||
thermo().composition().W(i)
|
||||
);
|
||||
|
||||
if (i != inertIndex_)
|
||||
{
|
||||
X_[i] = W*Y()[i]/Wi;
|
||||
Xtotal += X_[i];
|
||||
X_[i].correctBoundaryConditions();
|
||||
}
|
||||
}
|
||||
X_[inertIndex_] = 1.0 - Xtotal;
|
||||
X_[inertIndex_].correctBoundaryConditions();
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel, class phaseThermo>
|
||||
void Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>::
|
||||
calculateMassFractions()
|
||||
{
|
||||
volScalarField W(X_[0]*thermo().composition().W(0));
|
||||
for(label i=1; i< species_.size(); i++)
|
||||
{
|
||||
W += X_[i]*thermo().composition().W(i);
|
||||
}
|
||||
|
||||
forAll(Y(), i)
|
||||
{
|
||||
Y()[i] = X_[i]*thermo().composition().W(i)/W;
|
||||
|
||||
Info<< Y()[i].name() << " mass fraction = "
|
||||
<< " Min(Y) = " << min(Y()[i]).value()
|
||||
<< " Max(Y) = " << max(Y()[i]).value()
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel, class phaseThermo>
|
||||
const phaseThermo&
|
||||
Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>::thermo() const
|
||||
{
|
||||
return thermoPtr_();
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel, class phaseThermo>
|
||||
phaseThermo&
|
||||
Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>::thermo()
|
||||
{
|
||||
return thermoPtr_();
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel, class phaseThermo>
|
||||
void Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>::correct()
|
||||
{
|
||||
return thermo().correct();
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel, class phaseThermo>
|
||||
void Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>::solveYi
|
||||
(
|
||||
PtrList<volScalarField::Internal>& Su,
|
||||
PtrList<volScalarField::Internal>& Sp
|
||||
)
|
||||
{
|
||||
const volScalarField& alpha1 = *this;
|
||||
|
||||
const fvMesh& mesh = alpha1.mesh();
|
||||
|
||||
const dictionary& MULEScontrols = mesh.solverDict(alpha1.name());
|
||||
|
||||
scalar cAlpha(MULEScontrols.get<scalar>("cYi"));
|
||||
|
||||
PtrList<surfaceScalarField> phiYiCorrs(species_.size());
|
||||
const surfaceScalarField& phi = this->fluid().phi();
|
||||
|
||||
surfaceScalarField phic(mag((phi)/mesh.magSf()));
|
||||
|
||||
phic = min(cAlpha*phic, max(phic));
|
||||
|
||||
surfaceScalarField phir(0.0*phi);
|
||||
|
||||
forAllConstIter(phaseSystem::phaseModelTable,this->fluid().phases(),iter2)
|
||||
{
|
||||
const volScalarField& alpha2 = iter2()();
|
||||
if (&alpha2 == &alpha1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
phir += phic*this->fluid().nHatf(alpha1, alpha2);
|
||||
}
|
||||
|
||||
// Do not compress interface at non-coupled boundary faces
|
||||
// (inlets, outlets etc.)
|
||||
surfaceScalarField::Boundary& phirBf = phir.boundaryFieldRef();
|
||||
forAll(phir.boundaryField(), patchi)
|
||||
{
|
||||
fvsPatchScalarField& phirp = phirBf[patchi];
|
||||
|
||||
if (!phirp.coupled())
|
||||
{
|
||||
phirp == 0;
|
||||
}
|
||||
}
|
||||
|
||||
word phirScheme("div(Yiphir," + alpha1.name() + ')');
|
||||
|
||||
forAll(X_, i)
|
||||
{
|
||||
if (inertIndex_ != i)
|
||||
{
|
||||
volScalarField& Yi = X_[i];
|
||||
|
||||
phiYiCorrs.set
|
||||
(
|
||||
i,
|
||||
new surfaceScalarField
|
||||
(
|
||||
"phi" + Yi.name() + "Corr",
|
||||
fvc::flux
|
||||
(
|
||||
phi,
|
||||
Yi,
|
||||
"div(phi," + Yi.name() + ')'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
surfaceScalarField& phiYiCorr = phiYiCorrs[i];
|
||||
|
||||
forAllConstIter
|
||||
(
|
||||
phaseSystem::phaseModelTable, this->fluid().phases(), iter2
|
||||
)
|
||||
{
|
||||
//const volScalarField& alpha2 = iter2()().oldTime();
|
||||
const volScalarField& alpha2 = iter2()();
|
||||
|
||||
if (&alpha2 == &alpha1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
phiYiCorr += fvc::flux
|
||||
(
|
||||
-fvc::flux(-phir, alpha2, phirScheme),
|
||||
Yi,
|
||||
phirScheme
|
||||
);
|
||||
}
|
||||
|
||||
// Ensure that the flux at inflow BCs is preserved
|
||||
forAll(phiYiCorr.boundaryField(), patchi)
|
||||
{
|
||||
fvsPatchScalarField& phiYiCorrp =
|
||||
phiYiCorr.boundaryFieldRef()[patchi];
|
||||
|
||||
if (!phiYiCorrp.coupled())
|
||||
{
|
||||
const scalarField& phi1p = phi.boundaryField()[patchi];
|
||||
const scalarField& Yip = Yi.boundaryField()[patchi];
|
||||
|
||||
forAll(phiYiCorrp, facei)
|
||||
{
|
||||
if (phi1p[facei] < 0)
|
||||
{
|
||||
phiYiCorrp[facei] = Yip[facei]*phi1p[facei];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MULES::limit
|
||||
(
|
||||
1.0/mesh.time().deltaT().value(),
|
||||
geometricOneField(),
|
||||
Yi,
|
||||
phi,
|
||||
phiYiCorr,
|
||||
Sp[i],
|
||||
Su[i],
|
||||
oneField(),
|
||||
zeroField(),
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
volScalarField Yt(0.0*X_[0]);
|
||||
|
||||
scalar nYiSubCycles
|
||||
(
|
||||
MULEScontrols.getOrDefault<scalar>("nYiSubCycles", 1)
|
||||
);
|
||||
|
||||
forAll(X_, i)
|
||||
{
|
||||
if (inertIndex_ != i)
|
||||
{
|
||||
volScalarField& Yi = X_[i];
|
||||
|
||||
fvScalarMatrix YiEqn
|
||||
(
|
||||
fv::EulerDdtScheme<scalar>(mesh).fvmDdt(Yi)
|
||||
+ fv::gaussConvectionScheme<scalar>
|
||||
(
|
||||
mesh,
|
||||
phi,
|
||||
upwind<scalar>(mesh, phi)
|
||||
).fvmDiv(phi, Yi)
|
||||
==
|
||||
Su[i] + fvm::Sp(Sp[i], Yi)
|
||||
);
|
||||
|
||||
YiEqn.solve();
|
||||
|
||||
surfaceScalarField& phiYiCorr = phiYiCorrs[i];
|
||||
|
||||
// Add a bounded upwind U-mean flux
|
||||
phiYiCorr += YiEqn.flux();
|
||||
|
||||
if (nYiSubCycles > 1)
|
||||
{
|
||||
for
|
||||
(
|
||||
subCycle<volScalarField> YiSubCycle(Yi, nYiSubCycles);
|
||||
!(++YiSubCycle).end();
|
||||
)
|
||||
{
|
||||
MULES::explicitSolve
|
||||
(
|
||||
geometricOneField(),
|
||||
Yi,
|
||||
phi,
|
||||
phiYiCorr,
|
||||
Sp[i],
|
||||
Su[i],
|
||||
oneField(),
|
||||
zeroField()
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MULES::explicitSolve
|
||||
(
|
||||
geometricOneField(),
|
||||
Yi,
|
||||
phi,
|
||||
phiYiCorr,
|
||||
Sp[i],
|
||||
Su[i],
|
||||
oneField(),
|
||||
zeroField()
|
||||
);
|
||||
}
|
||||
Yt += Yi;
|
||||
}
|
||||
}
|
||||
|
||||
X_[inertIndex_] = scalar(1) - Yt;
|
||||
X_[inertIndex_].max(0.0);
|
||||
|
||||
calculateMassFractions();
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel, class phaseThermo>
|
||||
const Foam::PtrList<Foam::volScalarField>&
|
||||
Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>::Y() const
|
||||
{
|
||||
return thermoPtr_->composition().Y();
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel, class phaseThermo>
|
||||
Foam::PtrList<Foam::volScalarField>&
|
||||
Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>::Y()
|
||||
{
|
||||
return thermoPtr_->composition().Y();
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel, class phaseThermo>
|
||||
Foam::label
|
||||
Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>::inertIndex() const
|
||||
{
|
||||
return inertIndex_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,155 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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::MultiComponentPhaseModel
|
||||
|
||||
Description
|
||||
Class which represents a phase with multiple species. Returns the species'
|
||||
mass fractions, and their governing equations.
|
||||
|
||||
SourceFiles
|
||||
MultiComponentPhaseModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef MultiComponentPhaseModel_H
|
||||
#define MultiComponentPhaseModel_H
|
||||
|
||||
#include "phaseModel.H"
|
||||
#include "hashedWordList.H"
|
||||
#include "rhoReactionThermo.H"
|
||||
#include "basicThermo.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class phaseModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class BasePhaseModel, class phaseThermo>
|
||||
class MultiComponentPhaseModel
|
||||
:
|
||||
public BasePhaseModel
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Species table
|
||||
hashedWordList species_;
|
||||
|
||||
//- Inert species index
|
||||
label inertIndex_;
|
||||
|
||||
//- Thermophysical model
|
||||
autoPtr<phaseThermo> thermoPtr_;
|
||||
|
||||
//- Ptr list of volumetric fractions for species
|
||||
PtrList<volScalarField> X_;
|
||||
|
||||
|
||||
// Protected functions
|
||||
|
||||
//- Transfor volume fraction into mass fractions
|
||||
void calculateMassFractions();
|
||||
|
||||
//- Transfor mass fraction into volume fractions
|
||||
void calculateVolumeFractions();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
MultiComponentPhaseModel
|
||||
(
|
||||
const phaseSystem& fluid,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~MultiComponentPhaseModel() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Species table
|
||||
const hashedWordList& species() const
|
||||
{
|
||||
return species_;
|
||||
}
|
||||
|
||||
|
||||
// Thermo
|
||||
|
||||
//- Access to thermo
|
||||
virtual const phaseThermo& thermo() const;
|
||||
|
||||
//- Access non-const thermo
|
||||
virtual phaseThermo& thermo();
|
||||
|
||||
//- Correct phase thermo
|
||||
virtual void correct();
|
||||
|
||||
//- Solve species fraction equation
|
||||
virtual void solveYi
|
||||
(
|
||||
PtrList<volScalarField::Internal>&,
|
||||
PtrList<volScalarField::Internal>&
|
||||
);
|
||||
|
||||
//- Constant access the species mass fractions
|
||||
virtual const PtrList<volScalarField>& Y() const;
|
||||
|
||||
//- Access the species mass fractions
|
||||
virtual PtrList<volScalarField>& Y();
|
||||
|
||||
//- Return inert species index
|
||||
label inertIndex() const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "MultiComponentPhaseModel.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,99 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "PurePhaseModel.H"
|
||||
#include "phaseSystem.H"
|
||||
#include "basicThermo.H"
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class BasePhaseModel, class phaseThermo>
|
||||
Foam::PurePhaseModel<BasePhaseModel, phaseThermo>::PurePhaseModel
|
||||
(
|
||||
const phaseSystem& fluid,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
BasePhaseModel(fluid, phaseName)
|
||||
{
|
||||
thermoPtr_.set
|
||||
(
|
||||
phaseThermo::New
|
||||
(
|
||||
fluid.mesh(),
|
||||
phaseName,
|
||||
basicThermo::phasePropertyName(basicThermo::dictName, phaseName)
|
||||
).ptr()
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class BasePhaseModel, class phaseThermo>
|
||||
void Foam::PurePhaseModel<BasePhaseModel, phaseThermo>::solveYi
|
||||
(
|
||||
PtrList<Foam::volScalarField::Internal>&,
|
||||
PtrList<Foam::volScalarField::Internal>&
|
||||
)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel, class phaseThermo>
|
||||
const Foam::PtrList<Foam::volScalarField>&
|
||||
Foam::PurePhaseModel<BasePhaseModel, phaseThermo>::Y() const
|
||||
{
|
||||
return Y_;
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel, class phaseThermo>
|
||||
Foam::PtrList<Foam::volScalarField>&
|
||||
Foam::PurePhaseModel<BasePhaseModel, phaseThermo>::Y()
|
||||
{
|
||||
return Y_;
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel, class phaseThermo>
|
||||
const phaseThermo& Foam::PurePhaseModel<BasePhaseModel, phaseThermo>::
|
||||
thermo() const
|
||||
{
|
||||
return thermoPtr_();
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel, class phaseThermo>
|
||||
phaseThermo& Foam::PurePhaseModel<BasePhaseModel, phaseThermo>::thermo()
|
||||
{
|
||||
return thermoPtr_();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,126 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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::PurePhaseModel
|
||||
|
||||
Description
|
||||
Class which represents pure phases, i.e. without any species. Returns an
|
||||
empty list of mass fractions.
|
||||
|
||||
SourceFiles
|
||||
PurePhaseModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef PurePhaseModel_H
|
||||
#define PurePhaseModel_H
|
||||
|
||||
#include "PtrList.H"
|
||||
#include "volFields.H"
|
||||
#include "fvMatricesFwd.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class phaseSystem;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class PurePhaseModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class BasePhaseModel, class phaseThermo>
|
||||
class PurePhaseModel
|
||||
:
|
||||
public BasePhaseModel
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Empty mass fraction field list
|
||||
PtrList<volScalarField> Y_;
|
||||
|
||||
//- Empty thermophysical model Ptr
|
||||
autoPtr<phaseThermo> thermoPtr_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
PurePhaseModel
|
||||
(
|
||||
const phaseSystem& fluid,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~PurePhaseModel() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Thermo
|
||||
|
||||
//- Return the species mass fractions
|
||||
virtual const PtrList<volScalarField>& Y() const;
|
||||
|
||||
//- Access the species mass fractions
|
||||
virtual PtrList<volScalarField>& Y();
|
||||
|
||||
//- Solve species fraction equation
|
||||
virtual void solveYi
|
||||
(
|
||||
PtrList<volScalarField::Internal>&,
|
||||
PtrList<volScalarField::Internal>&
|
||||
);
|
||||
|
||||
//- Access to const thermo
|
||||
virtual const phaseThermo& thermo() const;
|
||||
|
||||
//- Access non-const thermo
|
||||
virtual phaseThermo& thermo();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "PurePhaseModel.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,175 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "StaticPhaseModel.H"
|
||||
|
||||
#include "phaseSystem.H"
|
||||
|
||||
#include "fvcDdt.H"
|
||||
#include "fvcDiv.H"
|
||||
#include "surfaceInterpolate.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class BasePhaseModel>
|
||||
Foam::StaticPhaseModel<BasePhaseModel>::StaticPhaseModel
|
||||
(
|
||||
const phaseSystem& fluid,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
BasePhaseModel(fluid, phaseName),
|
||||
U_(fluid.mesh().lookupObject<volVectorField>("U")),
|
||||
phi_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("phi", phaseModel::name()),
|
||||
fluid.mesh().time().timeName(),
|
||||
fluid.mesh()
|
||||
),
|
||||
fluid.mesh(),
|
||||
dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero)
|
||||
),
|
||||
alphaPhi_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("alphaPhi", phaseModel::name()),
|
||||
fluid.mesh().time().timeName(),
|
||||
fluid.mesh()
|
||||
),
|
||||
fluid.mesh(),
|
||||
dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class BasePhaseModel>
|
||||
void Foam::StaticPhaseModel<BasePhaseModel>::correct()
|
||||
{
|
||||
BasePhaseModel::correct();
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel>
|
||||
Foam::tmp<Foam::surfaceScalarField>
|
||||
Foam::StaticPhaseModel<BasePhaseModel>::phi() const
|
||||
{
|
||||
return tmp<surfaceScalarField>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("phi", phaseModel::name()),
|
||||
U_.mesh().time().timeName(),
|
||||
U_.mesh()
|
||||
),
|
||||
U_.mesh(),
|
||||
dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel>
|
||||
const Foam::surfaceScalarField&
|
||||
Foam::StaticPhaseModel<BasePhaseModel>::phi()
|
||||
{
|
||||
phi_ = dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero);
|
||||
return phi_;
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel>
|
||||
Foam::tmp<Foam::surfaceScalarField>
|
||||
Foam::StaticPhaseModel<BasePhaseModel>::alphaPhi() const
|
||||
{
|
||||
return tmp<surfaceScalarField>
|
||||
(
|
||||
new surfaceScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("alphaPhi", phaseModel::name()),
|
||||
U_.mesh().time().timeName(),
|
||||
U_.mesh()
|
||||
),
|
||||
U_.mesh(),
|
||||
dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel>
|
||||
Foam::surfaceScalarField&
|
||||
Foam::StaticPhaseModel<BasePhaseModel>::alphaPhi()
|
||||
{
|
||||
alphaPhi_ = dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero);
|
||||
return alphaPhi_;
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel>
|
||||
Foam::tmp<Foam::volVectorField>
|
||||
Foam::StaticPhaseModel<BasePhaseModel>::U() const
|
||||
{
|
||||
return tmp<volVectorField>
|
||||
(
|
||||
new volVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("U", phaseModel::name()),
|
||||
U_.mesh().time().timeName(),
|
||||
U_.mesh()
|
||||
),
|
||||
U_.mesh(),
|
||||
dimensionedVector(dimVelocity, Zero)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseModel>
|
||||
Foam::tmp<Foam::surfaceScalarField> Foam::StaticPhaseModel<BasePhaseModel>
|
||||
::diffNo() const
|
||||
{
|
||||
tmp<surfaceScalarField> tkapparhoCpbyDelta
|
||||
(
|
||||
sqr(U_.mesh().surfaceInterpolation::deltaCoeffs())
|
||||
*fvc::interpolate(this->kappa().ref())
|
||||
/fvc::interpolate((this->Cp()*this->rho())())
|
||||
);
|
||||
|
||||
return tkapparhoCpbyDelta;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,125 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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::StaticPhaseModel
|
||||
|
||||
Description
|
||||
Class which represents a static fluid phase.
|
||||
|
||||
SourceFiles
|
||||
StaticPhaseModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef StaticPhaseModel_H
|
||||
#define StaticPhaseModel_H
|
||||
|
||||
#include "phaseModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class phaseModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class BasePhaseModel>
|
||||
class StaticPhaseModel
|
||||
:
|
||||
public BasePhaseModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Reference to U
|
||||
const volVectorField& U_;
|
||||
|
||||
//- Flux
|
||||
surfaceScalarField phi_;
|
||||
|
||||
//- Volumetric flux
|
||||
surfaceScalarField alphaPhi_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
StaticPhaseModel
|
||||
(
|
||||
const phaseSystem& fluid,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~StaticPhaseModel() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct the phase properties other than the thermo and turbulence
|
||||
virtual void correct();
|
||||
|
||||
|
||||
// Momentum
|
||||
|
||||
//- Constant access the volumetric flux. Return zero field
|
||||
virtual tmp<surfaceScalarField> phi() const;
|
||||
|
||||
//- Access the volumetric flux
|
||||
virtual const surfaceScalarField& phi();
|
||||
|
||||
//- Constant access the volumetric flux of the phase.
|
||||
virtual tmp<surfaceScalarField> alphaPhi() const;
|
||||
|
||||
//- Access the volumetric flux of the phase
|
||||
virtual surfaceScalarField& alphaPhi();
|
||||
|
||||
//- Access const reference to U
|
||||
virtual tmp<volVectorField> U() const;
|
||||
|
||||
//- Maximum diffusion number
|
||||
virtual tmp<surfaceScalarField> diffNo() const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "StaticPhaseModel.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,64 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef makePhaseTypes_H
|
||||
#define makePhaseTypes_H
|
||||
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define makePhaseTypes(MomemtumType, CompType, Phase, Thermo, Name) \
|
||||
\
|
||||
namespace Foam \
|
||||
{ \
|
||||
typedef Foam::MomemtumType \
|
||||
< \
|
||||
Foam::CompType \
|
||||
< \
|
||||
Foam::Phase, \
|
||||
Foam::Thermo \
|
||||
> \
|
||||
> \
|
||||
Name; \
|
||||
\
|
||||
addNamedToRunTimeSelectionTable \
|
||||
( \
|
||||
phaseModel, \
|
||||
Name, \
|
||||
phaseSystem, \
|
||||
Name \
|
||||
); \
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,300 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "phaseModel.H"
|
||||
#include "phaseSystem.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(phaseModel, 0);
|
||||
defineRunTimeSelectionTable(phaseModel, phaseSystem);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::phaseModel::phaseModel
|
||||
(
|
||||
const phaseSystem& fluid,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("alpha", phaseName),
|
||||
fluid.mesh().time().timeName(),
|
||||
fluid.mesh(),
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
fluid.mesh(),
|
||||
dimensionedScalar(dimless, Zero)
|
||||
),
|
||||
fluid_(fluid),
|
||||
name_(phaseName)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::word& Foam::phaseModel::name() const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::phaseSystem& Foam::phaseModel::fluid() const
|
||||
{
|
||||
return fluid_;
|
||||
}
|
||||
|
||||
|
||||
void Foam::phaseModel::correct()
|
||||
{
|
||||
thermo().correct();
|
||||
}
|
||||
|
||||
|
||||
void Foam::phaseModel::correctTurbulence()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::phaseModel::rho() const
|
||||
{
|
||||
return thermo().rho();
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::phaseModel::rho(const label patchI) const
|
||||
{
|
||||
return thermo().rho(patchI);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::phaseModel::hc() const
|
||||
{
|
||||
return thermo().hc();
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::phaseModel::Cp() const
|
||||
{
|
||||
return thermo().Cp();
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::phaseModel::Cp
|
||||
(
|
||||
const scalarField& p,
|
||||
const scalarField& T,
|
||||
const label patchI
|
||||
) const
|
||||
{
|
||||
return (thermo().Cp(p, T, patchI));
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::phaseModel::Cv() const
|
||||
{
|
||||
return thermo().Cv();
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::phaseModel::Cv
|
||||
(
|
||||
const scalarField& p,
|
||||
const scalarField& T,
|
||||
const label patchI
|
||||
) const
|
||||
{
|
||||
return thermo().Cv(p, T, patchI);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::phaseModel::gamma() const
|
||||
{
|
||||
return thermo().gamma();
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::phaseModel::gamma
|
||||
(
|
||||
const scalarField& p,
|
||||
const scalarField& T,
|
||||
const label patchI
|
||||
) const
|
||||
{
|
||||
return thermo().gamma(p, T, patchI);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::phaseModel::Cpv() const
|
||||
{
|
||||
return thermo().Cpv();
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::phaseModel::Cpv
|
||||
(
|
||||
const scalarField& p,
|
||||
const scalarField& T,
|
||||
const label patchI
|
||||
) const
|
||||
{
|
||||
return thermo().Cpv(p, T, patchI);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::phaseModel::CpByCpv() const
|
||||
{
|
||||
return thermo().CpByCpv();
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::phaseModel::CpByCpv
|
||||
(
|
||||
const scalarField& p,
|
||||
const scalarField& T,
|
||||
const label patchI
|
||||
) const
|
||||
{
|
||||
return thermo().CpByCpv(p, T, patchI);
|
||||
}
|
||||
|
||||
|
||||
const Foam::volScalarField& Foam::phaseModel::alpha() const
|
||||
{
|
||||
return thermo().alpha();
|
||||
}
|
||||
|
||||
|
||||
const Foam::scalarField& Foam::phaseModel::alpha(const label patchI) const
|
||||
{
|
||||
return thermo().alpha(patchI);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::phaseModel::kappa() const
|
||||
{
|
||||
return thermo().kappa();
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::phaseModel::kappa(const label patchI) const
|
||||
{
|
||||
return thermo().kappa(patchI);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::phaseModel::alphahe() const
|
||||
{
|
||||
return thermo().alphahe();
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::phaseModel::alphahe(const label patchI) const
|
||||
{
|
||||
return thermo().alphahe(patchI);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField>Foam::phaseModel::kappaEff
|
||||
(
|
||||
const volScalarField& kappat
|
||||
) const
|
||||
{
|
||||
tmp<volScalarField> kappaEff(kappa() + kappat);
|
||||
kappaEff.ref().rename("kappaEff" + name_);
|
||||
return kappaEff;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::phaseModel::kappaEff
|
||||
(
|
||||
const scalarField& kappat,
|
||||
const label patchI
|
||||
) const
|
||||
{
|
||||
return (kappa(patchI) + kappat);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::phaseModel::alphaEff
|
||||
(
|
||||
const volScalarField& alphat
|
||||
) const
|
||||
{
|
||||
return (thermo().alpha() + alphat);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::phaseModel::alphaEff
|
||||
(
|
||||
const scalarField& alphat,
|
||||
const label patchI
|
||||
) const
|
||||
{
|
||||
return (thermo().alpha(patchI) + alphat);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::phaseModel::mu() const
|
||||
{
|
||||
return thermo().mu();
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::phaseModel::mu(const label patchi) const
|
||||
{
|
||||
return thermo().mu(patchi);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::phaseModel::nu() const
|
||||
{
|
||||
return thermo().nu();
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::phaseModel::nu(const label patchi) const
|
||||
{
|
||||
return thermo().nu(patchi);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::phaseModel::read()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,333 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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::phaseModel
|
||||
|
||||
Description
|
||||
|
||||
|
||||
SourceFiles
|
||||
phaseModel.C
|
||||
newphaseModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef phaseModel_H
|
||||
#define phaseModel_H
|
||||
|
||||
#include "dictionary.H"
|
||||
#include "dimensionedScalar.H"
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "fvMatricesFwd.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "rhoThermo.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class phaseSystem;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class phaseModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class phaseModel
|
||||
:
|
||||
public volScalarField
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Reference to the phaseSystem to which this phase belongs
|
||||
const phaseSystem& fluid_;
|
||||
|
||||
//- Name of phase
|
||||
word name_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
ClassName("phaseModel");
|
||||
|
||||
// Declare runtime construction
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
phaseModel,
|
||||
phaseSystem,
|
||||
(
|
||||
const phaseSystem& fluid,
|
||||
const word& phaseName
|
||||
),
|
||||
(fluid, phaseName)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from phaseSystem and phaseName
|
||||
phaseModel(const phaseSystem& fluid, const word& phaseName);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~phaseModel() = default;
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
static autoPtr<phaseModel> New
|
||||
(
|
||||
const phaseSystem& fluid,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the name of this phase
|
||||
const word& name() const;
|
||||
|
||||
//- Return the system to which this phase belongs
|
||||
const phaseSystem& fluid() const;
|
||||
|
||||
//- Correct phase thermo
|
||||
virtual void correct();
|
||||
|
||||
//- Correct the turbulence
|
||||
virtual void correctTurbulence();
|
||||
|
||||
//- Solve species fraction equation
|
||||
virtual void solveYi
|
||||
(
|
||||
PtrList<volScalarField::Internal>& Su,
|
||||
PtrList<volScalarField::Internal>& Sp
|
||||
) = 0;
|
||||
|
||||
//- Read phase properties dictionary
|
||||
virtual bool read();
|
||||
|
||||
|
||||
// Thermo
|
||||
|
||||
//- Access const to phase thermo
|
||||
virtual const rhoThermo& thermo() const = 0;
|
||||
|
||||
//- Access to phase thermo
|
||||
virtual rhoThermo& thermo() = 0;
|
||||
|
||||
//- Return the phase density
|
||||
tmp<volScalarField> rho() const;
|
||||
|
||||
//- Return phase density on a patch
|
||||
tmp<scalarField> rho(const label patchi) const;
|
||||
|
||||
//- Chemical enthalpy for phase [J/kg]
|
||||
tmp<volScalarField> hc() const;
|
||||
|
||||
//- Return phase Cp
|
||||
tmp<volScalarField> Cp() const;
|
||||
|
||||
//- Heat capacity of the phase at constant pressure for patch
|
||||
// [J/kg/K]
|
||||
tmp<scalarField> Cp
|
||||
(
|
||||
const scalarField& p,
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Return Cv of the phase
|
||||
tmp<volScalarField> Cv() const;
|
||||
|
||||
//- Heat capacity at constant volume for phase for a patch [J/kg/K]
|
||||
tmp<scalarField> Cv
|
||||
(
|
||||
const scalarField& p,
|
||||
const scalarField& T,
|
||||
const label patchI
|
||||
) const;
|
||||
|
||||
//- Gamma = Cp/Cv of phase[]
|
||||
tmp<volScalarField> gamma() const;
|
||||
|
||||
//- Gamma = Cp/Cv for phase on patch []
|
||||
tmp<scalarField> gamma
|
||||
(
|
||||
const scalarField& p,
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Heat capacity at constant pressure/volume for phase [J/kg/K]
|
||||
tmp<volScalarField> Cpv() const;
|
||||
|
||||
//- Heat capacity at constant pressure/volume for phase at patch
|
||||
// [J/kg/K]
|
||||
tmp<scalarField> Cpv
|
||||
(
|
||||
const scalarField& p,
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Heat capacity ratio for phase []
|
||||
tmp<volScalarField> CpByCpv() const;
|
||||
|
||||
//- Heat capacity ratio for phase at patch []
|
||||
tmp<scalarField> CpByCpv
|
||||
(
|
||||
const scalarField& p,
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Query each thermo for dpdt
|
||||
Switch dpdt() const
|
||||
{
|
||||
return thermo().dpdt();
|
||||
}
|
||||
|
||||
|
||||
// Transport
|
||||
|
||||
//- Thermal diffusivity for enthalpy of mixture [kg/m/s]
|
||||
const volScalarField& alpha() const;
|
||||
|
||||
//- Thermal diffusivity for enthalpy of mixture for patch [kg/m/s]
|
||||
const scalarField& alpha(const label patchi) const;
|
||||
|
||||
//- Thermal diffusivity for temperature of phase [J/m/s/K]
|
||||
tmp<volScalarField> kappa() const;
|
||||
|
||||
//- Thermal diffusivity for temperature of phase for patch [J/m/s/K]
|
||||
tmp<scalarField> kappa(const label patchi) const;
|
||||
|
||||
//- Thermal diffusivity for energy of mixture [kg/m/s]
|
||||
tmp<volScalarField> alphahe() const;
|
||||
|
||||
//- Thermal diffusivity for energy of mixture for patch [kg/m/s]
|
||||
tmp<scalarField> alphahe(const label patchi) const;
|
||||
|
||||
//- Effective thermal diffusivity for temperature of phase [J/m/s/K]
|
||||
tmp<volScalarField> kappaEff(const volScalarField&) const;
|
||||
|
||||
//- Effective thermal diffusivity for temperature
|
||||
// of phase for patch [J/m/s/K]
|
||||
tmp<scalarField> kappaEff
|
||||
(
|
||||
const scalarField& alphat,
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Effective thermal diffusivity of phase [kg/m/s]
|
||||
tmp<volScalarField> alphaEff(const volScalarField& alphat) const;
|
||||
|
||||
//- Effective thermal diffusivity of phase for patch [kg/m/s]
|
||||
tmp<scalarField> alphaEff
|
||||
(
|
||||
const scalarField& alphat,
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Return the mixture kinematic viscosity
|
||||
virtual tmp<volScalarField> nu() const;
|
||||
|
||||
//- Return the mixture kinematic viscosity on patchi
|
||||
virtual tmp<scalarField> nu(const label patchi) const;
|
||||
|
||||
//- Return the mixture dymanic viscosity
|
||||
virtual tmp<volScalarField> mu() const;
|
||||
|
||||
//- Return the mixture dymanic viscosity on patchi
|
||||
virtual tmp<scalarField> mu(const label patchi) const;
|
||||
|
||||
//- Diffusion number
|
||||
virtual tmp<surfaceScalarField> diffNo() const = 0;
|
||||
|
||||
|
||||
// Species
|
||||
|
||||
//- Constant access the species mass fractions
|
||||
virtual const PtrList<volScalarField>& Y() const = 0;
|
||||
|
||||
//- Access the species mass fractions
|
||||
virtual PtrList<volScalarField>& Y() = 0;
|
||||
|
||||
|
||||
// Momentum
|
||||
|
||||
//- Constant access the volumetric flux
|
||||
virtual tmp<surfaceScalarField> phi() const = 0;
|
||||
|
||||
//- Access the volumetric flux
|
||||
virtual const surfaceScalarField& phi() = 0;
|
||||
|
||||
//- Constant access the volumetric flux of the phase
|
||||
virtual tmp<surfaceScalarField> alphaPhi() const = 0;
|
||||
|
||||
//- Access the volumetric flux of the phase
|
||||
virtual surfaceScalarField& alphaPhi() = 0;
|
||||
|
||||
//- Access const reference to U
|
||||
virtual tmp<volVectorField> U() const = 0;
|
||||
|
||||
|
||||
// Turbulence (WIP: possible to add turbulence on each phase)
|
||||
|
||||
/*
|
||||
//- Return the turbulent dynamic viscosity
|
||||
virtual tmp<volScalarField> mut() const = 0;
|
||||
|
||||
//- Return the turbulent dynamic viscosity on a patch
|
||||
virtual tmp<scalarField> mut(const label patchI) const = 0;
|
||||
|
||||
//- Return the turbulent kinematic viscosity
|
||||
virtual tmp<volScalarField> nut() const = 0;
|
||||
|
||||
//- Return the turbulent kinematic viscosity on a patch
|
||||
virtual tmp<scalarField> nut(const label patchI) const = 0;
|
||||
|
||||
//- Return the kinetic pressure derivative w.r.t. volume fraction
|
||||
virtual tmp<volScalarField> pPrime() const = 0;
|
||||
|
||||
//- Return the turbulent kinetic energy
|
||||
virtual tmp<volScalarField> k() const = 0;
|
||||
*/
|
||||
};
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,63 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "phaseModel.H"
|
||||
#include "phaseSystem.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::New
|
||||
(
|
||||
const phaseSystem& fluid,
|
||||
const word& phaseName
|
||||
)
|
||||
{
|
||||
const dictionary& dict = fluid.subDict(phaseName);
|
||||
|
||||
const word modelType(dict.get<word>("type"));
|
||||
|
||||
Info<< "Selecting phaseModel for "
|
||||
<< phaseName << ": " << modelType << endl;
|
||||
|
||||
const auto cstrIter = phaseSystemConstructorTablePtr_->cfind(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
dict,
|
||||
"phaseModel",
|
||||
modelType,
|
||||
*phaseSystemConstructorTablePtr_
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()(fluid, phaseName);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,78 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "makePhaseTypes.H"
|
||||
|
||||
#include "PurePhaseModel.H"
|
||||
#include "MultiComponentPhaseModel.H"
|
||||
#include "MovingPhaseModel.H"
|
||||
#include "StaticPhaseModel.H"
|
||||
|
||||
#include "rhoThermo.H"
|
||||
#include "solidThermo.H"
|
||||
#include "rhoReactionThermo.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePhaseTypes
|
||||
(
|
||||
MovingPhaseModel,
|
||||
PurePhaseModel,
|
||||
phaseModel,
|
||||
rhoThermo,
|
||||
pureMovingPhaseModel // Name of the phase type
|
||||
);
|
||||
|
||||
makePhaseTypes
|
||||
(
|
||||
StaticPhaseModel,
|
||||
PurePhaseModel,
|
||||
phaseModel,
|
||||
rhoThermo,
|
||||
pureStaticPhaseModel
|
||||
);
|
||||
|
||||
makePhaseTypes
|
||||
(
|
||||
StaticPhaseModel,
|
||||
PurePhaseModel,
|
||||
phaseModel,
|
||||
solidThermo,
|
||||
pureStaticSolidPhaseModel
|
||||
);
|
||||
|
||||
makePhaseTypes
|
||||
(
|
||||
MovingPhaseModel,
|
||||
MultiComponentPhaseModel,
|
||||
phaseModel,
|
||||
rhoReactionThermo,
|
||||
multiComponentMovingPhaseModel
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user