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
926 additions
and
0 deletions
+926
-0
applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.H
.../PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.H
+222
-0
applications/solvers/combustion/PDRFoam/pEqn.H
applications/solvers/combustion/PDRFoam/pEqn.H
+80
-0
applications/solvers/combustion/PDRFoam/readCombustionProperties.H
...ons/solvers/combustion/PDRFoam/readCombustionProperties.H
+15
-0
applications/solvers/combustion/PDRFoam/rhoEqn.H
applications/solvers/combustion/PDRFoam/rhoEqn.H
+38
-0
applications/solvers/combustion/PDRFoam/setDeltaT.H
applications/solvers/combustion/PDRFoam/setDeltaT.H
+53
-0
applications/solvers/combustion/XiFoam/EaEqn.H
applications/solvers/combustion/XiFoam/EaEqn.H
+31
-0
applications/solvers/combustion/XiFoam/EauEqn.H
applications/solvers/combustion/XiFoam/EauEqn.H
+36
-0
applications/solvers/combustion/XiFoam/Make/files
applications/solvers/combustion/XiFoam/Make/files
+3
-0
applications/solvers/combustion/XiFoam/Make/options
applications/solvers/combustion/XiFoam/Make/options
+26
-0
applications/solvers/combustion/XiFoam/UEqn.H
applications/solvers/combustion/XiFoam/UEqn.H
+22
-0
applications/solvers/combustion/XiFoam/XiDyMFoam/Make/files
applications/solvers/combustion/XiFoam/XiDyMFoam/Make/files
+3
-0
applications/solvers/combustion/XiFoam/XiDyMFoam/Make/options
...ications/solvers/combustion/XiFoam/XiDyMFoam/Make/options
+33
-0
applications/solvers/combustion/XiFoam/XiDyMFoam/XiDyMFoam.C
applications/solvers/combustion/XiFoam/XiDyMFoam/XiDyMFoam.C
+190
-0
applications/solvers/combustion/XiFoam/XiDyMFoam/correctPhi.H
...ications/solvers/combustion/XiFoam/XiDyMFoam/correctPhi.H
+11
-0
applications/solvers/combustion/XiFoam/XiDyMFoam/createControls.H
...ions/solvers/combustion/XiFoam/XiDyMFoam/createControls.H
+11
-0
applications/solvers/combustion/XiFoam/XiDyMFoam/pEqn.H
applications/solvers/combustion/XiFoam/XiDyMFoam/pEqn.H
+100
-0
applications/solvers/combustion/XiFoam/XiDyMFoam/readControls.H
...ations/solvers/combustion/XiFoam/XiDyMFoam/readControls.H
+6
-0
applications/solvers/combustion/XiFoam/XiEngineFoam/Make/files
...cations/solvers/combustion/XiFoam/XiEngineFoam/Make/files
+3
-0
applications/solvers/combustion/XiFoam/XiEngineFoam/Make/options
...tions/solvers/combustion/XiFoam/XiEngineFoam/Make/options
+27
-0
applications/solvers/combustion/XiFoam/XiEngineFoam/UEqn.H
applications/solvers/combustion/XiFoam/XiEngineFoam/UEqn.H
+16
-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/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.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-2012 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::laminarFlameSpeedModels::SCOPE
Description
Laminar flame speed obtained from the SCOPE correlation.
Seven parameters are specified in terms of polynomial functions of
stoichiometry. Two polynomials are fitted, covering different parts of the
flammable range. If the mixture is outside the fitted range, linear
interpolation is used between the extreme of the polynomio and the upper or
lower flammable limit with the Markstein number constant.
Variations of pressure and temperature from the reference values are taken
into account through \f$ pexp \f$ and \f$ texp \f$
The laminar burning velocity fitting polynomial is:
\f$ Su = a_{0}(1+a_{1}x+K+..a_{i}x^{i}..+a_{6}x^{6}) (p/p_{ref})^{pexp}
(T/T_{ref})^{texp} \f$
where:
\f$ a_{i} \f$ are the polinomial coefficients.
\f$ pexp \f$ and \f$ texp \f$ are the pressure and temperature factors
respectively.
\f$ x \f$ is the equivalence ratio.
\f$ T_{ref} \f$ and \f$ p_{ref} \f$ are the temperature and pressure
references for the laminar burning velocity.
SourceFiles
SCOPELaminarFlameSpeed.C
\*---------------------------------------------------------------------------*/
#ifndef SCOPE_H
#define SCOPE_H
#include "laminarFlameSpeed.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
namespace
laminarFlameSpeedModels
{
/*---------------------------------------------------------------------------*\
Class SCOPE Declaration
\*---------------------------------------------------------------------------*/
class
SCOPE
:
public
laminarFlameSpeed
{
// Private Data
class
polynomial
:
public
FixedList
<
scalar
,
7
>
{
public:
//- Lower limit
scalar
ll
;
//- Upper polynomial limit
scalar
ul
;
//- Value at lower limit
scalar
llv
;
//- Value at upper limit
scalar
ulv
;
//- Changeover point from lower to upper polynomial
scalar
lu
;
//- Construct from dictionary
polynomial
(
const
dictionary
&
polyDict
);
};
dictionary
coeffsDict_
;
//- Lower flammability limit
scalar
LFL_
;
//- Upper flammability limit
scalar
UFL_
;
//- Lower Su polynomial
polynomial
SuPolyL_
;
//- Upper Su polynomial
polynomial
SuPolyU_
;
//- Temperature correction exponent
scalar
Texp_
;
//- Pressure correction exponent
scalar
pexp_
;
//- Lower Ma polynomial
polynomial
MaPolyL_
;
//- Upper Ma polynomial
polynomial
MaPolyU_
;
// Private member functions
//- Polynomial evaluated from the given equivalence ratio
// and polynomial coefficients
static
inline
scalar
polyPhi
(
scalar
phi
,
const
polynomial
&
a
);
//- Laminar flame speed evaluated from the given equivalence ratio
// at the reference temperature and pressure
inline
scalar
SuRef
(
scalar
phi
)
const
;
//- Markstein evaluated from the given equivalence ratio
inline
scalar
Ma
(
scalar
phi
)
const
;
//- Laminar flame speed evaluated from the given equivalence ratio
// corrected for temperature and pressure dependence
inline
scalar
Su0pTphi
(
scalar
p
,
scalar
Tu
,
scalar
phi
)
const
;
//- Laminar flame speed evaluated from the given uniform
// equivalence ratio corrected for temperature and pressure dependence
tmp
<
volScalarField
>
Su0pTphi
(
const
volScalarField
&
p
,
const
volScalarField
&
Tu
,
scalar
phi
)
const
;
//- Laminar flame speed evaluated from the given equivalence ratio
// distribution corrected for temperature and pressure dependence
tmp
<
volScalarField
>
Su0pTphi
(
const
volScalarField
&
p
,
const
volScalarField
&
Tu
,
const
volScalarField
&
phi
)
const
;
//- Return the Markstein number
// evaluated from the given equivalence ratio
tmp
<
volScalarField
>
Ma
(
const
volScalarField
&
phi
)
const
;
//- Construct as copy (not implemented)
SCOPE
(
const
SCOPE
&
);
void
operator
=
(
const
SCOPE
&
);
public:
//- Runtime type information
TypeName
(
"SCOPE"
);
// Constructors
//- Construct from dictionary and psiuReactionThermo
SCOPE
(
const
dictionary
&
,
const
psiuReactionThermo
&
);
//- Destructor
~
SCOPE
();
// Member functions
//- Return the Markstein number
tmp
<
volScalarField
>
Ma
()
const
;
//- Return the laminar flame speed [m/s]
tmp
<
volScalarField
>
operator
()()
const
;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End laminarFlameSpeedModels
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
applications/solvers/combustion/PDRFoam/pEqn.H
0 → 100644
View file @
ea17556c
rho
=
thermo
.
rho
();
volScalarField
rAU
(
1
.
0
/
UEqn
.
A
());
volVectorField
HbyA
(
constrainHbyA
(
invA
&
UEqn
.
H
(),
U
,
p
));
if
(
pimple
.
transonic
())
{
surfaceScalarField
phid
(
"phid"
,
fvc
::
interpolate
(
psi
)
*
(
fvc
::
flux
(
HbyA
)
+
fvc
::
interpolate
(
rho
*
rAU
)
*
fvc
::
ddtCorr
(
rho
,
U
,
phi
)
/
fvc
::
interpolate
(
rho
)
)
);
while
(
pimple
.
correctNonOrthogonal
())
{
fvScalarMatrix
pEqn
(
betav
*
fvm
::
ddt
(
psi
,
p
)
+
fvm
::
div
(
phid
,
p
)
-
fvm
::
laplacian
(
rho
*
invA
,
p
)
==
betav
*
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
)
+
fvc
::
interpolate
(
rho
*
rAU
)
*
fvc
::
ddtCorr
(
rho
,
U
,
phi
)
)
);
while
(
pimple
.
correctNonOrthogonal
())
{
fvScalarMatrix
pEqn
(
betav
*
fvm
::
ddt
(
psi
,
p
)
+
fvc
::
div
(
phiHbyA
)
-
fvm
::
laplacian
(
rho
*
invA
,
p
)
==
betav
*
fvOptions
(
psi
,
p
,
rho
.
name
())
);
pEqn
.
solve
(
mesh
.
solver
(
p
.
select
(
pimple
.
finalInnerIter
())));
if
(
pimple
.
finalNonOrthogonalIter
())
{
phi
=
phiHbyA
+
pEqn
.
flux
();
}
}
}
#include "rhoEqn.H"
#include "continuityErrs.H"
U
=
HbyA
-
(
invA
&
(
betav
*
fvc
::
grad
(
p
)));
U
.
correctBoundaryConditions
();
fvOptions
.
correct
(
U
);
K
=
0
.
5
*
magSqr
(
U
);
if
(
thermo
.
dpdt
())
{
dpdt
=
fvc
::
ddt
(
p
);
}
applications/solvers/combustion/PDRFoam/readCombustionProperties.H
0 → 100644
View file @
ea17556c
Info
<<
"Reading combustion properties
\n
"
<<
endl
;
IOdictionary
combustionProperties
(
IOobject
(
"combustionProperties"
,
runTime
.
constant
(),
mesh
,
IOobject
::
MUST_READ_IF_MODIFIED
,
IOobject
::
NO_WRITE
)
);
ignition
ign
(
combustionProperties
,
runTime
,
mesh
);
applications/solvers/combustion/PDRFoam/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 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.
\*---------------------------------------------------------------------------*/
{
solve
(
betav
*
fvm
::
ddt
(
rho
)
+
fvc
::
div
(
phi
));
}
// ************************************************************************* //
applications/solvers/combustion/PDRFoam/setDeltaT.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
setDeltaT
Description
Reset the timestep to maintain a constant maximum courant Number.
Reduction of time-step is immediate but increase is damped to avoid
unstable oscillations.
\*---------------------------------------------------------------------------*/
if
(
adjustTimeStep
)
{
scalar
maxDeltaTFact
=
maxCo
/
(
CoNum
+
StCoNum
+
SMALL
);
scalar
deltaTFact
=
min
(
min
(
maxDeltaTFact
,
1
.
0
+
0
.
1
*
maxDeltaTFact
),
1
.
2
);
runTime
.
setDeltaT
(
min
(
deltaTFact
*
runTime
.
deltaTValue
(),
maxDeltaT
)
);
Info
<<
"deltaT = "
<<
runTime
.
deltaTValue
()
<<
endl
;
}
// ************************************************************************* //
applications/solvers/combustion/XiFoam/EaEqn.H
0 → 100644
View file @
ea17556c
{
volScalarField
&
hea
=
thermo
.
he
();
fvScalarMatrix
EaEqn
(
fvm
::
ddt
(
rho
,
hea
)
+
mvConvection
->
fvmDiv
(
phi
,
hea
)
+
fvc
::
ddt
(
rho
,
K
)
+
fvc
::
div
(
phi
,
K
)
+
(
hea
.
name
()
==
"ea"
?
fvc
::
div
(
fvc
::
absolute
(
phi
/
fvc
::
interpolate
(
rho
),
U
),
p
,
"div(phiv,p)"
)
:
-
dpdt
)
-
fvm
::
laplacian
(
turbulence
->
alphaEff
(),
hea
)
+
fvOptions
(
rho
,
hea
)
);
EaEqn
.
relax
();
fvOptions
.
constrain
(
EaEqn
);
EaEqn
.
solve
();
fvOptions
.
correct
(
hea
);
thermo
.
correct
();
}
applications/solvers/combustion/XiFoam/EauEqn.H
0 → 100644
View file @
ea17556c
if
(
ign
.
ignited
())
{
volScalarField
&
heau
=
thermo
.
heu
();
fvScalarMatrix
heauEqn
(
fvm
::
ddt
(
rho
,
heau
)
+
mvConvection
->
fvmDiv
(
phi
,
heau
)
+
(
fvc
::
ddt
(
rho
,
K
)
+
fvc
::
div
(
phi
,
K
))
*
rho
/
thermo
.
rhou
()
+
(
heau
.
name
()
==
"eau"
?
fvc
::
div
(
fvc
::
absolute
(
phi
/
fvc
::
interpolate
(
rho
),
U
),
p
,
"div(phiv,p)"
)
*
rho
/
thermo
.
rhou
()
:
-
dpdt
*
rho
/
thermo
.
rhou
()
)
-
fvm
::
laplacian
(
turbulence
->
alphaEff
(),
heau
)
// These terms cannot be used in partially-premixed combustion due to
// the resultant inconsistency between ft and heau transport.
// A possible solution would be to solve for ftu as well as ft.
//- fvm::div(muEff*fvc::grad(b)/(b + 0.001), heau)
//+ fvm::Sp(fvc::div(muEff*fvc::grad(b)/(b + 0.001)), heau)
==
fvOptions
(
rho
,
heau
)
);
fvOptions
.
constrain
(
heauEqn
);
heauEqn
.
solve
();
fvOptions
.
correct
(
heau
);
}
applications/solvers/combustion/XiFoam/Make/files
0 → 100644
View file @
ea17556c
XiFoam.C
EXE = $(FOAM_APPBIN)/XiFoam
applications/solvers/combustion/XiFoam/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)/engine/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-lengine \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lreactionThermophysicalModels \
-lspecie \
-llaminarFlameSpeedModels
applications/solvers/combustion/XiFoam/UEqn.H
0 → 100644
View file @
ea17556c
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/combustion/XiFoam/XiDyMFoam/Make/files
0 → 100644
View file @
ea17556c
XiDyMFoam.C
EXE = $(FOAM_APPBIN)/XiDyMFoam
applications/solvers/combustion/XiFoam/XiDyMFoam/Make/options
0 → 100644
View file @
ea17556c
EXE_INC = \
-I.. \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/engine/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-ldynamicMesh \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-lsampling \
-lengine \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lreactionThermophysicalModels \
-lspecie \
-llaminarFlameSpeedModels
applications/solvers/combustion/XiFoam/XiDyMFoam/XiDyMFoam.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-2015 OpenFOAM Foundation
Copyright (C) 2015-2016 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
XiFoam
Group
grpCombustionSolvers grpMovingMeshSolvers
Description
Solver for compressible premixed/partially-premixed combustion with
turbulence modelling.
Combusting RANS code using the b-Xi two-equation model.
Xi may be obtained by either the solution of the Xi transport
equation or from an algebraic expression. Both approaches are
based on Gulder's flame speed correlation which has been shown
to be appropriate by comparison with the results from the
spectral model.
Strain effects are encorporated directly into the Xi equation
but not in the algebraic approximation. Further work need to be
done on this issue, particularly regarding the enhanced removal rate
caused by flame compression. Analysis using results of the spectral
model will be required.
For cases involving very lean Propane flames or other flames which are
very strain-sensitive, a transport equation for the laminar flame
speed is present. This equation is derived using heuristic arguments
involving the strain time scale and the strain-rate at extinction.
the transport velocity is the same as that for the Xi equation.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "psiuReactionThermo.H"
#include "turbulentFluidThermoModel.H"
#include "laminarFlameSpeed.H"
#include "ignition.H"
#include "Switch.H"
#include "pimpleControl.H"
#include "CorrectPhi.H"
#include "fvOptions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Solver for compressible premixed/partially-premixed combustion with"
" turbulence modelling."
);
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createControl.H"
#include "readCombustionProperties.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createFieldRefs.H"
#include "initContinuityErrs.H"
#include "createRhoUf.H"
#include "createControls.H"
#include "initContinuityErrs.H"
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
turbulence
->
validate
();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"
\n
Starting time loop
\n
"
<<
endl
;
while
(
runTime
.
run
())
{
#include "createTimeControls.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
()
&&
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
(
mesh
.
changing
()
&&
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 "ftEqn.H"
#include "bEqn.H"
#include "EauEqn.H"
#include "EaEqn.H"
if
(
!
ign
.
ignited
())
{
thermo
.
heu
()
==
thermo
.
he
();
}
// --- 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/XiFoam/XiDyMFoam/correctPhi.H
0 → 100644
View file @
ea17556c
CorrectPhi
(
U
,
phi
,
p
,
rho
,
psi
,
dimensionedScalar
(
"rAUf"
,
dimTime
,
1
),
divrhoU
,
pimple
);
applications/solvers/combustion/XiFoam/XiDyMFoam/createControls.H
0 → 100644
View file @
ea17556c
#include "createTimeControls.H"
bool
correctPhi
(
pimple
.
dict
().
getOrDefault
(
"correctPhi"
,
true
)
);
bool
checkMeshCourantNo
(
pimple
.
dict
().
getOrDefault
(
"checkMeshCourantNo"
,
false
)
);
applications/solvers/combustion/XiFoam/XiDyMFoam/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
.
transonic
())
{
surfaceScalarField
phid
(
"phid"
,
fvc
::
interpolate
(
psi
)
*
(
(
fvc
::
interpolate
(
HbyA
)
&
mesh
.
Sf
())
+
rhorAUf
*
fvc
::
ddtCorr
(
rho
,
U
,
phi
)
/
fvc
::
interpolate
(
rho
)
)
);
fvc
::
makeRelative
(
phid
,
psi
,
U
);
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
::
interpolate
(
rho
*
HbyA
)
&
mesh
.
Sf
())
+
rhorAUf
*
fvc
::
ddtCorr
(
rho
,
U
,
rhoUf
)
)
);
fvc
::
makeRelative
(
phiHbyA
,
rho
,
U
);
MRF
.
makeRelative
(
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"
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
));
}
if
(
thermo
.
dpdt
())
{
dpdt
=
fvc
::
ddt
(
p
);
if
(
mesh
.
moving
())
{
dpdt
-=
fvc
::
div
(
fvc
::
meshPhi
(
rho
,
U
),
p
);
}
}
applications/solvers/combustion/XiFoam/XiDyMFoam/readControls.H
0 → 100644
View file @
ea17556c
#include "readTimeControls.H"
correctPhi
=
pimple
.
dict
().
getOrDefault
(
"correctPhi"
,
true
);
checkMeshCourantNo
=
pimple
.
dict
().
getOrDefault
(
"checkMeshCourantNo"
,
false
);
applications/solvers/combustion/XiFoam/XiEngineFoam/Make/files
0 → 100644
View file @
ea17556c
XiEngineFoam.C
EXE = $(FOAM_APPBIN)/XiEngineFoam
applications/solvers/combustion/XiFoam/XiEngineFoam/Make/options
0 → 100644
View file @
ea17556c
EXE_INC = \
-I.. \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/engine/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-lengine \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lreactionThermophysicalModels \
-lspecie \
-llaminarFlameSpeedModels
applications/solvers/combustion/XiFoam/XiEngineFoam/UEqn.H
0 → 100644
View file @
ea17556c
fvVectorMatrix
UEqn
(
fvm
::
ddt
(
rho
,
U
)
+
fvm
::
div
(
phi
,
U
)
+
turbulence
->
divDevRhoReff
(
U
)
==
fvOptions
(
rho
,
U
)
);
if
(
pimple
.
momentumPredictor
())
{
solve
(
UEqn
==
-
fvc
::
grad
(
p
));
fvOptions
.
correct
(
U
);
K
=
0
.
5
*
magSqr
(
U
);
}
Prev
1
2
3
4
5
6
7
8
9
10
…
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