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
915 additions
and
0 deletions
+915
-0
applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/Make/options
...mpressible/rhoSimpleFoam/rhoPorousSimpleFoam/Make/options
+21
-0
applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/UEqn.H
...ers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/UEqn.H
+55
-0
applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/createZones.H
...pressible/rhoSimpleFoam/rhoPorousSimpleFoam/createZones.H
+20
-0
applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/pEqn.H
...ers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/pEqn.H
+94
-0
applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C
...e/rhoSimpleFoam/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C
+97
-0
applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C
...ations/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C
+100
-0
applications/solvers/compressible/sonicFoam/EEqn.H
applications/solvers/compressible/sonicFoam/EEqn.H
+21
-0
applications/solvers/compressible/sonicFoam/Make/files
applications/solvers/compressible/sonicFoam/Make/files
+3
-0
applications/solvers/compressible/sonicFoam/Make/options
applications/solvers/compressible/sonicFoam/Make/options
+19
-0
applications/solvers/compressible/sonicFoam/UEqn.H
applications/solvers/compressible/sonicFoam/UEqn.H
+24
-0
applications/solvers/compressible/sonicFoam/createFieldRefs.H
...ications/solvers/compressible/sonicFoam/createFieldRefs.H
+2
-0
applications/solvers/compressible/sonicFoam/createFields.H
applications/solvers/compressible/sonicFoam/createFields.H
+56
-0
applications/solvers/compressible/sonicFoam/pEqn.H
applications/solvers/compressible/sonicFoam/pEqn.H
+44
-0
applications/solvers/compressible/sonicFoam/sonicDyMFoam/Make/files
...ns/solvers/compressible/sonicFoam/sonicDyMFoam/Make/files
+3
-0
applications/solvers/compressible/sonicFoam/sonicDyMFoam/Make/options
.../solvers/compressible/sonicFoam/sonicDyMFoam/Make/options
+27
-0
applications/solvers/compressible/sonicFoam/sonicDyMFoam/pEqn.H
...ations/solvers/compressible/sonicFoam/sonicDyMFoam/pEqn.H
+51
-0
applications/solvers/compressible/sonicFoam/sonicDyMFoam/sonicDyMFoam.C
...olvers/compressible/sonicFoam/sonicDyMFoam/sonicDyMFoam.C
+158
-0
applications/solvers/compressible/sonicFoam/sonicFoam.C
applications/solvers/compressible/sonicFoam/sonicFoam.C
+110
-0
applications/solvers/compressible/sonicFoam/sonicLiquidFoam/Make/files
...solvers/compressible/sonicFoam/sonicLiquidFoam/Make/files
+3
-0
applications/solvers/compressible/sonicFoam/sonicLiquidFoam/Make/options
...lvers/compressible/sonicFoam/sonicLiquidFoam/Make/options
+7
-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/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/Make/options
0 → 100644
View file @
ea17556c
EXE_INC = \
-I.. \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \
-lturbulenceModels \
-lcompressibleTurbulenceModels
applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/UEqn.H
0 → 100644
View file @
ea17556c
// Construct the Momentum equation
MRF
.
correctBoundaryVelocity
(
U
);
tmp
<
fvVectorMatrix
>
tUEqn
(
fvm
::
div
(
phi
,
U
)
+
MRF
.
DDt
(
rho
,
U
)
+
turbulence
->
divDevRhoReff
(
U
)
==
fvOptions
(
rho
,
U
)
);
fvVectorMatrix
&
UEqn
=
tUEqn
.
ref
();
UEqn
.
relax
();
// Include the porous media resistance and solve the momentum equation
// either implicit in the tensorial resistance or transport using by
// including the spherical part of the resistance in the momentum diagonal
tmp
<
volScalarField
>
trAU
;
tmp
<
volTensorField
>
trTU
;
if
(
pressureImplicitPorosity
)
{
tmp
<
volTensorField
>
tTU
=
tensor
(
I
)
*
UEqn
.
A
();
pZones
.
addResistance
(
UEqn
,
tTU
.
ref
());
trTU
=
inv
(
tTU
());
trTU
.
ref
().
rename
(
"rAU"
);
fvOptions
.
constrain
(
UEqn
);
volVectorField
gradp
(
fvc
::
grad
(
p
));
for
(
int
UCorr
=
0
;
UCorr
<
nUCorr
;
UCorr
++
)
{
U
=
trTU
()
&
(
UEqn
.
H
()
-
gradp
);
}
U
.
correctBoundaryConditions
();
fvOptions
.
correct
(
U
);
}
else
{
pZones
.
addResistance
(
UEqn
);
fvOptions
.
constrain
(
UEqn
);
solve
(
UEqn
==
-
fvc
::
grad
(
p
));
fvOptions
.
correct
(
U
);
trAU
=
1
.
0
/
UEqn
.
A
();
trAU
.
ref
().
rename
(
"rAU"
);
}
applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/createZones.H
0 → 100644
View file @
ea17556c
IOporosityModelList
pZones
(
mesh
);
bool
pressureImplicitPorosity
(
false
);
// nUCorrectors used for pressureImplicitPorosity
int
nUCorr
=
0
;
if
(
pZones
.
active
())
{
// nUCorrectors for pressureImplicitPorosity
simple
.
dict
().
readIfPresent
(
"nUCorrectors"
,
nUCorr
);
if
(
nUCorr
>
0
)
{
pressureImplicitPorosity
=
true
;
Info
<<
"Using pressure implicit porosity"
<<
endl
;
}
else
{
Info
<<
"Using pressure explicit porosity"
<<
endl
;
}
}
applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/pEqn.H
0 → 100644
View file @
ea17556c
{
const
volScalarField
&
psi
=
thermo
.
psi
();
tmp
<
volVectorField
>
tHbyA
;
if
(
pressureImplicitPorosity
)
{
tHbyA
=
constrainHbyA
(
trTU
()
&
UEqn
.
H
(),
U
,
p
);
}
else
{
tHbyA
=
constrainHbyA
(
trAU
()
*
UEqn
.
H
(),
U
,
p
);
}
volVectorField
&
HbyA
=
tHbyA
.
ref
();
tUEqn
.
clear
();
bool
closedVolume
=
false
;
surfaceScalarField
phiHbyA
(
"phiHbyA"
,
fvc
::
flux
(
rho
*
HbyA
));
MRF
.
makeRelative
(
fvc
::
interpolate
(
rho
),
phiHbyA
);
closedVolume
=
adjustPhi
(
phiHbyA
,
U
,
p
);
while
(
simple
.
correctNonOrthogonal
())
{
tmp
<
fvScalarMatrix
>
tpEqn
;
if
(
pressureImplicitPorosity
)
{
tpEqn
=
(
fvm
::
laplacian
(
rho
*
trTU
(),
p
)
+
fvOptions
(
psi
,
p
,
rho
.
name
())
==
fvc
::
div
(
phiHbyA
)
);
}
else
{
tpEqn
=
(
fvm
::
laplacian
(
rho
*
trAU
(),
p
)
+
fvOptions
(
psi
,
p
,
rho
.
name
())
==
fvc
::
div
(
phiHbyA
)
);
}
fvScalarMatrix
&
pEqn
=
tpEqn
.
ref
();
pEqn
.
setReference
(
pressureControl
.
refCell
(),
pressureControl
.
refValue
()
);
pEqn
.
solve
();
if
(
simple
.
finalNonOrthogonalIter
())
{
phi
=
phiHbyA
-
pEqn
.
flux
();
}
}
#include "incompressible/continuityErrs.H"
// Explicitly relax pressure for momentum corrector
p
.
relax
();
if
(
pressureImplicitPorosity
)
{
U
=
HbyA
-
(
trTU
()
&
fvc
::
grad
(
p
));
}
else
{
U
=
HbyA
-
trAU
()
*
fvc
::
grad
(
p
);
}
U
.
correctBoundaryConditions
();
fvOptions
.
correct
(
U
);
pressureControl
.
limit
(
p
);
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity
if
(
closedVolume
)
{
p
+=
(
initialMass
-
fvc
::
domainIntegrate
(
psi
*
p
))
/
fvc
::
domainIntegrate
(
psi
);
}
rho
=
thermo
.
rho
();
rho
.
relax
();
}
applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/rhoPorousSimpleFoam.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
rhoPorousSimpleFoam
Group
grpCompressibleSolvers
Description
Steady-state solver for compressible turbulent flow,
with implicit or explicit porosity treatment and optional sources.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "fluidThermo.H"
#include "turbulentFluidThermoModel.H"
#include "simpleControl.H"
#include "pressureControl.H"
#include "fvOptions.H"
#include "IOporosityModelList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Steady-state solver for compressible turbulent flow,"
"with implicit or explicit porosity treatment and optional sources."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createFields.H"
#include "createZones.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 "EEqn.H"
#include "pEqn.H"
}
turbulence
->
correct
();
runTime
.
write
();
runTime
.
printExecutionTime
(
Info
);
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.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
rhoSimpleFoam
Group
grpCompressibleSolvers
Description
Steady-state solver for compressible turbulent flow.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "fluidThermo.H"
#include "turbulentFluidThermoModel.H"
#include "simpleControl.H"
#include "pressureControl.H"
#include "fvOptions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Steady-state solver for compressible turbulent flow."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createFields.H"
#include "createFieldRefs.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 "EEqn.H"
if
(
simple
.
consistent
())
{
#include "pcEqn.H"
}
else
{
#include "pEqn.H"
}
turbulence
->
correct
();
runTime
.
write
();
runTime
.
printExecutionTime
(
Info
);
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
applications/solvers/compressible/sonicFoam/EEqn.H
0 → 100644
View file @
ea17556c
{
fvScalarMatrix
EEqn
(
fvm
::
ddt
(
rho
,
e
)
+
fvm
::
div
(
phi
,
e
)
+
fvc
::
ddt
(
rho
,
K
)
+
fvc
::
div
(
phi
,
K
)
+
fvc
::
div
(
fvc
::
absolute
(
phi
/
fvc
::
interpolate
(
rho
),
U
),
p
,
"div(phiv,p)"
)
-
fvm
::
laplacian
(
turbulence
->
alphaEff
(),
e
)
==
fvOptions
(
rho
,
e
)
);
EEqn
.
relax
();
fvOptions
.
constrain
(
EEqn
);
EEqn
.
solve
();
fvOptions
.
correct
(
e
);
thermo
.
correct
();
}
applications/solvers/compressible/sonicFoam/Make/files
0 → 100644
View file @
ea17556c
sonicFoam.C
EXE = $(FOAM_APPBIN)/sonicFoam
applications/solvers/compressible/sonicFoam/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)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \
-lturbulenceModels \
-lcompressibleTurbulenceModels
applications/solvers/compressible/sonicFoam/UEqn.H
0 → 100644
View file @
ea17556c
// Solve the Momentum equation
MRF
.
correctBoundaryVelocity
(
U
);
fvVectorMatrix
UEqn
(
fvm
::
ddt
(
rho
,
U
)
+
fvm
::
div
(
phi
,
U
)
+
MRF
.
DDt
(
rho
,
U
)
+
turbulence
->
divDevRhoReff
(
U
)
==
fvOptions
(
rho
,
U
)
);
UEqn
.
relax
();
fvOptions
.
constrain
(
UEqn
);
if
(
pimple
.
momentumPredictor
())
{
solve
(
UEqn
==
-
fvc
::
grad
(
p
));
fvOptions
.
correct
(
U
);
K
=
0
.
5
*
magSqr
(
U
);
}
applications/solvers/compressible/sonicFoam/createFieldRefs.H
0 → 100644
View file @
ea17556c
volScalarField
&
e
=
thermo
.
he
();
const
volScalarField
&
psi
=
thermo
.
psi
();
applications/solvers/compressible/sonicFoam/createFields.H
0 → 100644
View file @
ea17556c
Info
<<
"Reading thermophysical properties
\n
"
<<
endl
;
autoPtr
<
psiThermo
>
pThermo
(
psiThermo
::
New
(
mesh
)
);
psiThermo
&
thermo
=
pThermo
();
thermo
.
validate
(
args
.
executable
(),
"e"
);
volScalarField
&
p
=
thermo
.
p
();
volScalarField
rho
(
IOobject
(
"rho"
,
runTime
.
timeName
(),
mesh
),
thermo
.
rho
()
);
Info
<<
"Reading field U
\n
"
<<
endl
;
volVectorField
U
(
IOobject
(
"U"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
#include "compressibleCreatePhi.H"
mesh
.
setFluxRequired
(
p
.
name
());
Info
<<
"Creating turbulence model
\n
"
<<
endl
;
autoPtr
<
compressible
::
turbulenceModel
>
turbulence
(
compressible
::
turbulenceModel
::
New
(
rho
,
U
,
phi
,
thermo
)
);
#include "createK.H"
#include "createMRF.H"
#include "createFvOptions.H"
applications/solvers/compressible/sonicFoam/pEqn.H
0 → 100644
View file @
ea17556c
rho
=
thermo
.
rho
();
volScalarField
rAU
(
1
.
0
/
UEqn
.
A
());
surfaceScalarField
rhorAUf
(
"rhorAUf"
,
fvc
::
interpolate
(
rho
*
rAU
));
volVectorField
HbyA
(
constrainHbyA
(
rAU
*
UEqn
.
H
(),
U
,
p
));
surfaceScalarField
phid
(
"phid"
,
fvc
::
interpolate
(
psi
)
*
(
fvc
::
flux
(
HbyA
)
+
MRF
.
zeroFilter
(
rhorAUf
*
fvc
::
ddtCorr
(
rho
,
U
,
phi
)
/
fvc
::
interpolate
(
rho
))
)
);
MRF
.
makeRelative
(
fvc
::
interpolate
(
psi
),
phid
);
// Non-orthogonal pressure corrector loop
while
(
pimple
.
correctNonOrthogonal
())
{
fvScalarMatrix
pEqn
(
fvm
::
ddt
(
psi
,
p
)
+
fvm
::
div
(
phid
,
p
)
-
fvm
::
laplacian
(
rhorAUf
,
p
)
==
fvOptions
(
psi
,
p
,
rho
.
name
())
);
pEqn
.
solve
();
if
(
pimple
.
finalNonOrthogonalIter
())
{
phi
=
pEqn
.
flux
();
}
}
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
U
=
HbyA
-
rAU
*
fvc
::
grad
(
p
);
U
.
correctBoundaryConditions
();
fvOptions
.
correct
(
U
);
K
=
0
.
5
*
magSqr
(
U
);
applications/solvers/compressible/sonicFoam/sonicDyMFoam/Make/files
0 → 100644
View file @
ea17556c
sonicDyMFoam.C
EXE = $(FOAM_APPBIN)/sonicDyMFoam
applications/solvers/compressible/sonicFoam/sonicDyMFoam/Make/options
0 → 100644
View file @
ea17556c
EXE_INC = \
-I.. \
-I../../rhoPimpleFoam \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-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)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-ldynamicMesh \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-lsampling
applications/solvers/compressible/sonicFoam/sonicDyMFoam/pEqn.H
0 → 100644
View file @
ea17556c
rho
=
thermo
.
rho
();
volScalarField
rAU
(
1
.
0
/
UEqn
.
A
());
surfaceScalarField
rhorAUf
(
"rhorAUf"
,
fvc
::
interpolate
(
rho
*
rAU
));
volVectorField
HbyA
(
constrainHbyA
(
rAU
*
UEqn
.
H
(),
U
,
p
));
surfaceScalarField
phid
(
"phid"
,
fvc
::
interpolate
(
psi
)
*
(
fvc
::
flux
(
HbyA
)
+
rhorAUf
*
fvc
::
ddtCorr
(
rho
,
U
,
rhoUf
)
/
fvc
::
interpolate
(
rho
)
)
);
fvc
::
makeRelative
(
phid
,
psi
,
U
);
MRF
.
makeRelative
(
fvc
::
interpolate
(
psi
),
phid
);
// Non-orthogonal pressure corrector loop
while
(
pimple
.
correctNonOrthogonal
())
{
fvScalarMatrix
pEqn
(
fvm
::
ddt
(
psi
,
p
)
+
fvm
::
div
(
phid
,
p
)
-
fvm
::
laplacian
(
rhorAUf
,
p
)
==
fvOptions
(
psi
,
p
,
rho
.
name
())
);
pEqn
.
solve
();
if
(
pimple
.
finalNonOrthogonalIter
())
{
phi
=
pEqn
.
flux
();
}
}
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
U
=
HbyA
-
rAU
*
fvc
::
grad
(
p
);
U
.
correctBoundaryConditions
();
fvOptions
.
correct
(
U
);
K
=
0
.
5
*
magSqr
(
U
);
{
rhoUf
=
fvc
::
interpolate
(
rho
*
U
);
surfaceVectorField
n
(
mesh
.
Sf
()
/
mesh
.
magSf
());
rhoUf
+=
n
*
(
fvc
::
absolute
(
phi
,
rho
,
U
)
/
mesh
.
magSf
()
-
(
n
&
rhoUf
));
}
applications/solvers/compressible/sonicFoam/sonicDyMFoam/sonicDyMFoam.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
sonicDyMFoam
Group
grpCompressibleSolvers grpMovingMeshSolvers
Description
Transient solver for trans-sonic/supersonic, turbulent flow of a
compressible gas, with optional mesh motion and mesh topology changes.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "psiThermo.H"
#include "turbulentFluidThermoModel.H"
#include "pimpleControl.H"
#include "CorrectPhi.H"
#include "fvOptions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Transient solver for trans-sonic/supersonic, turbulent flow"
" of a compressible gas.
\n
"
"With optional mesh motion and mesh topology changes."
);
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createDyMControls.H"
#include "createFields.H"
#include "createFieldRefs.H"
#include "createRhoUf.H"
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
#include "initContinuityErrs.H"
turbulence
->
validate
();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"
\n
Starting time loop
\n
"
<<
endl
;
while
(
runTime
.
run
())
{
#include "readDyMControls.H"
{
// Store divrhoU from the previous mesh so that it can be mapped
// and used in correctPhi to ensure the corrected phi has the
// same divergence
volScalarField
divrhoU
(
"divrhoU"
,
fvc
::
div
(
fvc
::
absolute
(
phi
,
rho
,
U
))
);
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
++
runTime
;
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
// Store momentum to set rhoUf for introduced faces.
volVectorField
rhoU
(
"rhoU"
,
rho
*
U
);
// Do any mesh changes
mesh
.
update
();
if
(
mesh
.
changing
())
{
MRF
.
update
();
if
(
correctPhi
)
{
// Calculate absolute flux from the mapped surface velocity
phi
=
mesh
.
Sf
()
&
rhoUf
;
#include "correctPhi.H"
// Make the fluxes relative to the mesh-motion
fvc
::
makeRelative
(
phi
,
rho
,
U
);
}
}
if
(
checkMeshCourantNo
)
{
#include "meshCourantNo.H"
}
}
#include "rhoEqn.H"
Info
<<
"rho min/max : "
<<
min
(
rho
).
value
()
<<
" "
<<
max
(
rho
).
value
()
<<
endl
;
// --- Pressure-velocity PIMPLE corrector loop
while
(
pimple
.
loop
())
{
#include "UEqn.H"
#include "EEqn.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
;
}
// ************************************************************************* //
applications/solvers/compressible/sonicFoam/sonicFoam.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
sonicFoam
Group
grpCompressibleSolvers
Description
Transient solver for trans-sonic/supersonic, turbulent flow of a
compressible gas.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "psiThermo.H"
#include "turbulentFluidThermoModel.H"
#include "pimpleControl.H"
#include "fvOptions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Transient solver for trans-sonic/supersonic, turbulent flow"
" of a compressible gas."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createFields.H"
#include "createFieldRefs.H"
#include "initContinuityErrs.H"
turbulence
->
validate
();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"
\n
Starting time loop
\n
"
<<
endl
;
while
(
runTime
.
loop
())
{
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
#include "compressibleCourantNo.H"
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
while
(
pimple
.
loop
())
{
#include "UEqn.H"
#include "EEqn.H"
// --- Pressure corrector loop
while
(
pimple
.
correct
())
{
#include "pEqn.H"
}
if
(
pimple
.
turbCorr
())
{
turbulence
->
correct
();
}
}
rho
=
thermo
.
rho
();
runTime
.
write
();
runTime
.
printExecutionTime
(
Info
);
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
applications/solvers/compressible/sonicFoam/sonicLiquidFoam/Make/files
0 → 100644
View file @
ea17556c
sonicLiquidFoam.C
EXE = $(FOAM_APPBIN)/sonicLiquidFoam
applications/solvers/compressible/sonicFoam/sonicLiquidFoam/Make/options
0 → 100644
View file @
ea17556c
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools
Prev
1
…
10
11
12
13
14
15
16
17
18
…
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