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
913 additions
and
0 deletions
+913
-0
applications/solvers/combustion/fireFoam/createFieldRefs.H
applications/solvers/combustion/fireFoam/createFieldRefs.H
+4
-0
applications/solvers/combustion/fireFoam/createFields.H
applications/solvers/combustion/fireFoam/createFields.H
+127
-0
applications/solvers/combustion/fireFoam/createPyrolysisModel.H
...ations/solvers/combustion/fireFoam/createPyrolysisModel.H
+3
-0
applications/solvers/combustion/fireFoam/createRegionControls.H
...ations/solvers/combustion/fireFoam/createRegionControls.H
+23
-0
applications/solvers/combustion/fireFoam/createSurfaceFilmModel.H
...ions/solvers/combustion/fireFoam/createSurfaceFilmModel.H
+6
-0
applications/solvers/combustion/fireFoam/fireFoam.C
applications/solvers/combustion/fireFoam/fireFoam.C
+139
-0
applications/solvers/combustion/fireFoam/pEqn.H
applications/solvers/combustion/fireFoam/pEqn.H
+60
-0
applications/solvers/combustion/fireFoam/phrghEqn.H
applications/solvers/combustion/fireFoam/phrghEqn.H
+62
-0
applications/solvers/combustion/fireFoam/rhoEqn.H
applications/solvers/combustion/fireFoam/rhoEqn.H
+50
-0
applications/solvers/combustion/fireFoam/setMultiRegionDeltaT.H
...ations/solvers/combustion/fireFoam/setMultiRegionDeltaT.H
+66
-0
applications/solvers/combustion/fireFoam/solidRegionDiffusionNo.H
...ions/solvers/combustion/fireFoam/solidRegionDiffusionNo.H
+1
-0
applications/solvers/combustion/reactingFoam/EEqn.H
applications/solvers/combustion/reactingFoam/EEqn.H
+36
-0
applications/solvers/combustion/reactingFoam/Make/files
applications/solvers/combustion/reactingFoam/Make/files
+3
-0
applications/solvers/combustion/reactingFoam/Make/options
applications/solvers/combustion/reactingFoam/Make/options
+32
-0
applications/solvers/combustion/reactingFoam/Make/options.bak
...ications/solvers/combustion/reactingFoam/Make/options.bak
+28
-0
applications/solvers/combustion/reactingFoam/UEqn.H
applications/solvers/combustion/reactingFoam/UEqn.H
+25
-0
applications/solvers/combustion/reactingFoam/YEqn.H
applications/solvers/combustion/reactingFoam/YEqn.H
+43
-0
applications/solvers/combustion/reactingFoam/createFieldRefs.H
...cations/solvers/combustion/reactingFoam/createFieldRefs.H
+3
-0
applications/solvers/combustion/reactingFoam/createFields.H
applications/solvers/combustion/reactingFoam/createFields.H
+97
-0
applications/solvers/combustion/reactingFoam/pEqn.H
applications/solvers/combustion/reactingFoam/pEqn.H
+105
-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/combustion/fireFoam/createFieldRefs.H
0 → 100644
View file @
ea17556c
const
volScalarField
&
psi
=
thermo
.
psi
();
const
volScalarField
&
T
=
thermo
.
T
();
regionModels
::
surfaceFilmModel
&
surfaceFilm
=
tsurfaceFilm
();
const
label
inertIndex
(
composition
.
species
()[
inertSpecie
]);
applications/solvers/combustion/fireFoam/createFields.H
0 → 100644
View file @
ea17556c
Info
<<
"Reading thermophysical properties
\n
"
<<
endl
;
autoPtr
<
psiReactionThermo
>
pThermo
(
psiReactionThermo
::
New
(
mesh
));
psiReactionThermo
&
thermo
=
pThermo
();
thermo
.
validate
(
args
.
executable
(),
"h"
,
"e"
);
SLGThermo
slgThermo
(
mesh
,
thermo
);
basicSpecieMixture
&
composition
=
thermo
.
composition
();
PtrList
<
volScalarField
>&
Y
=
composition
.
Y
();
const
word
inertSpecie
(
thermo
.
get
<
word
>
(
"inertSpecie"
));
if
(
!
composition
.
species
().
found
(
inertSpecie
))
{
FatalIOErrorIn
(
args
.
executable
().
c_str
(),
thermo
)
<<
"Inert specie "
<<
inertSpecie
<<
" not found in available species "
<<
composition
.
species
()
<<
exit
(
FatalIOError
);
}
Info
<<
"Creating field rho
\n
"
<<
endl
;
volScalarField
rho
(
IOobject
(
"rho"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
thermo
.
rho
()
);
volScalarField
&
p
=
thermo
.
p
();
Info
<<
"
\n
Reading field U
\n
"
<<
endl
;
volVectorField
U
(
IOobject
(
"U"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
#include "compressibleCreatePhi.H"
#include "createMRF.H"
Info
<<
"Creating turbulence model
\n
"
<<
endl
;
autoPtr
<
compressible
::
turbulenceModel
>
turbulence
(
compressible
::
turbulenceModel
::
New
(
rho
,
U
,
phi
,
thermo
)
);
Info
<<
"Creating combustion model
\n
"
<<
endl
;
autoPtr
<
CombustionModel
<
psiReactionThermo
>>
combustion
(
CombustionModel
<
psiReactionThermo
>::
New
(
thermo
,
turbulence
())
);
#include "readGravitationalAcceleration.H"
#include "readhRef.H"
#include "gh.H"
#include "readpRef.H"
volScalarField
p_rgh
(
IOobject
(
"p_rgh"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
mesh
.
setFluxRequired
(
p_rgh
.
name
());
#include "phrghEqn.H"
multivariateSurfaceInterpolationScheme
<
scalar
>::
fieldTable
fields
;
forAll
(
Y
,
i
)
{
fields
.
add
(
Y
[
i
]);
}
fields
.
add
(
thermo
.
he
());
volScalarField
Qdot
(
IOobject
(
"Qdot"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
READ_IF_PRESENT
,
IOobject
::
AUTO_WRITE
),
mesh
,
dimensionedScalar
(
dimEnergy
/
dimVolume
/
dimTime
,
Zero
)
);
#include "createDpdt.H"
#include "createK.H"
#include "createClouds.H"
#include "createSurfaceFilmModel.H"
#include "createPyrolysisModel.H"
#include "createRadiationModel.H"
#include "createFvOptions.H"
applications/solvers/combustion/fireFoam/createPyrolysisModel.H
0 → 100644
View file @
ea17556c
Info
<<
"Creating pyrolysis model"
<<
endl
;
regionModels
::
pyrolysisModels
::
pyrolysisModelCollection
pyrolysis
(
mesh
);
applications/solvers/combustion/fireFoam/createRegionControls.H
0 → 100644
View file @
ea17556c
IOdictionary
additionalControlsDict
(
IOobject
(
"additionalControls"
,
runTime
.
constant
(),
mesh
,
IOobject
::
MUST_READ_IF_MODIFIED
,
IOobject
::
NO_WRITE
)
);
bool
solvePrimaryRegion
(
additionalControlsDict
.
getOrDefault
(
"solvePrimaryRegion"
,
true
)
);
bool
solvePyrolysisRegion
(
additionalControlsDict
.
getOrDefault
(
"solvePyrolysisRegion"
,
true
)
);
scalar
maxDi
=
pyrolysis
.
maxDiff
();
applications/solvers/combustion/fireFoam/createSurfaceFilmModel.H
0 → 100644
View file @
ea17556c
Info
<<
"
\n
Constructing surface film model"
<<
endl
;
autoPtr
<
regionModels
::
surfaceFilmModel
>
tsurfaceFilm
(
regionModels
::
surfaceFilmModel
::
New
(
mesh
,
g
)
);
applications/solvers/combustion/fireFoam/fireFoam.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
fireFoam
Group
grpCombustionSolvers
Description
Transient solver for fires and turbulent diffusion flames with reacting
particle clouds, surface film and pyrolysis modelling.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "turbulentFluidThermoModel.H"
#include "basicReactingCloud.H"
#include "surfaceFilmModel.H"
#include "pyrolysisModelCollection.H"
#include "radiationModel.H"
#include "SLGThermo.H"
#include "solidChemistryModel.H"
#include "psiReactionThermo.H"
#include "CombustionModel.H"
#include "pimpleControl.H"
#include "fvOptions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Transient solver for fires and turbulent diffusion flames"
" with reacting particle clouds, surface film and pyrolysis modelling."
);
#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"
#include "createTimeControls.H"
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
#include "createRegionControls.H"
turbulence
->
validate
();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"
\n
Starting time loop
\n
"
<<
endl
;
while
(
runTime
.
run
())
{
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "solidRegionDiffusionNo.H"
#include "setMultiRegionDeltaT.H"
#include "setDeltaT.H"
++
runTime
;
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
parcels
.
evolve
();
surfaceFilm
.
evolve
();
if
(
solvePyrolysisRegion
)
{
pyrolysis
.
evolve
();
}
if
(
solvePrimaryRegion
)
{
#include "rhoEqn.H"
// --- PIMPLE loop
while
(
pimple
.
loop
())
{
#include "UEqn.H"
#include "YEEqn.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/combustion/fireFoam/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
phig
(
"phig"
,
-
rhorAUf
*
ghf
*
fvc
::
snGrad
(
rho
)
*
mesh
.
magSf
());
surfaceScalarField
phiHbyA
(
"phiHbyA"
,
(
fvc
::
flux
(
rho
*
HbyA
)
+
MRF
.
zeroFilter
(
rhorAUf
*
fvc
::
ddtCorr
(
rho
,
U
,
phi
))
)
+
phig
);
MRF
.
makeRelative
(
fvc
::
interpolate
(
rho
),
phiHbyA
);
// Update the pressure BCs to ensure flux consistency
constrainPressure
(
p_rgh
,
rho
,
U
,
phiHbyA
,
rhorAUf
,
MRF
);
while
(
pimple
.
correctNonOrthogonal
())
{
fvScalarMatrix
p_rghEqn
(
fvm
::
ddt
(
psi
,
p_rgh
)
+
fvc
::
ddt
(
psi
,
rho
)
*
gh
+
fvc
::
ddt
(
psi
)
*
pRef
+
fvc
::
div
(
phiHbyA
)
-
fvm
::
laplacian
(
rhorAUf
,
p_rgh
)
==
parcels
.
Srho
()
+
surfaceFilm
.
Srho
()
+
fvOptions
(
psi
,
p_rgh
,
rho
.
name
())
);
p_rghEqn
.
solve
(
mesh
.
solver
(
p_rgh
.
select
(
pimple
.
finalInnerIter
())));
if
(
pimple
.
finalNonOrthogonalIter
())
{
phi
=
phiHbyA
+
p_rghEqn
.
flux
();
U
=
HbyA
+
rAU
*
fvc
::
reconstruct
((
p_rghEqn
.
flux
()
+
phig
)
/
rhorAUf
);
U
.
correctBoundaryConditions
();
fvOptions
.
correct
(
U
);
}
}
p
=
p_rgh
+
rho
*
gh
+
pRef
;
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
K
=
0
.
5
*
magSqr
(
U
);
if
(
thermo
.
dpdt
())
{
dpdt
=
fvc
::
ddt
(
p
);
}
applications/solvers/combustion/fireFoam/phrghEqn.H
0 → 100644
View file @
ea17556c
if
(
pimple
.
dict
().
getOrDefault
(
"hydrostaticInitialization"
,
false
))
{
volScalarField
&
ph_rgh
=
regIOobject
::
store
(
new
volScalarField
(
IOobject
(
"ph_rgh"
,
"0"
,
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
NO_WRITE
),
mesh
)
);
if
(
equal
(
runTime
.
value
(),
0
))
{
p
=
ph_rgh
+
rho
*
gh
+
pRef
;
thermo
.
correct
();
rho
=
thermo
.
rho
();
label
nCorr
(
pimple
.
dict
().
getOrDefault
<
label
>
(
"nHydrostaticCorrectors"
,
5
)
);
for
(
label
i
=
0
;
i
<
nCorr
;
i
++
)
{
surfaceScalarField
rhof
(
"rhof"
,
fvc
::
interpolate
(
rho
));
surfaceScalarField
phig
(
"phig"
,
-
rhof
*
ghf
*
fvc
::
snGrad
(
rho
)
*
mesh
.
magSf
()
);
// Update the pressure BCs to ensure flux consistency
constrainPressure
(
ph_rgh
,
rho
,
U
,
phig
,
rhof
);
fvScalarMatrix
ph_rghEqn
(
fvm
::
laplacian
(
rhof
,
ph_rgh
)
==
fvc
::
div
(
phig
)
);
ph_rghEqn
.
solve
();
p
=
ph_rgh
+
rho
*
gh
+
pRef
;
thermo
.
correct
();
rho
=
thermo
.
rho
();
Info
<<
"Hydrostatic pressure variation "
<<
(
max
(
ph_rgh
)
-
min
(
ph_rgh
)).
value
()
<<
endl
;
}
ph_rgh
.
write
();
p_rgh
=
ph_rgh
;
}
}
applications/solvers/combustion/fireFoam/rhoEqn.H
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-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Global
rhoEqn
Description
Solve the continuity for density.
\*---------------------------------------------------------------------------*/
{
fvScalarMatrix
rhoEqn
(
fvm
::
ddt
(
rho
)
+
fvc
::
div
(
phi
)
==
parcels
.
Srho
(
rho
)
+
surfaceFilm
.
Srho
()
+
fvOptions
(
rho
)
);
rhoEqn
.
solve
();
fvOptions
.
correct
(
rho
);
}
// ************************************************************************* //
applications/solvers/combustion/fireFoam/setMultiRegionDeltaT.H
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 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/>.
Global
setMultiRegionDeltaT
Description
Reset the timestep to maintain a constant maximum Courant numbers.
Reduction of time-step is immediate, but increase is damped to avoid
unstable oscillations.
\*---------------------------------------------------------------------------*/
if
(
adjustTimeStep
)
{
if
(
CoNum
==
-
GREAT
)
{
CoNum
=
SMALL
;
}
if
(
DiNum
==
-
GREAT
)
{
DiNum
=
SMALL
;
}
const
scalar
TFactorFluid
=
maxCo
/
(
CoNum
+
SMALL
);
const
scalar
TFactorSolid
=
maxDi
/
(
DiNum
+
SMALL
);
const
scalar
TFactorFilm
=
maxCo
/
(
surfaceFilm
.
CourantNumber
()
+
SMALL
);
const
scalar
dt0
=
runTime
.
deltaTValue
();
runTime
.
setDeltaT
(
min
(
dt0
*
min
(
min
(
TFactorFluid
,
min
(
TFactorFilm
,
TFactorSolid
)),
1
.
2
),
maxDeltaT
)
);
}
// ************************************************************************* //
applications/solvers/combustion/fireFoam/solidRegionDiffusionNo.H
0 → 100644
View file @
ea17556c
scalar
DiNum
=
pyrolysis
.
solidRegionDiffNo
();
applications/solvers/combustion/reactingFoam/EEqn.H
0 → 100644
View file @
ea17556c
{
volScalarField
&
he
=
thermo
.
he
();
fvScalarMatrix
EEqn
(
fvm
::
ddt
(
rho
,
he
)
+
mvConvection
->
fvmDiv
(
phi
,
he
)
+
fvc
::
ddt
(
rho
,
K
)
+
fvc
::
div
(
phi
,
K
)
+
(
he
.
name
()
==
"e"
?
fvc
::
div
(
fvc
::
absolute
(
phi
/
fvc
::
interpolate
(
rho
),
U
),
p
,
"div(phiv,p)"
)
:
-
dpdt
)
-
fvm
::
laplacian
(
turbulence
->
alphaEff
(),
he
)
==
Qdot
+
fvOptions
(
rho
,
he
)
);
EEqn
.
relax
();
fvOptions
.
constrain
(
EEqn
);
EEqn
.
solve
();
fvOptions
.
correct
(
he
);
thermo
.
correct
();
Info
<<
"min/max(T) = "
<<
min
(
T
).
value
()
<<
", "
<<
max
(
T
).
value
()
<<
endl
;
}
applications/solvers/combustion/reactingFoam/Make/files
0 → 100644
View file @
ea17556c
reactingFoam.C
EXE = $(FOAM_APPBIN)/reactingFoam
applications/solvers/combustion/reactingFoam/Make/options
0 → 100644
View file @
ea17556c
EXE_INC = \
-I$(LIB_SRC)/gpufiniteVolume/lnInclude \
-I$(LIB_SRC)/gpuOpenFOAM/lnInclude \
-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/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lgpuOpenFOAM \
-lgpufiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-lreactionThermophysicalModels \
-lspecie \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lchemistryModel \
-lODE \
-lcombustionModels
applications/solvers/combustion/reactingFoam/Make/options.bak
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/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-lreactionThermophysicalModels \
-lspecie \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lchemistryModel \
-lODE \
-lcombustionModels
applications/solvers/combustion/reactingFoam/UEqn.H
0 → 100644
View file @
ea17556c
// Solve the Momentum equation
MRF
.
correctBoundaryVelocity
(
U
);
tmp
<
fvVectorMatrix
>
tUEqn
(
fvm
::
ddt
(
rho
,
U
)
+
fvm
::
div
(
phi
,
U
)
+
MRF
.
DDt
(
rho
,
U
)
+
turbulence
->
divDevRhoReff
(
U
)
==
fvOptions
(
rho
,
U
)
);
fvVectorMatrix
&
UEqn
=
tUEqn
.
ref
();
UEqn
.
relax
();
fvOptions
.
constrain
(
UEqn
);
if
(
pimple
.
momentumPredictor
())
{
solve
(
UEqn
==
-
fvc
::
grad
(
p
));
fvOptions
.
correct
(
U
);
K
=
0
.
5
*
magSqr
(
U
);
}
applications/solvers/combustion/reactingFoam/YEqn.H
0 → 100644
View file @
ea17556c
tmp
<
fv
::
convectionScheme
<
scalar
>>
mvConvection
(
fv
::
convectionScheme
<
scalar
>::
New
(
mesh
,
fields
,
phi
,
mesh
.
divScheme
(
"div(phi,Yi_h)"
)
)
);
{
reaction
->
correct
();
Qdot
=
reaction
->
Qdot
();
volScalarField
Yt
(
0
.
0
*
Y
[
0
]);
forAll
(
Y
,
i
)
{
if
(
i
!=
inertIndex
&&
composition
.
active
(
i
))
{
volScalarField
&
Yi
=
Y
[
i
];
fvScalarMatrix
YiEqn
(
fvm
::
ddt
(
rho
,
Yi
)
+
mvConvection
->
fvmDiv
(
phi
,
Yi
)
-
fvm
::
laplacian
(
turbulence
->
muEff
(),
Yi
)
==
reaction
->
R
(
Yi
)
);
YiEqn
.
relax
();
YiEqn
.
solve
(
mesh
.
solver
(
"Yi"
));
Yi
.
max
(
0
.
0
);
Yt
+=
Yi
;
}
}
Y
[
inertIndex
]
=
scalar
(
1
)
-
Yt
;
Y
[
inertIndex
].
max
(
0
.
0
);
}
applications/solvers/combustion/reactingFoam/createFieldRefs.H
0 → 100644
View file @
ea17556c
const
volScalarField
&
psi
=
thermo
.
psi
();
const
volScalarField
&
T
=
thermo
.
T
();
const
label
inertIndex
(
composition
.
species
()[
inertSpecie
]);
applications/solvers/combustion/reactingFoam/createFields.H
0 → 100644
View file @
ea17556c
#include "createRDeltaT.H"
Info
<<
"Reading thermophysical properties
\n
"
<<
endl
;
autoPtr
<
psiReactionThermo
>
pThermo
(
psiReactionThermo
::
New
(
mesh
));
psiReactionThermo
&
thermo
=
pThermo
();
thermo
.
validate
(
args
.
executable
(),
"h"
,
"e"
);
basicSpecieMixture
&
composition
=
thermo
.
composition
();
PtrList
<
volScalarField
>&
Y
=
composition
.
Y
();
const
word
inertSpecie
(
thermo
.
get
<
word
>
(
"inertSpecie"
));
if
(
!
composition
.
species
().
found
(
inertSpecie
))
{
FatalIOErrorIn
(
args
.
executable
().
c_str
(),
thermo
)
<<
"Inert specie "
<<
inertSpecie
<<
" not found in available species "
<<
composition
.
species
()
<<
exit
(
FatalIOError
);
}
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
);
volScalarField
&
p
=
thermo
.
p
();
#include "compressibleCreatePhi.H"
pressureControl
pressureControl
(
p
,
rho
,
pimple
.
dict
(),
false
);
mesh
.
setFluxRequired
(
p
.
name
());
Info
<<
"Creating turbulence model.
\n
"
<<
nl
;
autoPtr
<
compressible
::
turbulenceModel
>
turbulence
(
compressible
::
turbulenceModel
::
New
(
rho
,
U
,
phi
,
thermo
)
);
Info
<<
"Creating reaction model
\n
"
<<
endl
;
autoPtr
<
CombustionModel
<
psiReactionThermo
>>
reaction
(
CombustionModel
<
psiReactionThermo
>::
New
(
thermo
,
turbulence
())
);
multivariateSurfaceInterpolationScheme
<
scalar
>::
fieldTable
fields
;
forAll
(
Y
,
i
)
{
fields
.
add
(
Y
[
i
]);
}
fields
.
add
(
thermo
.
he
());
volScalarField
Qdot
(
IOobject
(
"Qdot"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
READ_IF_PRESENT
,
IOobject
::
AUTO_WRITE
),
mesh
,
dimensionedScalar
(
dimEnergy
/
dimVolume
/
dimTime
,
Zero
)
);
#include "createDpdt.H"
#include "createK.H"
#include "createMRF.H"
#include "createFvOptions.H"
applications/solvers/combustion/reactingFoam/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
));
if
(
pimple
.
nCorrPISO
()
<=
1
)
{
tUEqn
.
clear
();
}
if
(
pimple
.
transonic
())
{
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
);
while
(
pimple
.
correctNonOrthogonal
())
{
fvScalarMatrix
pEqn
(
fvm
::
ddt
(
psi
,
p
)
+
fvm
::
div
(
phid
,
p
)
-
fvm
::
laplacian
(
rhorAUf
,
p
)
==
fvOptions
(
psi
,
p
,
rho
.
name
())
);
pEqn
.
solve
(
mesh
.
solver
(
p
.
select
(
pimple
.
finalInnerIter
())));
if
(
pimple
.
finalNonOrthogonalIter
())
{
phi
==
pEqn
.
flux
();
}
}
}
else
{
surfaceScalarField
phiHbyA
(
"phiHbyA"
,
(
fvc
::
flux
(
rho
*
HbyA
)
+
MRF
.
zeroFilter
(
rhorAUf
*
fvc
::
ddtCorr
(
rho
,
U
,
phi
))
)
);
MRF
.
makeRelative
(
fvc
::
interpolate
(
rho
),
phiHbyA
);
// Update the pressure BCs to ensure flux consistency
constrainPressure
(
p
,
rho
,
U
,
phiHbyA
,
rhorAUf
,
MRF
);
while
(
pimple
.
correctNonOrthogonal
())
{
fvScalarMatrix
pEqn
(
fvm
::
ddt
(
psi
,
p
)
+
fvc
::
div
(
phiHbyA
)
-
fvm
::
laplacian
(
rhorAUf
,
p
)
==
fvOptions
(
psi
,
p
,
rho
.
name
())
);
pEqn
.
solve
(
mesh
.
solver
(
p
.
select
(
pimple
.
finalInnerIter
())));
if
(
pimple
.
finalNonOrthogonalIter
())
{
phi
=
phiHbyA
+
pEqn
.
flux
();
}
}
}
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
// Explicitly relax pressure for momentum corrector
p
.
relax
();
U
=
HbyA
-
rAU
*
fvc
::
grad
(
p
);
U
.
correctBoundaryConditions
();
fvOptions
.
correct
(
U
);
K
=
0
.
5
*
magSqr
(
U
);
if
(
pressureControl
.
limit
(
p
))
{
p
.
correctBoundaryConditions
();
}
rho
=
thermo
.
rho
();
if
(
thermo
.
dpdt
())
{
dpdt
=
fvc
::
ddt
(
p
);
}
Prev
1
…
5
6
7
8
9
10
11
12
13
…
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