Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
HPCAPPs
OpenFOAM-GPU-v2.0
Commits
649c29f9
Commit
649c29f9
authored
Aug 30, 2023
by
quant
Browse files
Initial commit
parent
89db0b5a
Changes
789
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1934 additions
and
0 deletions
+1934
-0
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/Make/options
...ssibleInterFoam/overCompressibleInterDyMFoam/Make/options
+40
-0
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/TEqn.H
...compressibleInterFoam/overCompressibleInterDyMFoam/TEqn.H
+28
-0
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/UEqn.H
...compressibleInterFoam/overCompressibleInterDyMFoam/UEqn.H
+36
-0
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/alphaSuSp.H
...essibleInterFoam/overCompressibleInterDyMFoam/alphaSuSp.H
+43
-0
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/createFields.H
...ibleInterFoam/overCompressibleInterDyMFoam/createFields.H
+138
-0
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/overCompressibleInterDyMFoam.C
...erCompressibleInterDyMFoam/overCompressibleInterDyMFoam.C
+240
-0
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/pEqn.H
...compressibleInterFoam/overCompressibleInterDyMFoam/pEqn.H
+177
-0
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/pEqn.H
...lications/solvers/multiphase/compressibleInterFoam/pEqn.H
+145
-0
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/rhofs.H
...ications/solvers/multiphase/compressibleInterFoam/rhofs.H
+2
-0
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/Make/files
...ase/compressibleInterFoam/surfaceTensionModels/Make/files
+3
-0
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/Make/options
...e/compressibleInterFoam/surfaceTensionModels/Make/options
+15
-0
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.C
...nModels/liquidProperties/liquidPropertiesSurfaceTension.C
+150
-0
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.H
...nModels/liquidProperties/liquidPropertiesSurfaceTension.H
+125
-0
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/Make/files
...se/compressibleInterFoam/twoPhaseMixtureThermo/Make/files
+3
-0
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/Make/options
.../compressibleInterFoam/twoPhaseMixtureThermo/Make/options
+14
-0
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C
...leInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C
+410
-0
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H
...leInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H
+345
-0
OpenFOAM-v2112/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwclean
...vers/multiphase/compressibleMultiphaseInterFoam/Allwclean
+8
-0
OpenFOAM-v2112/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake
...lvers/multiphase/compressibleMultiphaseInterFoam/Allwmake
+9
-0
OpenFOAM-v2112/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Make/files
...ers/multiphase/compressibleMultiphaseInterFoam/Make/files
+3
-0
No files found.
Too many changes to show.
To preserve performance only
789 of 789+
files are displayed.
Plain diff
Email patch
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/Make/options
0 → 100644
View file @
649c29f9
EXE_INC = \
-I.. \
-I../../VoF \
-I../../interFoam/overInterDyMFoam \
-I../twoPhaseMixtureThermo \
-I../VoFphaseCompressibleTurbulenceModels/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/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)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(FOAM_SOLVERS)/incompressible/pimpleFoam/overPimpleDyMFoam \
-I$(LIB_SRC)/overset/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-ltwoPhaseMixtureThermo \
-ltwoPhaseSurfaceTension \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \
-ltwoPhaseMixture \
-ltwoPhaseProperties \
-linterfaceProperties \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-lVoFphaseCompressibleTurbulenceModels \
-ldynamicMesh \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-loverset \
-lwaveModels
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/TEqn.H
0 → 100644
View file @
649c29f9
{
fvScalarMatrix
TEqn
(
fvm
::
ddt
(
rho
,
T
)
+
fvm
::
div
(
rhoPhi
,
T
)
-
fvm
::
Sp
(
contErr
,
T
)
-
fvm
::
laplacian
(
turbulence
.
alphaEff
(),
T
)
+
(
divUp
()
// - contErr/rho*p
+
(
fvc
::
ddt
(
rho
,
K
)
+
fvc
::
div
(
rhoPhi
,
K
))()
-
contErr
*
K
)
*
(
alpha1
()
/
mixture
.
thermo1
().
Cv
()()
+
alpha2
()
/
mixture
.
thermo2
().
Cv
()()
)
==
fvOptions
(
rho
,
T
)
);
TEqn
.
relax
();
fvOptions
.
constrain
(
TEqn
);
TEqn
.
solve
();
fvOptions
.
correct
(
T
);
mixture
.
correctThermo
();
mixture
.
correct
();
}
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/UEqn.H
0 → 100644
View file @
649c29f9
MRF
.
correctBoundaryVelocity
(
U
);
fvVectorMatrix
UEqn
(
fvm
::
ddt
(
rho
,
U
)
+
fvm
::
div
(
rhoPhi
,
U
)
-
fvm
::
Sp
(
contErr
,
U
)
+
MRF
.
DDt
(
rho
,
U
)
+
turbulence
.
divDevRhoReff
(
U
)
==
fvOptions
(
rho
,
U
)
);
UEqn
.
relax
();
fvOptions
.
constrain
(
UEqn
);
if
(
pimple
.
momentumPredictor
())
{
solve
(
UEqn
==
cellMask
*
fvc
::
reconstruct
(
(
mixture
.
surfaceTensionForce
()
-
ghf
*
fvc
::
snGrad
(
rho
)
-
fvc
::
snGrad
(
p_rgh
)
)
*
mesh
.
magSf
()
)
);
fvOptions
.
correct
(
U
);
K
=
0
.
5
*
magSqr
(
U
);
}
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/alphaSuSp.H
0 → 100644
View file @
649c29f9
volScalarField
::
Internal
Sp
(
IOobject
(
"Sp"
,
runTime
.
timeName
(),
mesh
),
mesh
,
dimensionedScalar
(
dgdt
.
dimensions
(),
Zero
)
);
volScalarField
::
Internal
Su
(
IOobject
(
"Su"
,
runTime
.
timeName
(),
mesh
),
mesh
,
dimensionedScalar
(
dgdt
.
dimensions
(),
Zero
)
);
forAll
(
dgdt
,
celli
)
{
if
(
dgdt
[
celli
]
>
0
.
0
)
{
Sp
[
celli
]
-=
dgdt
[
celli
]
/
max
(
1
.
0
-
alpha1
[
celli
],
1e-4
);
Su
[
celli
]
+=
dgdt
[
celli
]
/
max
(
1
.
0
-
alpha1
[
celli
],
1e-4
);
}
else
if
(
dgdt
[
celli
]
<
0
.
0
)
{
Sp
[
celli
]
+=
dgdt
[
celli
]
/
max
(
alpha1
[
celli
],
1e-4
);
}
}
volScalarField
::
Internal
divU
(
mesh
.
moving
()
?
fvc
::
div
(
phi
+
mesh
.
phi
())
:
fvc
::
div
(
phi
)
);
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/createFields.H
0 → 100644
View file @
649c29f9
#include "createRDeltaT.H"
Info
<<
"Reading field p_rgh
\n
"
<<
endl
;
volScalarField
p_rgh
(
IOobject
(
"p_rgh"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
Info
<<
"Reading field U
\n
"
<<
endl
;
volVectorField
U
(
IOobject
(
"U"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
#include "createPhi.H"
Info
<<
"Constructing twoPhaseMixtureThermo
\n
"
<<
endl
;
twoPhaseMixtureThermo
mixture
(
U
,
phi
);
volScalarField
&
alpha1
(
mixture
.
alpha1
());
volScalarField
&
alpha2
(
mixture
.
alpha2
());
Info
<<
"Reading thermophysical properties
\n
"
<<
endl
;
const
volScalarField
&
rho1
=
mixture
.
thermo1
().
rho
();
const
volScalarField
&
rho2
=
mixture
.
thermo2
().
rho
();
volScalarField
rho
(
IOobject
(
"rho"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
READ_IF_PRESENT
,
IOobject
::
AUTO_WRITE
),
alpha1
*
rho1
+
alpha2
*
rho2
);
dimensionedScalar
pMin
(
"pMin"
,
dimPressure
,
mixture
);
mesh
.
setFluxRequired
(
p_rgh
.
name
());
mesh
.
setFluxRequired
(
alpha1
.
name
());
#include "readGravitationalAcceleration.H"
#include "readhRef.H"
#include "gh.H"
// Mass flux
// Initialisation does not matter because rhoPhi is reset after the
// alpha1 solution before it is used in the U equation.
surfaceScalarField
rhoPhi
(
IOobject
(
"rhoPhi"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
),
fvc
::
interpolate
(
rho
)
*
phi
);
volScalarField
dgdt
(
alpha1
*
fvc
::
div
(
phi
));
#include "createAlphaFluxes.H"
// Construct compressible turbulence model
compressibleInterPhaseTransportModel
turbulence
(
rho
,
U
,
phi
,
rhoPhi
,
alphaPhi10
,
mixture
);
#include "createK.H"
#include "createMRF.H"
#include "createFvOptions.H"
// Overset specific
// Add solver-specific interpolations
{
wordHashSet
&
nonInt
=
const_cast
<
wordHashSet
&>
(
Stencil
::
New
(
mesh
).
nonInterpolatedFields
());
nonInt
.
insert
(
"HbyA"
);
nonInt
.
insert
(
"grad(p_rgh)"
);
nonInt
.
insert
(
"nHat"
);
nonInt
.
insert
(
"surfaceIntegrate(phi)"
);
nonInt
.
insert
(
"surfaceIntegrate(phiHbyA)"
);
nonInt
.
insert
(
"cellMask"
);
nonInt
.
insert
(
"cellDisplacement"
);
nonInt
.
insert
(
"interpolatedCells"
);
nonInt
.
insert
(
"cellInterpolationWeight"
);
nonInt
.
insert
(
"pcorr"
);
}
// Mask field for zeroing out contributions on hole cells
#include "createCellMask.H"
surfaceScalarField
faceMask
(
localMin
<
scalar
>
(
mesh
).
interpolate
(
cellMask
)
);
// Create bool field with interpolated cells
#include "createInterpolatedCells.H"
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/overCompressibleInterDyMFoam.C
0 → 100644
View file @
649c29f9
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 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/>.
Application
overCompressibleInterDyMFoam
Group
grpMultiphaseSolvers
Description
Solver for two compressible, non-isothermal, immiscible fluids using VOF
(i.e. volume of fluid) phase-fraction based interface capturing approach.
This solver supports dynamic mesh motions including overset cases.
The momentum and other fluid properties are of the "mixture" and a single
momentum equation is solved.
Either mixture or two-phase transport modelling may be selected. In the
mixture approach, a single laminar, RAS or LES model is selected to model
the momentum stress. In the Euler-Euler two-phase approach separate
laminar, RAS or LES selected models are selected for each of the phases.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "CMULES.H"
#include "EulerDdtScheme.H"
#include "CrankNicolsonDdtScheme.H"
#include "subCycle.H"
#include "compressibleInterPhaseTransportModel.H"
#include "pimpleControl.H"
#include "fvOptions.H"
#include "fvcSmooth.H"
#include "cellCellStencilObject.H"
#include "localMin.H"
#include "interpolationCellPoint.H"
#include "transform.H"
#include "fvMeshSubset.H"
#include "oversetAdjustPhi.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Solver for two compressible, non-isothermal, immiscible fluids"
" using VOF phase-fraction based interface capturing approach.
\n
"
"Supports dynamic mesh motions including overset cases."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
pimpleControl
pimple
(
mesh
);
#include "createTimeControls.H"
#include "createDyMControls.H"
#include "createFields.H"
volScalarField
&
p
=
mixture
.
p
();
volScalarField
&
T
=
mixture
.
T
();
const
volScalarField
&
psi1
=
mixture
.
thermo1
().
psi
();
const
volScalarField
&
psi2
=
mixture
.
thermo2
().
psi
();
#include "correctPhi.H"
#include "createUf.H"
if
(
!
LTS
)
{
#include "CourantNo.H"
#include "setInitialDeltaT.H"
}
#include "setCellMask.H"
#include "setInterpolatedCells.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"
\n
Starting time loop
\n
"
<<
endl
;
while
(
runTime
.
run
())
{
#include "readControls.H"
if
(
LTS
)
{
#include "setRDeltaT.H"
}
else
{
#include "CourantNo.H"
#include "alphaCourantNo.H"
#include "setDeltaT.H"
}
++
runTime
;
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
// --- Pressure-velocity PIMPLE corrector loop
while
(
pimple
.
loop
())
{
if
(
pimple
.
firstIter
()
||
moveMeshOuterCorrectors
)
{
scalar
timeBeforeMeshUpdate
=
runTime
.
elapsedCpuTime
();
mesh
.
update
();
if
(
mesh
.
changing
())
{
Info
<<
"Execution time for mesh.update() = "
<<
runTime
.
elapsedCpuTime
()
-
timeBeforeMeshUpdate
<<
" s"
<<
endl
;
// Do not apply previous time-step mesh compression flux
// if the mesh topology changed
if
(
mesh
.
topoChanging
())
{
talphaPhi1Corr0
.
clear
();
}
gh
=
(
g
&
mesh
.
C
())
-
ghRef
;
ghf
=
(
g
&
mesh
.
Cf
())
-
ghRef
;
// Update cellMask field for blocking out hole cells
#include "setCellMask.H"
#include "setInterpolatedCells.H"
faceMask
=
localMin
<
scalar
>
(
mesh
).
interpolate
(
cellMask
.
oldTime
());
// Zero Uf on old faceMask (H-I)
Uf
*=
faceMask
;
const
surfaceVectorField
Uint
(
fvc
::
interpolate
(
U
));
// Update Uf and phi on new C-I faces
Uf
+=
(
1
-
faceMask
)
*
Uint
;
// Update Uf boundary
forAll
(
Uf
.
boundaryField
(),
patchI
)
{
Uf
.
boundaryFieldRef
()[
patchI
]
=
Uint
.
boundaryField
()[
patchI
];
}
phi
=
mesh
.
Sf
()
&
Uf
;
// Correct phi on individual regions
if
(
correctPhi
)
{
#include "correctPhi.H"
}
mixture
.
correct
();
// Zero phi on current H-I
faceMask
=
localMin
<
scalar
>
(
mesh
).
interpolate
(
cellMask
);
phi
*=
faceMask
;
U
*=
cellMask
;
// Make the flux relative to the mesh motion
fvc
::
makeRelative
(
phi
,
U
);
}
if
(
mesh
.
changing
()
&&
checkMeshCourantNo
)
{
#include "meshCourantNo.H"
}
}
#include "alphaControls.H"
#include "compressibleAlphaEqnSubCycle.H"
const
surfaceScalarField
faceMask
(
localMin
<
scalar
>
(
mesh
).
interpolate
(
cellMask
)
);
rhoPhi
*=
faceMask
;
turbulence
.
correctPhasePhi
();
#include "UEqn.H"
volScalarField
divUp
(
"divUp"
,
fvc
::
div
(
fvc
::
absolute
(
phi
,
U
),
p
));
#include "TEqn.H"
// --- Pressure corrector loop
while
(
pimple
.
correct
())
{
#include "pEqn.H"
}
if
(
pimple
.
turbCorr
())
{
turbulence
.
correct
();
}
}
runTime
.
write
();
runTime
.
printExecutionTime
(
Info
);
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/pEqn.H
0 → 100644
View file @
649c29f9
{
volScalarField
rAU
(
"rAU"
,
1
.
0
/
UEqn
.
A
());
surfaceScalarField
rAUf
(
"rAUf"
,
fvc
::
interpolate
(
rAU
));
volVectorField
HbyA
(
constrainHbyA
(
rAU
*
UEqn
.
H
(),
U
,
p_rgh
));
surfaceScalarField
phiHbyA
(
"phiHbyA"
,
fvc
::
flux
(
HbyA
)
);
if
(
ddtCorr
)
{
surfaceScalarField
faceMaskOld
(
localMin
<
scalar
>
(
mesh
).
interpolate
(
cellMask
.
oldTime
())
);
phiHbyA
+=
MRF
.
zeroFilter
(
fvc
::
interpolate
(
rho
*
rAU
)
*
faceMaskOld
*
fvc
::
ddtCorr
(
U
,
Uf
)
);
}
MRF
.
makeRelative
(
phiHbyA
);
surfaceScalarField
phig
(
(
mixture
.
surfaceTensionForce
()
-
ghf
*
fvc
::
snGrad
(
rho
)
)
*
faceMask
*
rAUf
*
mesh
.
magSf
()
);
phiHbyA
+=
phig
;
// Update the pressure BCs to ensure flux consistency
constrainPressure
(
p_rgh
,
U
,
phiHbyA
,
rAUf
,
MRF
);
tmp
<
fvScalarMatrix
>
p_rghEqnComp1
;
tmp
<
fvScalarMatrix
>
p_rghEqnComp2
;
if
(
pimple
.
transonic
())
{
#include "rhofs.H"
surfaceScalarField
phid1
(
"phid1"
,
fvc
::
interpolate
(
psi1
)
*
phi
);
surfaceScalarField
phid2
(
"phid2"
,
fvc
::
interpolate
(
psi2
)
*
phi
);
p_rghEqnComp1
=
pos
(
alpha1
)
*
(
(
fvc
::
ddt
(
alpha1
,
rho1
)
+
fvc
::
div
(
alphaPhi1
*
rho1f
)
-
(
fvOptions
(
alpha1
,
mixture
.
thermo1
().
rho
())
&
rho1
)
)
/
rho1
-
fvc
::
ddt
(
alpha1
)
-
fvc
::
div
(
alphaPhi1
)
+
(
alpha1
/
rho1
)
*
correction
(
psi1
*
fvm
::
ddt
(
p_rgh
)
+
fvm
::
div
(
phid1
,
p_rgh
)
-
fvm
::
Sp
(
fvc
::
div
(
phid1
),
p_rgh
)
)
);
p_rghEqnComp1
.
ref
().
relax
();
p_rghEqnComp2
=
pos
(
alpha2
)
*
(
(
fvc
::
ddt
(
alpha2
,
rho2
)
+
fvc
::
div
(
alphaPhi2
*
rho2f
)
-
(
fvOptions
(
alpha2
,
mixture
.
thermo2
().
rho
())
&
rho2
)
)
/
rho2
-
fvc
::
ddt
(
alpha2
)
-
fvc
::
div
(
alphaPhi2
)
+
(
alpha2
/
rho2
)
*
correction
(
psi2
*
fvm
::
ddt
(
p_rgh
)
+
fvm
::
div
(
phid2
,
p_rgh
)
-
fvm
::
Sp
(
fvc
::
div
(
phid2
),
p_rgh
)
)
);
p_rghEqnComp2
.
ref
().
relax
();
}
else
{
#include "rhofs.H"
p_rghEqnComp1
=
pos
(
alpha1
)
*
(
(
fvc
::
ddt
(
alpha1
,
rho1
)
+
fvc
::
div
(
alphaPhi1
*
rho1f
)
-
(
fvOptions
(
alpha1
,
mixture
.
thermo1
().
rho
())
&
rho1
)
)
/
rho1
-
fvc
::
ddt
(
alpha1
)
-
fvc
::
div
(
alphaPhi1
)
+
(
alpha1
*
psi1
/
rho1
)
*
correction
(
fvm
::
ddt
(
p_rgh
))
);
p_rghEqnComp2
=
pos
(
alpha2
)
*
(
(
fvc
::
ddt
(
alpha2
,
rho2
)
+
fvc
::
div
(
alphaPhi2
*
rho2f
)
-
(
fvOptions
(
alpha2
,
mixture
.
thermo2
().
rho
())
&
rho2
)
)
/
rho2
-
fvc
::
ddt
(
alpha2
)
-
fvc
::
div
(
alphaPhi2
)
+
(
alpha2
*
psi2
/
rho2
)
*
correction
(
fvm
::
ddt
(
p_rgh
))
);
}
// Cache p_rgh prior to solve for density update
volScalarField
p_rgh_0
(
p_rgh
);
while
(
pimple
.
correctNonOrthogonal
())
{
fvScalarMatrix
p_rghEqnIncomp
(
fvc
::
div
(
phiHbyA
)
-
fvm
::
laplacian
(
rAUf
,
p_rgh
)
);
solve
(
p_rghEqnComp1
()
+
p_rghEqnComp2
()
+
p_rghEqnIncomp
,
mesh
.
solver
(
p_rgh
.
select
(
pimple
.
finalInnerIter
()))
);
if
(
pimple
.
finalNonOrthogonalIter
())
{
p
=
max
(
p_rgh
+
(
alpha1
*
rho1
+
alpha2
*
rho2
)
*
gh
,
pMin
);
p_rgh
=
p
-
(
alpha1
*
rho1
+
alpha2
*
rho2
)
*
gh
;
dgdt
=
(
alpha1
*
(
p_rghEqnComp2
&
p_rgh
)
-
alpha2
*
(
p_rghEqnComp1
&
p_rgh
)
);
phi
=
phiHbyA
+
p_rghEqnIncomp
.
flux
();
U
=
cellMask
*
(
HbyA
+
rAU
*
fvc
::
reconstruct
((
phig
+
p_rghEqnIncomp
.
flux
())
/
rAUf
)
);
U
.
correctBoundaryConditions
();
fvOptions
.
correct
(
U
);
}
}
{
Uf
=
fvc
::
interpolate
(
U
);
surfaceVectorField
n
(
mesh
.
Sf
()
/
mesh
.
magSf
());
Uf
+=
n
*
(
fvc
::
absolute
(
phi
,
U
)
/
mesh
.
magSf
()
-
(
n
&
Uf
));
}
// Make the fluxes relative to the mesh motion
fvc
::
makeRelative
(
phi
,
U
);
// Zero faces H-I for transport Eq after pEq
phi
*=
faceMask
;
// Update densities from change in p_rgh
mixture
.
thermo1
().
correctRho
(
psi1
*
(
p_rgh
-
p_rgh_0
));
mixture
.
thermo2
().
correctRho
(
psi2
*
(
p_rgh
-
p_rgh_0
));
rho
=
alpha1
*
rho1
+
alpha2
*
rho2
;
// Correct p_rgh for consistency with p and the updated densities
p_rgh
=
p
-
rho
*
gh
;
p_rgh
.
correctBoundaryConditions
();
K
=
0
.
5
*
magSqr
(
U
);
}
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/pEqn.H
0 → 100644
View file @
649c29f9
{
volScalarField
rAU
(
"rAU"
,
1
.
0
/
UEqn
.
A
());
surfaceScalarField
rAUf
(
"rAUf"
,
fvc
::
interpolate
(
rAU
));
volVectorField
HbyA
(
constrainHbyA
(
rAU
*
UEqn
.
H
(),
U
,
p_rgh
));
surfaceScalarField
phiHbyA
(
"phiHbyA"
,
fvc
::
flux
(
HbyA
)
+
MRF
.
zeroFilter
(
fvc
::
interpolate
(
rho
*
rAU
)
*
fvc
::
ddtCorr
(
U
,
phi
))
);
MRF
.
makeRelative
(
phiHbyA
);
surfaceScalarField
phig
(
(
mixture
.
surfaceTensionForce
()
-
ghf
*
fvc
::
snGrad
(
rho
)
)
*
rAUf
*
mesh
.
magSf
()
);
phiHbyA
+=
phig
;
// Update the pressure BCs to ensure flux consistency
constrainPressure
(
p_rgh
,
U
,
phiHbyA
,
rAUf
,
MRF
);
tmp
<
fvScalarMatrix
>
p_rghEqnComp1
;
tmp
<
fvScalarMatrix
>
p_rghEqnComp2
;
if
(
pimple
.
transonic
())
{
#include "rhofs.H"
surfaceScalarField
phid1
(
"phid1"
,
fvc
::
interpolate
(
psi1
)
*
phi
);
surfaceScalarField
phid2
(
"phid2"
,
fvc
::
interpolate
(
psi2
)
*
phi
);
p_rghEqnComp1
=
pos
(
alpha1
)
*
(
(
fvc
::
ddt
(
alpha1
,
rho1
)
+
fvc
::
div
(
alphaPhi1
*
rho1f
)
-
(
fvOptions
(
alpha1
,
mixture
.
thermo1
().
rho
())
&
rho1
)
)
/
rho1
-
fvc
::
ddt
(
alpha1
)
-
fvc
::
div
(
alphaPhi1
)
+
(
alpha1
/
rho1
)
*
correction
(
psi1
*
fvm
::
ddt
(
p_rgh
)
+
fvm
::
div
(
phid1
,
p_rgh
)
-
fvm
::
Sp
(
fvc
::
div
(
phid1
),
p_rgh
)
)
);
p_rghEqnComp1
.
ref
().
relax
();
p_rghEqnComp2
=
pos
(
alpha2
)
*
(
(
fvc
::
ddt
(
alpha2
,
rho2
)
+
fvc
::
div
(
alphaPhi2
*
rho2f
)
-
(
fvOptions
(
alpha2
,
mixture
.
thermo2
().
rho
())
&
rho2
)
)
/
rho2
-
fvc
::
ddt
(
alpha2
)
-
fvc
::
div
(
alphaPhi2
)
+
(
alpha2
/
rho2
)
*
correction
(
psi2
*
fvm
::
ddt
(
p_rgh
)
+
fvm
::
div
(
phid2
,
p_rgh
)
-
fvm
::
Sp
(
fvc
::
div
(
phid2
),
p_rgh
)
)
);
p_rghEqnComp2
.
ref
().
relax
();
}
else
{
#include "rhofs.H"
p_rghEqnComp1
=
pos
(
alpha1
)
*
(
(
fvc
::
ddt
(
alpha1
,
rho1
)
+
fvc
::
div
(
alphaPhi1
*
rho1f
)
-
(
fvOptions
(
alpha1
,
mixture
.
thermo1
().
rho
())
&
rho1
)
)
/
rho1
-
fvc
::
ddt
(
alpha1
)
-
fvc
::
div
(
alphaPhi1
)
+
(
alpha1
*
psi1
/
rho1
)
*
correction
(
fvm
::
ddt
(
p_rgh
))
);
p_rghEqnComp2
=
pos
(
alpha2
)
*
(
(
fvc
::
ddt
(
alpha2
,
rho2
)
+
fvc
::
div
(
alphaPhi2
*
rho2f
)
-
(
fvOptions
(
alpha2
,
mixture
.
thermo2
().
rho
())
&
rho2
)
)
/
rho2
-
fvc
::
ddt
(
alpha2
)
-
fvc
::
div
(
alphaPhi2
)
+
(
alpha2
*
psi2
/
rho2
)
*
correction
(
fvm
::
ddt
(
p_rgh
))
);
}
// Cache p_rgh prior to solve for density update
volScalarField
p_rgh_0
(
p_rgh
);
while
(
pimple
.
correctNonOrthogonal
())
{
fvScalarMatrix
p_rghEqnIncomp
(
fvc
::
div
(
phiHbyA
)
-
fvm
::
laplacian
(
rAUf
,
p_rgh
)
);
solve
(
p_rghEqnComp1
()
+
p_rghEqnComp2
()
+
p_rghEqnIncomp
,
mesh
.
solver
(
p_rgh
.
select
(
pimple
.
finalInnerIter
()))
);
if
(
pimple
.
finalNonOrthogonalIter
())
{
p
=
max
(
p_rgh
+
(
alpha1
*
rho1
+
alpha2
*
rho2
)
*
gh
,
pMin
);
p_rgh
=
p
-
(
alpha1
*
rho1
+
alpha2
*
rho2
)
*
gh
;
dgdt
=
(
alpha1
*
(
p_rghEqnComp2
&
p_rgh
)
-
alpha2
*
(
p_rghEqnComp1
&
p_rgh
)
);
phi
=
phiHbyA
+
p_rghEqnIncomp
.
flux
();
U
=
HbyA
+
rAU
*
fvc
::
reconstruct
((
phig
+
p_rghEqnIncomp
.
flux
())
/
rAUf
);
U
.
correctBoundaryConditions
();
fvOptions
.
correct
(
U
);
}
}
// Update densities from change in p_rgh
mixture
.
thermo1
().
correctRho
(
psi1
*
(
p_rgh
-
p_rgh_0
));
mixture
.
thermo2
().
correctRho
(
psi2
*
(
p_rgh
-
p_rgh_0
));
rho
=
alpha1
*
rho1
+
alpha2
*
rho2
;
// Correct p_rgh for consistency with p and the updated densities
p_rgh
=
p
-
rho
*
gh
;
p_rgh
.
correctBoundaryConditions
();
K
=
0
.
5
*
magSqr
(
U
);
}
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/rhofs.H
0 → 100644
View file @
649c29f9
surfaceScalarField
rho1f
(
fvc
::
interpolate
(
rho1
));
surfaceScalarField
rho2f
(
fvc
::
interpolate
(
rho2
));
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/Make/files
0 → 100644
View file @
649c29f9
liquidProperties/liquidPropertiesSurfaceTension.C
LIB = $(FOAM_LIBBIN)/libtwoPhaseSurfaceTension
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/Make/options
0 → 100644
View file @
649c29f9
EXE_INC = \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
LIB_LIBS = \
-linterfaceProperties \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \
-lthermophysicalProperties \
-lfiniteVolume
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.C
0 → 100644
View file @
649c29f9
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "liquidPropertiesSurfaceTension.H"
#include "liquidThermo.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace
Foam
{
namespace
surfaceTensionModels
{
defineTypeNameAndDebug
(
liquidProperties
,
0
);
addToRunTimeSelectionTable
(
surfaceTensionModel
,
liquidProperties
,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam
::
surfaceTensionModels
::
liquidProperties
::
liquidProperties
(
const
dictionary
&
dict
,
const
fvMesh
&
mesh
)
:
surfaceTensionModel
(
mesh
),
phaseName_
(
dict
.
get
<
word
>
(
"phase"
))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
surfaceTensionModels
::
liquidProperties
::
sigma
()
const
{
const
heRhoThermopureMixtureliquidProperties
&
thermo
=
mesh_
.
lookupObject
<
heRhoThermopureMixtureliquidProperties
>
(
IOobject
::
groupName
(
basicThermo
::
dictName
,
phaseName_
)
);
const
Foam
::
liquidProperties
&
liquid
=
thermo
.
mixture
().
properties
();
tmp
<
volScalarField
>
tsigma
(
new
volScalarField
(
IOobject
(
"sigma"
,
mesh_
.
time
().
timeName
(),
mesh_
,
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
,
false
),
mesh_
,
dimSigma
)
);
volScalarField
&
sigma
=
tsigma
.
ref
();
const
volScalarField
&
T
=
thermo
.
T
();
const
volScalarField
&
p
=
thermo
.
p
();
volScalarField
::
Internal
&
sigmai
=
sigma
;
const
volScalarField
::
Internal
&
pi
=
p
;
const
volScalarField
::
Internal
&
Ti
=
T
;
forAll
(
sigmai
,
celli
)
{
sigmai
[
celli
]
=
liquid
.
sigma
(
pi
[
celli
],
Ti
[
celli
]);
}
volScalarField
::
Boundary
&
sigmaBf
=
sigma
.
boundaryFieldRef
();
const
volScalarField
::
Boundary
&
pBf
=
p
.
boundaryField
();
const
volScalarField
::
Boundary
&
TBf
=
T
.
boundaryField
();
forAll
(
sigmaBf
,
patchi
)
{
scalarField
&
sigmaPf
=
sigmaBf
[
patchi
];
const
scalarField
&
pPf
=
pBf
[
patchi
];
const
scalarField
&
TPf
=
TBf
[
patchi
];
forAll
(
sigmaPf
,
facei
)
{
sigmaPf
[
facei
]
=
liquid
.
sigma
(
pPf
[
facei
],
TPf
[
facei
]);
}
}
return
tsigma
;
}
bool
Foam
::
surfaceTensionModels
::
liquidProperties
::
readDict
(
const
dictionary
&
dict
)
{
return
true
;
}
bool
Foam
::
surfaceTensionModels
::
liquidProperties
::
writeData
(
Ostream
&
os
)
const
{
if
(
surfaceTensionModel
::
writeData
(
os
))
{
return
os
.
good
();
}
return
false
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.H
0 → 100644
View file @
649c29f9
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 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::surfaceTensionModels::liquidProperties
Description
Temperature-dependent surface tension model in which the surface tension
function provided by the phase Foam::liquidProperties class is used.
Usage
\table
Property | Description | Required | Default value
phase | Phase name | yes |
\endtable
Example of the surface tension specification:
\verbatim
sigma
{
type liquidProperties;
phase water;
}
\endverbatim
See also
Foam::surfaceTensionModel
SourceFiles
liquidPropertiesSurfaceTension.C
\*---------------------------------------------------------------------------*/
#ifndef liquidPropertiesSurfaceTension_H
#define liquidPropertiesSurfaceTension_H
#include "surfaceTensionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
namespace
surfaceTensionModels
{
/*---------------------------------------------------------------------------*\
Class liquidProperties Declaration
\*---------------------------------------------------------------------------*/
class
liquidProperties
:
public
surfaceTensionModel
{
// Private data
//- Name of the liquid phase
word
phaseName_
;
public:
//- Runtime type information
TypeName
(
"liquidProperties"
);
// Constructors
//- Construct from dictionary and mesh
liquidProperties
(
const
dictionary
&
dict
,
const
fvMesh
&
mesh
);
//- Destructor
virtual
~
liquidProperties
()
=
default
;
// Member Functions
//- Surface tension coefficient
virtual
tmp
<
volScalarField
>
sigma
()
const
;
//- Update surface tension coefficient from given dictionary
virtual
bool
readDict
(
const
dictionary
&
dict
);
//- Write in dictionary format
virtual
bool
writeData
(
Ostream
&
os
)
const
;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace surfaceTensionModels
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/Make/files
0 → 100644
View file @
649c29f9
twoPhaseMixtureThermo.C
LIB = $(FOAM_LIBBIN)/libtwoPhaseMixtureThermo
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/Make/options
0 → 100644
View file @
649c29f9
EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
LIB_LIBS = \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \
-ltwoPhaseMixture \
-linterfaceProperties \
-lfiniteVolume
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C
0 → 100644
View file @
649c29f9
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-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 "twoPhaseMixtureThermo.H"
#include "gradientEnergyFvPatchScalarField.H"
#include "mixedEnergyFvPatchScalarField.H"
#include "collatedFileOperation.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace
Foam
{
defineTypeNameAndDebug
(
twoPhaseMixtureThermo
,
0
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam
::
twoPhaseMixtureThermo
::
twoPhaseMixtureThermo
(
const
volVectorField
&
U
,
const
surfaceScalarField
&
phi
)
:
psiThermo
(
U
.
mesh
(),
word
::
null
),
twoPhaseMixture
(
U
.
mesh
(),
*
this
),
interfaceProperties
(
alpha1
(),
U
,
*
this
),
thermo1_
(
nullptr
),
thermo2_
(
nullptr
)
{
{
volScalarField
T1
(
IOobject
::
groupName
(
"T"
,
phase1Name
()),
T_
);
T1
.
write
();
}
{
volScalarField
T2
(
IOobject
::
groupName
(
"T"
,
phase2Name
()),
T_
);
T2
.
write
();
}
// Note: we're writing files to be read in immediately afterwards.
// Avoid any thread-writing problems.
fileHandler
().
flush
();
thermo1_
=
rhoThermo
::
New
(
U
.
mesh
(),
phase1Name
());
thermo2_
=
rhoThermo
::
New
(
U
.
mesh
(),
phase2Name
());
// thermo1_->validate(phase1Name(), "e");
// thermo2_->validate(phase2Name(), "e");
correct
();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam
::
twoPhaseMixtureThermo
::~
twoPhaseMixtureThermo
()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void
Foam
::
twoPhaseMixtureThermo
::
correctThermo
()
{
thermo1_
->
he
()
=
thermo1_
->
he
(
p_
,
T_
);
thermo1_
->
correct
();
thermo2_
->
he
()
=
thermo2_
->
he
(
p_
,
T_
);
thermo2_
->
correct
();
}
void
Foam
::
twoPhaseMixtureThermo
::
correct
()
{
psi_
=
alpha1
()
*
thermo1_
->
psi
()
+
alpha2
()
*
thermo2_
->
psi
();
mu_
=
alpha1
()
*
thermo1_
->
mu
()
+
alpha2
()
*
thermo2_
->
mu
();
alpha_
=
alpha1
()
*
thermo1_
->
alpha
()
+
alpha2
()
*
thermo2_
->
alpha
();
interfaceProperties
::
correct
();
}
Foam
::
word
Foam
::
twoPhaseMixtureThermo
::
thermoName
()
const
{
return
thermo1_
->
thermoName
()
+
','
+
thermo2_
->
thermoName
();
}
bool
Foam
::
twoPhaseMixtureThermo
::
incompressible
()
const
{
return
thermo1_
->
incompressible
()
&&
thermo2_
->
incompressible
();
}
bool
Foam
::
twoPhaseMixtureThermo
::
isochoric
()
const
{
return
thermo1_
->
isochoric
()
&&
thermo2_
->
isochoric
();
}
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
twoPhaseMixtureThermo
::
he
(
const
volScalarField
&
p
,
const
volScalarField
&
T
)
const
{
return
alpha1
()
*
thermo1_
->
he
(
p
,
T
)
+
alpha2
()
*
thermo2_
->
he
(
p
,
T
);
}
Foam
::
tmp
<
Foam
::
scalarField
>
Foam
::
twoPhaseMixtureThermo
::
he
(
const
scalarField
&
p
,
const
scalarField
&
T
,
const
labelList
&
cells
)
const
{
return
scalarField
(
alpha1
(),
cells
)
*
thermo1_
->
he
(
p
,
T
,
cells
)
+
scalarField
(
alpha2
(),
cells
)
*
thermo2_
->
he
(
p
,
T
,
cells
);
}
Foam
::
tmp
<
Foam
::
scalarField
>
Foam
::
twoPhaseMixtureThermo
::
he
(
const
scalarField
&
p
,
const
scalarField
&
T
,
const
label
patchi
)
const
{
return
alpha1
().
boundaryField
()[
patchi
]
*
thermo1_
->
he
(
p
,
T
,
patchi
)
+
alpha2
().
boundaryField
()[
patchi
]
*
thermo2_
->
he
(
p
,
T
,
patchi
);
}
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
twoPhaseMixtureThermo
::
hc
()
const
{
return
alpha1
()
*
thermo1_
->
hc
()
+
alpha2
()
*
thermo2_
->
hc
();
}
Foam
::
tmp
<
Foam
::
scalarField
>
Foam
::
twoPhaseMixtureThermo
::
THE
(
const
scalarField
&
h
,
const
scalarField
&
p
,
const
scalarField
&
T0
,
const
labelList
&
cells
)
const
{
NotImplemented
;
return
T0
;
}
Foam
::
tmp
<
Foam
::
scalarField
>
Foam
::
twoPhaseMixtureThermo
::
THE
(
const
scalarField
&
h
,
const
scalarField
&
p
,
const
scalarField
&
T0
,
const
label
patchi
)
const
{
NotImplemented
;
return
T0
;
}
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
twoPhaseMixtureThermo
::
Cp
()
const
{
return
alpha1
()
*
thermo1_
->
Cp
()
+
alpha2
()
*
thermo2_
->
Cp
();
}
Foam
::
tmp
<
Foam
::
scalarField
>
Foam
::
twoPhaseMixtureThermo
::
Cp
(
const
scalarField
&
p
,
const
scalarField
&
T
,
const
label
patchi
)
const
{
return
alpha1
().
boundaryField
()[
patchi
]
*
thermo1_
->
Cp
(
p
,
T
,
patchi
)
+
alpha2
().
boundaryField
()[
patchi
]
*
thermo2_
->
Cp
(
p
,
T
,
patchi
);
}
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
twoPhaseMixtureThermo
::
Cv
()
const
{
return
alpha1
()
*
thermo1_
->
Cv
()
+
alpha2
()
*
thermo2_
->
Cv
();
}
Foam
::
tmp
<
Foam
::
scalarField
>
Foam
::
twoPhaseMixtureThermo
::
Cv
(
const
scalarField
&
p
,
const
scalarField
&
T
,
const
label
patchi
)
const
{
return
alpha1
().
boundaryField
()[
patchi
]
*
thermo1_
->
Cv
(
p
,
T
,
patchi
)
+
alpha2
().
boundaryField
()[
patchi
]
*
thermo2_
->
Cv
(
p
,
T
,
patchi
);
}
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
twoPhaseMixtureThermo
::
gamma
()
const
{
return
alpha1
()
*
thermo1_
->
gamma
()
+
alpha2
()
*
thermo2_
->
gamma
();
}
Foam
::
tmp
<
Foam
::
scalarField
>
Foam
::
twoPhaseMixtureThermo
::
gamma
(
const
scalarField
&
p
,
const
scalarField
&
T
,
const
label
patchi
)
const
{
return
alpha1
().
boundaryField
()[
patchi
]
*
thermo1_
->
gamma
(
p
,
T
,
patchi
)
+
alpha2
().
boundaryField
()[
patchi
]
*
thermo2_
->
gamma
(
p
,
T
,
patchi
);
}
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
twoPhaseMixtureThermo
::
Cpv
()
const
{
return
alpha1
()
*
thermo1_
->
Cpv
()
+
alpha2
()
*
thermo2_
->
Cpv
();
}
Foam
::
tmp
<
Foam
::
scalarField
>
Foam
::
twoPhaseMixtureThermo
::
Cpv
(
const
scalarField
&
p
,
const
scalarField
&
T
,
const
label
patchi
)
const
{
return
alpha1
().
boundaryField
()[
patchi
]
*
thermo1_
->
Cpv
(
p
,
T
,
patchi
)
+
alpha2
().
boundaryField
()[
patchi
]
*
thermo2_
->
Cpv
(
p
,
T
,
patchi
);
}
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
twoPhaseMixtureThermo
::
CpByCpv
()
const
{
return
alpha1
()
*
thermo1_
->
CpByCpv
()
+
alpha2
()
*
thermo2_
->
CpByCpv
();
}
Foam
::
tmp
<
Foam
::
scalarField
>
Foam
::
twoPhaseMixtureThermo
::
CpByCpv
(
const
scalarField
&
p
,
const
scalarField
&
T
,
const
label
patchi
)
const
{
return
alpha1
().
boundaryField
()[
patchi
]
*
thermo1_
->
CpByCpv
(
p
,
T
,
patchi
)
+
alpha2
().
boundaryField
()[
patchi
]
*
thermo2_
->
CpByCpv
(
p
,
T
,
patchi
);
}
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
twoPhaseMixtureThermo
::
W
()
const
{
return
alpha1
()
*
thermo1_
->
W
()
+
alpha2
()
*
thermo1_
->
W
();
}
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
twoPhaseMixtureThermo
::
nu
()
const
{
return
mu
()
/
(
alpha1
()
*
thermo1_
->
rho
()
+
alpha2
()
*
thermo2_
->
rho
());
}
Foam
::
tmp
<
Foam
::
scalarField
>
Foam
::
twoPhaseMixtureThermo
::
nu
(
const
label
patchi
)
const
{
return
mu
(
patchi
)
/
(
alpha1
().
boundaryField
()[
patchi
]
*
thermo1_
->
rho
(
patchi
)
+
alpha2
().
boundaryField
()[
patchi
]
*
thermo2_
->
rho
(
patchi
)
);
}
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
twoPhaseMixtureThermo
::
kappa
()
const
{
return
alpha1
()
*
thermo1_
->
kappa
()
+
alpha2
()
*
thermo2_
->
kappa
();
}
Foam
::
tmp
<
Foam
::
scalarField
>
Foam
::
twoPhaseMixtureThermo
::
kappa
(
const
label
patchi
)
const
{
return
alpha1
().
boundaryField
()[
patchi
]
*
thermo1_
->
kappa
(
patchi
)
+
alpha2
().
boundaryField
()[
patchi
]
*
thermo2_
->
kappa
(
patchi
);
}
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
twoPhaseMixtureThermo
::
alphahe
()
const
{
return
alpha1
()
*
thermo1_
->
alphahe
()
+
alpha2
()
*
thermo2_
->
alphahe
();
}
Foam
::
tmp
<
Foam
::
scalarField
>
Foam
::
twoPhaseMixtureThermo
::
alphahe
(
const
label
patchi
)
const
{
return
alpha1
().
boundaryField
()[
patchi
]
*
thermo1_
->
alphahe
(
patchi
)
+
alpha2
().
boundaryField
()[
patchi
]
*
thermo2_
->
alphahe
(
patchi
);
}
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
twoPhaseMixtureThermo
::
kappaEff
(
const
volScalarField
&
alphat
)
const
{
return
alpha1
()
*
thermo1_
->
kappaEff
(
alphat
)
+
alpha2
()
*
thermo2_
->
kappaEff
(
alphat
);
}
Foam
::
tmp
<
Foam
::
scalarField
>
Foam
::
twoPhaseMixtureThermo
::
kappaEff
(
const
scalarField
&
alphat
,
const
label
patchi
)
const
{
return
alpha1
().
boundaryField
()[
patchi
]
*
thermo1_
->
kappaEff
(
alphat
,
patchi
)
+
alpha2
().
boundaryField
()[
patchi
]
*
thermo2_
->
kappaEff
(
alphat
,
patchi
);
}
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
twoPhaseMixtureThermo
::
alphaEff
(
const
volScalarField
&
alphat
)
const
{
return
alpha1
()
*
thermo1_
->
alphaEff
(
alphat
)
+
alpha2
()
*
thermo2_
->
alphaEff
(
alphat
);
}
Foam
::
tmp
<
Foam
::
scalarField
>
Foam
::
twoPhaseMixtureThermo
::
alphaEff
(
const
scalarField
&
alphat
,
const
label
patchi
)
const
{
return
alpha1
().
boundaryField
()[
patchi
]
*
thermo1_
->
alphaEff
(
alphat
,
patchi
)
+
alpha2
().
boundaryField
()[
patchi
]
*
thermo2_
->
alphaEff
(
alphat
,
patchi
);
}
bool
Foam
::
twoPhaseMixtureThermo
::
read
()
{
if
(
psiThermo
::
read
())
{
return
interfaceProperties
::
read
();
}
return
false
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H
0 → 100644
View file @
649c29f9
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation
Copyright (C) 2021 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::twoPhaseMixtureThermo
Description
SourceFiles
twoPhaseMixtureThermoI.H
twoPhaseMixtureThermo.C
twoPhaseMixtureThermoIO.C
\*---------------------------------------------------------------------------*/
#ifndef twoPhaseMixtureThermo_H
#define twoPhaseMixtureThermo_H
#include "rhoThermo.H"
#include "psiThermo.H"
#include "twoPhaseMixture.H"
#include "interfaceProperties.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
/*---------------------------------------------------------------------------*\
Class twoPhaseMixtureThermo Declaration
\*---------------------------------------------------------------------------*/
class
twoPhaseMixtureThermo
:
public
psiThermo
,
public
twoPhaseMixture
,
public
interfaceProperties
{
// Private data
//- Thermo-package of phase 1
autoPtr
<
rhoThermo
>
thermo1_
;
//- Thermo-package of phase 2
autoPtr
<
rhoThermo
>
thermo2_
;
public:
//- Runtime type information
TypeName
(
"twoPhaseMixtureThermo"
);
// Constructors
//- Construct from components
twoPhaseMixtureThermo
(
const
volVectorField
&
U
,
const
surfaceScalarField
&
phi
);
//- Destructor
virtual
~
twoPhaseMixtureThermo
();
// Member Functions
const
rhoThermo
&
thermo1
()
const
{
return
*
thermo1_
;
}
const
rhoThermo
&
thermo2
()
const
{
return
*
thermo2_
;
}
rhoThermo
&
thermo1
()
{
return
*
thermo1_
;
}
rhoThermo
&
thermo2
()
{
return
*
thermo2_
;
}
//- Correct the thermodynamics of each phase
virtual
void
correctThermo
();
//- Update mixture properties
virtual
void
correct
();
//- Return the name of the thermo physics
virtual
word
thermoName
()
const
;
//- Return true if the equation of state is incompressible
// i.e. rho != f(p)
virtual
bool
incompressible
()
const
;
//- Return true if the equation of state is isochoric
// i.e. rho = const
virtual
bool
isochoric
()
const
;
// Access to thermodynamic state variables
//- Enthalpy/Internal energy [J/kg]
// Non-const access allowed for transport equations
virtual
volScalarField
&
he
()
{
NotImplemented
;
return
thermo1_
->
he
();
}
//- Enthalpy/Internal energy [J/kg]
virtual
const
volScalarField
&
he
()
const
{
NotImplemented
;
return
thermo1_
->
he
();
}
//- Enthalpy/Internal energy
// for given pressure and temperature [J/kg]
virtual
tmp
<
volScalarField
>
he
(
const
volScalarField
&
p
,
const
volScalarField
&
T
)
const
;
//- Enthalpy/Internal energy for cell-set [J/kg]
virtual
tmp
<
scalarField
>
he
(
const
scalarField
&
p
,
const
scalarField
&
T
,
const
labelList
&
cells
)
const
;
//- Enthalpy/Internal energy for patch [J/kg]
virtual
tmp
<
scalarField
>
he
(
const
scalarField
&
p
,
const
scalarField
&
T
,
const
label
patchi
)
const
;
//- Chemical enthalpy [J/kg]
virtual
tmp
<
volScalarField
>
hc
()
const
;
//- Temperature from enthalpy/internal energy for cell-set
virtual
tmp
<
scalarField
>
THE
(
const
scalarField
&
h
,
const
scalarField
&
p
,
const
scalarField
&
T0
,
// starting temperature
const
labelList
&
cells
)
const
;
//- Temperature from enthalpy/internal energy for patch
virtual
tmp
<
scalarField
>
THE
(
const
scalarField
&
h
,
const
scalarField
&
p
,
const
scalarField
&
T0
,
// starting temperature
const
label
patchi
)
const
;
// Fields derived from thermodynamic state variables
//- Heat capacity at constant pressure [J/kg/K]
virtual
tmp
<
volScalarField
>
Cp
()
const
;
//- Heat capacity at constant pressure for patch [J/kg/K]
virtual
tmp
<
scalarField
>
Cp
(
const
scalarField
&
p
,
const
scalarField
&
T
,
const
label
patchi
)
const
;
//- Heat capacity using pressure and temperature
virtual
tmp
<
scalarField
>
Cp
(
const
scalarField
&
p
,
const
scalarField
&
T
,
const
labelList
&
cells
)
const
{
NotImplemented
;
return
tmp
<
scalarField
>::
New
(
p
);
}
//- Heat capacity at constant volume [J/kg/K]
virtual
tmp
<
volScalarField
>
Cv
()
const
;
//- Heat capacity at constant volume for patch [J/kg/K]
virtual
tmp
<
scalarField
>
Cv
(
const
scalarField
&
p
,
const
scalarField
&
T
,
const
label
patchi
)
const
;
//- Density from pressure and temperature
virtual
tmp
<
scalarField
>
rhoEoS
(
const
scalarField
&
p
,
const
scalarField
&
T
,
const
labelList
&
cells
)
const
{
NotImplemented
;
return
tmp
<
scalarField
>::
New
(
p
);
}
//- Gamma = Cp/Cv []
virtual
tmp
<
volScalarField
>
gamma
()
const
;
//- Gamma = Cp/Cv for patch []
virtual
tmp
<
scalarField
>
gamma
(
const
scalarField
&
p
,
const
scalarField
&
T
,
const
label
patchi
)
const
;
//- Heat capacity at constant pressure/volume [J/kg/K]
virtual
tmp
<
volScalarField
>
Cpv
()
const
;
//- Heat capacity at constant pressure/volume for patch [J/kg/K]
virtual
tmp
<
scalarField
>
Cpv
(
const
scalarField
&
p
,
const
scalarField
&
T
,
const
label
patchi
)
const
;
//- Heat capacity ratio []
virtual
tmp
<
volScalarField
>
CpByCpv
()
const
;
//- Heat capacity ratio for patch []
virtual
tmp
<
scalarField
>
CpByCpv
(
const
scalarField
&
p
,
const
scalarField
&
T
,
const
label
patchi
)
const
;
//- Molecular weight [kg/kmol]
virtual
tmp
<
volScalarField
>
W
()
const
;
// Fields derived from transport state variables
//- Kinematic viscosity of mixture [m^2/s]
virtual
tmp
<
volScalarField
>
nu
()
const
;
//- Kinematic viscosity of mixture for patch [m^2/s]
virtual
tmp
<
scalarField
>
nu
(
const
label
patchi
)
const
;
//- Thermal diffusivity for temperature of mixture [J/m/s/K]
virtual
tmp
<
volScalarField
>
kappa
()
const
;
//- Thermal diffusivity of mixture for patch [J/m/s/K]
virtual
tmp
<
scalarField
>
kappa
(
const
label
patchi
)
const
;
//- Thermal diffusivity for energy of mixture [kg/m/s]
virtual
tmp
<
volScalarField
>
alphahe
()
const
;
//- Thermal diffusivity for energy of mixture for patch [kg/m/s]
virtual
tmp
<
scalarField
>
alphahe
(
const
label
patchi
)
const
;
//- Effective thermal diffusivity of mixture [J/m/s/K]
virtual
tmp
<
volScalarField
>
kappaEff
(
const
volScalarField
&
alphat
)
const
;
//- Effective thermal diffusivity of mixture for patch [J/m/s/K]
virtual
tmp
<
scalarField
>
kappaEff
(
const
scalarField
&
alphat
,
const
label
patchi
)
const
;
//- Effective thermal diffusivity of mixture [J/m/s/K]
virtual
tmp
<
volScalarField
>
alphaEff
(
const
volScalarField
&
alphat
)
const
;
//- Effective thermal diffusivity of mixture for patch [J/m/s/K]
virtual
tmp
<
scalarField
>
alphaEff
(
const
scalarField
&
alphat
,
const
label
patchi
)
const
;
// IO
//- Read base transportProperties dictionary
virtual
bool
read
();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
OpenFOAM-v2112/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwclean
0 → 100644
View file @
649c29f9
#!/bin/sh
cd
"
${
0
%/*
}
"
||
exit
# Run from this directory
#------------------------------------------------------------------------------
wclean libso multiphaseMixtureThermo
wclean
#------------------------------------------------------------------------------
OpenFOAM-v2112/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake
0 → 100644
View file @
649c29f9
#!/bin/sh
cd
"
${
0
%/*
}
"
||
exit
# Run from this directory
.
${
WM_PROJECT_DIR
:?
}
/wmake/scripts/AllwmakeParseArguments
#------------------------------------------------------------------------------
wmake
$targetType
multiphaseMixtureThermo
wmake
$targetType
#------------------------------------------------------------------------------
OpenFOAM-v2112/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Make/files
0 → 100644
View file @
649c29f9
compressibleMultiphaseInterFoam.C
EXE = $(FOAM_APPBIN)/compressibleMultiphaseInterFoam
Prev
1
…
35
36
37
38
39
40
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment