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
ea17556c
Commit
ea17556c
authored
Mar 07, 2024
by
shunbo
Browse files
Initial commit
parents
Changes
798
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1078 additions
and
0 deletions
+1078
-0
applications/solvers/finiteArea/surfactantFoam/Make/options
applications/solvers/finiteArea/surfactantFoam/Make/options
+10
-0
applications/solvers/finiteArea/surfactantFoam/createFaFields.H
...ations/solvers/finiteArea/surfactantFoam/createFaFields.H
+59
-0
applications/solvers/finiteArea/surfactantFoam/createFaMesh.H
...ications/solvers/finiteArea/surfactantFoam/createFaMesh.H
+2
-0
applications/solvers/finiteArea/surfactantFoam/createVolFields.H
...tions/solvers/finiteArea/surfactantFoam/createVolFields.H
+36
-0
applications/solvers/finiteArea/surfactantFoam/surfactantFoam.C
...ations/solvers/finiteArea/surfactantFoam/surfactantFoam.C
+117
-0
applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/files
...lvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/files
+3
-0
applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/options
...ers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/options
+26
-0
applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H
...s/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H
+28
-0
applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H
...s/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H
+34
-0
applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C
...buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C
+163
-0
applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/createFields.H
...s/heatTransfer/buoyantBoussinesqPimpleFoam/createFields.H
+126
-0
applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H
...s/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H
+68
-0
applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/files
...lvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/files
+3
-0
applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/options
...ers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/options
+20
-0
applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/TEqn.H
...s/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/TEqn.H
+27
-0
applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H
...s/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H
+35
-0
applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C
...buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C
+111
-0
applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H
...s/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H
+126
-0
applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H
...s/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H
+66
-0
applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/readTransportProperties.H
...fer/buoyantBoussinesqSimpleFoam/readTransportProperties.H
+18
-0
No files found.
Too many changes to show.
To preserve performance only
798 of 798+
files are displayed.
Plain diff
Email patch
applications/solvers/finiteArea/surfactantFoam/Make/options
0 → 100644
View file @
ea17556c
EXE_INC = \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/cfdTools/general/lnInclude
EXE_LIBS = \
-lfiniteArea \
-lfiniteVolume \
-lmeshTools
applications/solvers/finiteArea/surfactantFoam/createFaFields.H
0 → 100644
View file @
ea17556c
Info
<<
"Reading field Cs"
<<
endl
;
areaScalarField
Cs
(
IOobject
(
"Cs"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
aMesh
);
Info
<<
"Reading transportProperties
\n
"
<<
endl
;
IOdictionary
transportProperties
(
IOobject
(
"transportProperties"
,
runTime
.
constant
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
NO_WRITE
)
);
Info
<<
"Reading diffusivity D
\n
"
<<
endl
;
dimensionedScalar
Ds
(
"Ds"
,
dimViscosity
,
transportProperties
);
areaVectorField
Us
(
IOobject
(
"Us"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
NO_WRITE
),
aMesh
);
edgeScalarField
phis
(
IOobject
(
"phis"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
),
linearEdgeInterpolate
(
Us
)
&
aMesh
.
Le
()
);
applications/solvers/finiteArea/surfactantFoam/createFaMesh.H
0 → 100644
View file @
ea17556c
// Create Finite Area mesh
faMesh
aMesh
(
mesh
);
applications/solvers/finiteArea/surfactantFoam/createVolFields.H
0 → 100644
View file @
ea17556c
// Create volume-to surface mapping object
volSurfaceMapping
vsm
(
aMesh
);
volScalarField
Cvf
(
IOobject
(
"Cvf"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
mesh
,
dimensionedScalar
(
dimless
/
dimLength
,
Zero
)
);
vsm
.
mapToVolume
(
Cs
,
Cvf
.
boundaryFieldRef
());
//Cvf.write();
volVectorField
U
(
IOobject
(
"U"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
mesh
,
dimensionedVector
(
dimVelocity
,
Zero
)
);
vsm
.
mapToVolume
(
Us
,
U
.
boundaryFieldRef
());
//U.write();
applications/solvers/finiteArea/surfactantFoam/surfactantFoam.C
0 → 100644
View file @
ea17556c
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki 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
surfactantFoam
Group
grpFiniteAreaSolvers
Description
Passive scalar transport finiteArea equation solver.
\heading Solver details
The equation is given by:
\f[
\ddt{Cs} + \div \left(\vec{U} Cs\right) - \div \left(D_T \grad Cs \right)
= 0
\f]
Where:
\vartable
Cs | Passive scalar
Ds | Diffusion coefficient
\endvartable
\heading Required fields
\plaintable
Cs | Passive scalar
Us | Velocity [m/s]
\endplaintable
Author
Zeljko Tukovic, FMENA
Hrvoje Jasak, Wikki Ltd.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "faCFD.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Passive scalar transport finiteArea equation solver."
);
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFaMesh.H"
#include "createFaFields.H"
#include "createVolFields.H"
Info
<<
"Total mass of surfactant: "
<<
sum
(
Cs
.
internalField
()
*
aMesh
.
S
())
<<
endl
;
Info
<<
"
\n
Starting time loop
\n
"
<<
endl
;
while
(
runTime
.
loop
())
{
Info
<<
"Time = "
<<
runTime
.
value
()
<<
endl
;
faScalarMatrix
CsEqn
(
fam
::
ddt
(
Cs
)
+
fam
::
div
(
phis
,
Cs
)
-
fam
::
laplacian
(
Ds
,
Cs
)
);
CsEqn
.
solve
();
if
(
runTime
.
writeTime
())
{
vsm
.
mapToVolume
(
Cs
,
Cvf
.
boundaryFieldRef
());
runTime
.
write
();
}
Info
<<
"Total mass of surfactant: "
<<
sum
(
Cs
.
internalField
()
*
aMesh
.
S
())
<<
endl
;
runTime
.
printExecutionTime
(
Info
);
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/files
0 → 100644
View file @
ea17556c
buoyantBoussinesqPimpleFoam.C
EXE = $(FOAM_APPBIN)/buoyantBoussinesqPimpleFoam
applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/options
0 → 100644
View file @
ea17556c
EXE_INC = \
-I../buoyantBoussinesqSimpleFoam \
-I../../incompressible/pimpleFoam \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-ldynamicMesh \
-ldynamicFvMesh \
-lsampling \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \
-lradiationModels \
-latmosphericModels
applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H
0 → 100644
View file @
ea17556c
{
alphat
=
turbulence
->
nut
()
/
Prt
;
alphat
.
correctBoundaryConditions
();
volScalarField
alphaEff
(
"alphaEff"
,
turbulence
->
nu
()
/
Pr
+
alphat
);
fvScalarMatrix
TEqn
(
fvm
::
ddt
(
T
)
+
fvm
::
div
(
phi
,
T
)
-
fvm
::
laplacian
(
alphaEff
,
T
)
==
radiation
->
ST
(
rhoCpRef
,
T
)
+
fvOptions
(
T
)
);
TEqn
.
relax
();
fvOptions
.
constrain
(
TEqn
);
TEqn
.
solve
();
radiation
->
correct
();
fvOptions
.
correct
(
T
);
rhok
=
1
.
0
-
beta
*
(
T
-
TRef
);
}
applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H
0 → 100644
View file @
ea17556c
// Solve the momentum equation
MRF
.
correctBoundaryVelocity
(
U
);
fvVectorMatrix
UEqn
(
fvm
::
ddt
(
U
)
+
fvm
::
div
(
phi
,
U
)
+
MRF
.
DDt
(
U
)
+
turbulence
->
divDevReff
(
U
)
==
fvOptions
(
U
)
);
UEqn
.
relax
();
fvOptions
.
constrain
(
UEqn
);
if
(
pimple
.
momentumPredictor
())
{
solve
(
UEqn
==
fvc
::
reconstruct
(
(
-
ghf
*
fvc
::
snGrad
(
rhok
)
-
fvc
::
snGrad
(
p_rgh
)
)
*
mesh
.
magSf
()
)
);
fvOptions
.
correct
(
U
);
}
applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C
0 → 100644
View file @
ea17556c
/*---------------------------------------------------------------------------*\
========= |
\\ / 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) 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
buoyantBoussinesqPimpleFoam
Group
grpHeatTransferSolvers
Description
Transient solver for buoyant, turbulent flow of incompressible fluids,
with optional mesh motion and mesh topology changes.
Uses the Boussinesq approximation:
\f[
rho_{k} = 1 - beta(T - T_{ref})
\f]
where:
\f$ rho_{k} \f$ = the effective (driving) kinematic density
beta = thermal expansion coefficient [1/K]
T = temperature [K]
\f$ T_{ref} \f$ = reference temperature [K]
Valid when:
\f[
\frac{beta(T - T_{ref})}{rho_{ref}} << 1
\f]
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "radiationModel.H"
#include "CorrectPhi.H"
#include "fvOptions.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Transient solver for buoyant, turbulent flow"
" of incompressible fluids, with optional mesh"
" motion and mesh topology changes.
\n
"
"Uses the Boussinesq approximation."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createDyMControls.H"
#include "createFields.H"
#include "createUfIfPresent.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
#include "initContinuityErrs.H"
turbulence
->
validate
();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"
\n
Starting time loop
\n
"
<<
endl
;
while
(
runTime
.
run
())
{
#include "readDyMControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
++
runTime
;
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
// --- Pressure-velocity PIMPLE corrector loop
while
(
pimple
.
loop
())
{
if
(
pimple
.
firstIter
()
||
moveMeshOuterCorrectors
)
{
// Do any mesh changes
mesh
.
controlledUpdate
();
if
(
mesh
.
changing
())
{
MRF
.
update
();
if
(
correctPhi
)
{
// Calculate absolute flux
// from the mapped surface velocity
phi
=
mesh
.
Sf
()
&
Uf
();
#include "correctPhi.H"
// Make the flux relative to the mesh motion
fvc
::
makeRelative
(
phi
,
U
);
}
if
(
checkMeshCourantNo
)
{
#include "meshCourantNo.H"
}
}
}
#include "UEqn.H"
#include "TEqn.H"
// --- Pressure corrector loop
while
(
pimple
.
correct
())
{
#include "pEqn.H"
}
if
(
pimple
.
turbCorr
())
{
laminarTransport
.
correct
();
turbulence
->
correct
();
}
}
runTime
.
write
();
runTime
.
printExecutionTime
(
Info
);
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/createFields.H
0 → 100644
View file @
ea17556c
Info
<<
"Reading thermophysical properties
\n
"
<<
endl
;
Info
<<
"Reading field T
\n
"
<<
endl
;
volScalarField
T
(
IOobject
(
"T"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
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"
#include "readTransportProperties.H"
Info
<<
"Creating turbulence model
\n
"
<<
endl
;
autoPtr
<
incompressible
::
turbulenceModel
>
turbulence
(
incompressible
::
turbulenceModel
::
New
(
U
,
phi
,
laminarTransport
)
);
// Kinematic density for buoyancy force
volScalarField
rhok
(
IOobject
(
"rhok"
,
runTime
.
timeName
(),
mesh
),
1
.
0
-
beta
*
(
T
-
TRef
)
);
// kinematic turbulent thermal thermal conductivity m2/s
Info
<<
"Reading field alphat
\n
"
<<
endl
;
volScalarField
alphat
(
IOobject
(
"alphat"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
#include "readGravitationalAcceleration.H"
#include "readhRef.H"
#include "gh.H"
volScalarField
p
(
IOobject
(
"p"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
p_rgh
+
rhok
*
gh
);
label
pRefCell
=
0
;
scalar
pRefValue
=
0
.
0
;
setRefCell
(
p
,
p_rgh
,
pimple
.
dict
(),
pRefCell
,
pRefValue
);
if
(
p_rgh
.
needReference
())
{
p
+=
dimensionedScalar
(
"p"
,
p
.
dimensions
(),
pRefValue
-
getRefCellValue
(
p
,
pRefCell
)
);
}
mesh
.
setFluxRequired
(
p_rgh
.
name
());
#include "createMRF.H"
#include "createIncompressibleRadiationModel.H"
#include "createFvOptions.H"
applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H
0 → 100644
View file @
ea17556c
{
volScalarField
rAU
(
"rAU"
,
1
.
0
/
UEqn
.
A
());
surfaceScalarField
rAUf
(
"rAUf"
,
fvc
::
interpolate
(
rAU
));
volVectorField
HbyA
(
constrainHbyA
(
rAU
*
UEqn
.
H
(),
U
,
p_rgh
));
surfaceScalarField
phig
(
-
rAUf
*
ghf
*
fvc
::
snGrad
(
rhok
)
*
mesh
.
magSf
());
surfaceScalarField
phiHbyA
(
"phiHbyA"
,
fvc
::
flux
(
HbyA
)
+
MRF
.
zeroFilter
(
rAUf
*
fvc
::
ddtCorr
(
U
,
phi
))
+
phig
);
MRF
.
makeRelative
(
phiHbyA
);
// Update the pressure BCs to ensure flux consistency
constrainPressure
(
p_rgh
,
U
,
phiHbyA
,
rAUf
,
MRF
);
while
(
pimple
.
correctNonOrthogonal
())
{
fvScalarMatrix
p_rghEqn
(
fvm
::
laplacian
(
rAUf
,
p_rgh
)
==
fvc
::
div
(
phiHbyA
)
);
p_rghEqn
.
setReference
(
pRefCell
,
getRefCellValue
(
p_rgh
,
pRefCell
));
p_rghEqn
.
solve
(
mesh
.
solver
(
p_rgh
.
select
(
pimple
.
finalInnerIter
())));
if
(
pimple
.
finalNonOrthogonalIter
())
{
// Calculate the conservative fluxes
phi
=
phiHbyA
-
p_rghEqn
.
flux
();
// Explicitly relax pressure for momentum corrector
p_rgh
.
relax
();
// Correct the momentum source with the pressure gradient flux
// calculated from the relaxed pressure
U
=
HbyA
+
rAU
*
fvc
::
reconstruct
((
phig
-
p_rghEqn
.
flux
())
/
rAUf
);
U
.
correctBoundaryConditions
();
fvOptions
.
correct
(
U
);
// Correct Uf if the mesh is moving
fvc
::
correctUf
(
Uf
,
U
,
phi
);
// Make the fluxes relative to the mesh motion
fvc
::
makeRelative
(
phi
,
U
);
}
}
#include "continuityErrs.H"
p
=
p_rgh
+
rhok
*
gh
;
if
(
p_rgh
.
needReference
())
{
p
+=
dimensionedScalar
(
"p"
,
p
.
dimensions
(),
pRefValue
-
getRefCellValue
(
p
,
pRefCell
)
);
p_rgh
=
p
-
rhok
*
gh
;
}
}
applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/files
0 → 100644
View file @
ea17556c
buoyantBoussinesqSimpleFoam.C
EXE = $(FOAM_APPBIN)/buoyantBoussinesqSimpleFoam
applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/options
0 → 100644
View file @
ea17556c
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \
-lradiationModels \
-latmosphericModels
applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/TEqn.H
0 → 100644
View file @
ea17556c
{
alphat
=
turbulence
->
nut
()
/
Prt
;
alphat
.
correctBoundaryConditions
();
volScalarField
alphaEff
(
"alphaEff"
,
turbulence
->
nu
()
/
Pr
+
alphat
);
fvScalarMatrix
TEqn
(
fvm
::
div
(
phi
,
T
)
-
fvm
::
laplacian
(
alphaEff
,
T
)
==
radiation
->
ST
(
rhoCpRef
,
T
)
+
fvOptions
(
T
)
);
TEqn
.
relax
();
fvOptions
.
constrain
(
TEqn
);
TEqn
.
solve
();
radiation
->
correct
();
fvOptions
.
correct
(
T
);
rhok
=
1
.
0
-
beta
*
(
T
-
TRef
);
}
applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H
0 → 100644
View file @
ea17556c
// Solve the momentum equation
MRF
.
correctBoundaryVelocity
(
U
);
tmp
<
fvVectorMatrix
>
tUEqn
(
fvm
::
div
(
phi
,
U
)
+
MRF
.
DDt
(
U
)
+
turbulence
->
divDevReff
(
U
)
==
fvOptions
(
U
)
);
fvVectorMatrix
&
UEqn
=
tUEqn
.
ref
();
UEqn
.
relax
();
fvOptions
.
constrain
(
UEqn
);
if
(
simple
.
momentumPredictor
())
{
solve
(
UEqn
==
fvc
::
reconstruct
(
(
-
ghf
*
fvc
::
snGrad
(
rhok
)
-
fvc
::
snGrad
(
p_rgh
)
)
*
mesh
.
magSf
()
)
);
fvOptions
.
correct
(
U
);
}
applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C
0 → 100644
View file @
ea17556c
/*---------------------------------------------------------------------------*\
========= |
\\ / 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/>.
Application
buoyantBoussinesqSimpleFoam
Group
grpHeatTransferSolvers
Description
Steady-state solver for buoyant, turbulent flow of incompressible fluids.
Uses the Boussinesq approximation:
\f[
rho_{k} = 1 - beta(T - T_{ref})
\f]
where:
\f$ rho_{k} \f$ = the effective (driving) density
beta = thermal expansion coefficient [1/K]
T = temperature [K]
\f$ T_{ref} \f$ = reference temperature [K]
Valid when:
\f[
\frac{beta(T - T_{ref})}{rho_{ref}} << 1
\f]
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "radiationModel.H"
#include "fvOptions.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Steady-state solver for buoyant, turbulent flow"
" of incompressible fluids."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createFields.H"
#include "initContinuityErrs.H"
turbulence
->
validate
();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"
\n
Starting time loop
\n
"
<<
endl
;
while
(
simple
.
loop
())
{
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
// Pressure-velocity SIMPLE corrector
{
#include "UEqn.H"
#include "TEqn.H"
#include "pEqn.H"
}
laminarTransport
.
correct
();
turbulence
->
correct
();
runTime
.
write
();
runTime
.
printExecutionTime
(
Info
);
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H
0 → 100644
View file @
ea17556c
Info
<<
"Reading thermophysical properties
\n
"
<<
endl
;
Info
<<
"Reading field T
\n
"
<<
endl
;
volScalarField
T
(
IOobject
(
"T"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
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"
#include "readTransportProperties.H"
Info
<<
"Creating turbulence model
\n
"
<<
endl
;
autoPtr
<
incompressible
::
turbulenceModel
>
turbulence
(
incompressible
::
turbulenceModel
::
New
(
U
,
phi
,
laminarTransport
)
);
// Kinematic density for buoyancy force
volScalarField
rhok
(
IOobject
(
"rhok"
,
runTime
.
timeName
(),
mesh
),
1
.
0
-
beta
*
(
T
-
TRef
)
);
// kinematic turbulent thermal thermal conductivity m2/s
Info
<<
"Reading field alphat
\n
"
<<
endl
;
volScalarField
alphat
(
IOobject
(
"alphat"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
#include "readGravitationalAcceleration.H"
#include "readhRef.H"
#include "gh.H"
volScalarField
p
(
IOobject
(
"p"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
p_rgh
+
rhok
*
gh
);
label
pRefCell
=
0
;
scalar
pRefValue
=
0
.
0
;
setRefCell
(
p
,
p_rgh
,
simple
.
dict
(),
pRefCell
,
pRefValue
);
if
(
p_rgh
.
needReference
())
{
p
+=
dimensionedScalar
(
"p"
,
p
.
dimensions
(),
pRefValue
-
getRefCellValue
(
p
,
pRefCell
)
);
}
mesh
.
setFluxRequired
(
p_rgh
.
name
());
#include "createMRF.H"
#include "createIncompressibleRadiationModel.H"
#include "createFvOptions.H"
applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H
0 → 100644
View file @
ea17556c
{
volScalarField
rAU
(
"rAU"
,
1
.
0
/
UEqn
.
A
());
surfaceScalarField
rAUf
(
"rAUf"
,
fvc
::
interpolate
(
rAU
));
volVectorField
HbyA
(
constrainHbyA
(
rAU
*
UEqn
.
H
(),
U
,
p_rgh
));
tUEqn
.
clear
();
surfaceScalarField
phig
(
-
rAUf
*
ghf
*
fvc
::
snGrad
(
rhok
)
*
mesh
.
magSf
());
surfaceScalarField
phiHbyA
(
"phiHbyA"
,
fvc
::
flux
(
HbyA
)
);
MRF
.
makeRelative
(
phiHbyA
);
adjustPhi
(
phiHbyA
,
U
,
p_rgh
);
phiHbyA
+=
phig
;
// Update the pressure BCs to ensure flux consistency
constrainPressure
(
p_rgh
,
U
,
phiHbyA
,
rAUf
,
MRF
);
while
(
simple
.
correctNonOrthogonal
())
{
fvScalarMatrix
p_rghEqn
(
fvm
::
laplacian
(
rAUf
,
p_rgh
)
==
fvc
::
div
(
phiHbyA
)
);
p_rghEqn
.
setReference
(
pRefCell
,
getRefCellValue
(
p_rgh
,
pRefCell
));
p_rghEqn
.
solve
();
if
(
simple
.
finalNonOrthogonalIter
())
{
// Calculate the conservative fluxes
phi
=
phiHbyA
-
p_rghEqn
.
flux
();
// Explicitly relax pressure for momentum corrector
p_rgh
.
relax
();
// Correct the momentum source with the pressure gradient flux
// calculated from the relaxed pressure
U
=
HbyA
+
rAU
*
fvc
::
reconstruct
((
phig
-
p_rghEqn
.
flux
())
/
rAUf
);
U
.
correctBoundaryConditions
();
fvOptions
.
correct
(
U
);
}
}
#include "continuityErrs.H"
p
=
p_rgh
+
rhok
*
gh
;
if
(
p_rgh
.
needReference
())
{
p
+=
dimensionedScalar
(
"p"
,
p
.
dimensions
(),
pRefValue
-
getRefCellValue
(
p
,
pRefCell
)
);
p_rgh
=
p
-
rhok
*
gh
;
}
}
applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/readTransportProperties.H
0 → 100644
View file @
ea17556c
singlePhaseTransportModel
laminarTransport
(
U
,
phi
);
// Thermal expansion coefficient [1/K]
dimensionedScalar
beta
(
"beta"
,
dimless
/
dimTemperature
,
laminarTransport
);
// Reference temperature [K]
dimensionedScalar
TRef
(
"TRef"
,
dimTemperature
,
laminarTransport
);
// Laminar Prandtl number
dimensionedScalar
Pr
(
"Pr"
,
dimless
,
laminarTransport
);
// Turbulent Prandtl number
dimensionedScalar
Prt
(
"Prt"
,
dimless
,
laminarTransport
);
Prev
1
…
14
15
16
17
18
19
20
21
22
…
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