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
1216 additions
and
0 deletions
+1216
-0
applications/solvers/lagrangian/DPMFoam/pEqn.H
applications/solvers/lagrangian/DPMFoam/pEqn.H
+50
-0
applications/solvers/lagrangian/coalChemistryFoam/EEqn.H
applications/solvers/lagrangian/coalChemistryFoam/EEqn.H
+41
-0
applications/solvers/lagrangian/coalChemistryFoam/Make/files
applications/solvers/lagrangian/coalChemistryFoam/Make/files
+3
-0
applications/solvers/lagrangian/coalChemistryFoam/Make/options
...cations/solvers/lagrangian/coalChemistryFoam/Make/options
+53
-0
applications/solvers/lagrangian/coalChemistryFoam/UEqn.H
applications/solvers/lagrangian/coalChemistryFoam/UEqn.H
+25
-0
applications/solvers/lagrangian/coalChemistryFoam/YEqn.H
applications/solvers/lagrangian/coalChemistryFoam/YEqn.H
+50
-0
applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C
.../solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C
+145
-0
applications/solvers/lagrangian/coalChemistryFoam/createClouds.H
...tions/solvers/lagrangian/coalChemistryFoam/createClouds.H
+19
-0
applications/solvers/lagrangian/coalChemistryFoam/createFieldRefs.H
...ns/solvers/lagrangian/coalChemistryFoam/createFieldRefs.H
+4
-0
applications/solvers/lagrangian/coalChemistryFoam/createFields.H
...tions/solvers/lagrangian/coalChemistryFoam/createFields.H
+135
-0
applications/solvers/lagrangian/coalChemistryFoam/pEqn.H
applications/solvers/lagrangian/coalChemistryFoam/pEqn.H
+93
-0
applications/solvers/lagrangian/coalChemistryFoam/rhoEqn.H
applications/solvers/lagrangian/coalChemistryFoam/rhoEqn.H
+49
-0
applications/solvers/lagrangian/coalChemistryFoam/setRDeltaT.H
...cations/solvers/lagrangian/coalChemistryFoam/setRDeltaT.H
+138
-0
applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/Make/files
...ers/lagrangian/icoUncoupledKinematicParcelFoam/Make/files
+3
-0
applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/Make/options
...s/lagrangian/icoUncoupledKinematicParcelFoam/Make/options
+39
-0
applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/createFields.H
...lagrangian/icoUncoupledKinematicParcelFoam/createFields.H
+111
-0
applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/createNonInertialFrameFields.H
...coupledKinematicParcelFoam/createNonInertialFrameFields.H
+106
-0
applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelDyMFoam/Make/files
...cParcelFoam/icoUncoupledKinematicParcelDyMFoam/Make/files
+3
-0
applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelDyMFoam/Make/options
...arcelFoam/icoUncoupledKinematicParcelDyMFoam/Make/options
+45
-0
applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelDyMFoam/icoUncoupledKinematicParcelDyMFoam.C
...nematicParcelDyMFoam/icoUncoupledKinematicParcelDyMFoam.C
+104
-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/lagrangian/DPMFoam/pEqn.H
0 → 100644
View file @
ea17556c
{
volVectorField
HbyA
(
constrainHbyA
(
rAUc
*
UcEqn
.
H
(),
Uc
,
p
));
surfaceScalarField
phiHbyA
(
"phiHbyA"
,
(
fvc
::
flux
(
HbyA
)
+
alphacf
*
rAUcf
*
fvc
::
ddtCorr
(
Uc
,
phic
)
)
);
if
(
p
.
needReference
())
{
adjustPhi
(
phiHbyA
,
Uc
,
p
);
}
phiHbyA
+=
phicForces
;
// Update the pressure BCs to ensure flux consistency
constrainPressure
(
p
,
Uc
,
phiHbyA
,
rAUcf
);
// Non-orthogonal pressure corrector loop
while
(
pimple
.
correctNonOrthogonal
())
{
fvScalarMatrix
pEqn
(
fvm
::
laplacian
(
alphacf
*
rAUcf
,
p
)
==
fvc
::
ddt
(
alphac
)
+
fvc
::
div
(
alphacf
*
phiHbyA
)
);
pEqn
.
setReference
(
pRefCell
,
pRefValue
);
pEqn
.
solve
(
mesh
.
solver
(
p
.
select
(
pimple
.
finalInnerIter
())));
if
(
pimple
.
finalNonOrthogonalIter
())
{
phic
=
phiHbyA
-
pEqn
.
flux
()
/
alphacf
;
p
.
relax
();
Uc
=
HbyA
+
rAUc
*
fvc
::
reconstruct
((
phicForces
-
pEqn
.
flux
()
/
alphacf
)
/
rAUcf
);
Uc
.
correctBoundaryConditions
();
}
}
}
#include "continuityErrs.H"
applications/solvers/lagrangian/coalChemistryFoam/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
)
==
rho
*
(
U
&
g
)
+
Qdot
+
coalParcels
.
Sh
(
he
)
+
limestoneParcels
.
Sh
(
he
)
+
radiation
->
Sh
(
thermo
,
he
)
+
fvOptions
(
rho
,
he
)
);
EEqn
.
relax
();
fvOptions
.
constrain
(
EEqn
);
EEqn
.
solve
();
fvOptions
.
correct
(
he
);
thermo
.
correct
();
radiation
->
correct
();
Info
<<
"T gas min/max = "
<<
min
(
T
).
value
()
<<
", "
<<
max
(
T
).
value
()
<<
endl
;
}
applications/solvers/lagrangian/coalChemistryFoam/Make/files
0 → 100644
View file @
ea17556c
coalChemistryFoam.C
EXE = $(FOAM_APPBIN)/coalChemistryFoam
applications/solvers/lagrangian/coalChemistryFoam/Make/options
0 → 100644
View file @
ea17556c
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I${LIB_SRC}/meshTools/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude \
-I$(FOAM_SOLVERS)/combustion/reactingFoam \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-llagrangian \
-llagrangianIntermediate \
-llagrangianTurbulence \
-lcoalCombustion\
-lspecie \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lreactionThermophysicalModels \
-lthermophysicalProperties \
-lSLGThermo \
-lchemistryModel \
-lradiationModels \
-lregionModels \
-lsurfaceFilmModels \
-lODE \
-lcombustionModels \
-lsampling \
-lregionFaModels \
-lfiniteArea \
-lfaOptions
applications/solvers/lagrangian/coalChemistryFoam/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
)
==
rho
()
*
g
+
coalParcels
.
SU
(
U
)
+
limestoneParcels
.
SU
(
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/lagrangian/coalChemistryFoam/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)"
)
)
);
{
combustion
->
correct
();
Qdot
=
combustion
->
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
)
==
coalParcels
.
SYi
(
i
,
Yi
)
+
combustion
->
R
(
Yi
)
+
fvOptions
(
rho
,
Yi
)
);
YiEqn
.
relax
();
fvOptions
.
constrain
(
YiEqn
);
YiEqn
.
solve
(
mesh
.
solver
(
"Yi"
));
fvOptions
.
correct
(
Yi
);
Yi
.
max
(
0
.
0
);
Yt
+=
Yi
;
}
}
Y
[
inertIndex
]
=
scalar
(
1
)
-
Yt
;
Y
[
inertIndex
].
max
(
0
.
0
);
}
applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.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
coalChemistryFoam
Group
grpLagrangianSolvers
Description
Transient solver for compressible, turbulent flow, with coal and limestone
particle clouds, an energy source, and combustion.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "turbulentFluidThermoModel.H"
#include "basicThermoCloud.H"
#include "coalCloud.H"
#include "psiReactionThermo.H"
#include "CombustionModel.H"
#include "fvOptions.H"
#include "radiationModel.H"
#include "SLGThermo.H"
#include "pimpleControl.H"
#include "pressureControl.H"
#include "localEulerDdtScheme.H"
#include "fvcSmooth.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Transient solver for compressible, turbulent flow"
" with coal and limestone clouds, energy sources and combustion."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createTimeControls.H"
#include "createFields.H"
#include "createFieldRefs.H"
#include "initContinuityErrs.H"
turbulence
->
validate
();
if
(
!
LTS
)
{
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"
\n
Starting time loop
\n
"
<<
endl
;
while
(
runTime
.
run
())
{
#include "readTimeControls.H"
if
(
LTS
)
{
#include "setRDeltaT.H"
}
else
{
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
}
++
runTime
;
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
rhoEffLagrangian
=
coalParcels
.
rhoEff
()
+
limestoneParcels
.
rhoEff
();
pDyn
=
0
.
5
*
rho
*
magSqr
(
U
);
coalParcels
.
evolve
();
limestoneParcels
.
evolve
();
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
while
(
pimple
.
loop
())
{
#include "UEqn.H"
#include "YEqn.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/lagrangian/coalChemistryFoam/createClouds.H
0 → 100644
View file @
ea17556c
Info
<<
"
\n
Constructing coal cloud"
<<
endl
;
coalCloud
coalParcels
(
"coalCloud1"
,
rho
,
U
,
g
,
slgThermo
);
Info
<<
"
\n
Constructing limestone cloud"
<<
endl
;
basicThermoCloud
limestoneParcels
(
"limestoneCloud1"
,
rho
,
U
,
g
,
slgThermo
);
applications/solvers/lagrangian/coalChemistryFoam/createFieldRefs.H
0 → 100644
View file @
ea17556c
const
volScalarField
&
T
=
thermo
.
T
();
const
volScalarField
&
psi
=
thermo
.
psi
();
const
label
inertIndex
(
composition
.
species
()[
inertSpecie
]);
applications/solvers/lagrangian/coalChemistryFoam/createFields.H
0 → 100644
View file @
ea17556c
#include "createRDeltaT.H"
#include "readGravitationalAcceleration.H"
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
);
}
volScalarField
&
p
=
thermo
.
p
();
multivariateSurfaceInterpolationScheme
<
scalar
>::
fieldTable
fields
;
forAll
(
Y
,
i
)
{
fields
.
add
(
Y
[
i
]);
}
fields
.
add
(
thermo
.
he
());
volScalarField
rho
(
IOobject
(
"rho"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
thermo
.
rho
()
);
// lagrangian effective density field - used externally (optional)
volScalarField
rhoEffLagrangian
(
IOobject
(
"rhoEffLagrangian"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
mesh
,
dimensionedScalar
(
dimDensity
,
Zero
)
);
// dynamic pressure field - used externally (optional)
volScalarField
pDyn
(
IOobject
(
"pDyn"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
mesh
,
dimensionedScalar
(
dimPressure
,
Zero
)
);
Info
<<
"
\n
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
)
);
Info
<<
"Creating combustion model
\n
"
<<
endl
;
autoPtr
<
CombustionModel
<
psiReactionThermo
>>
combustion
(
CombustionModel
<
psiReactionThermo
>::
New
(
thermo
,
turbulence
())
);
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 "createClouds.H"
#include "createRadiationModel.H"
#include "createFvOptions.H"
applications/solvers/lagrangian/coalChemistryFoam/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
::
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
)
==
coalParcels
.
Srho
()
+
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
)
==
coalParcels
.
Srho
()
+
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
);
if
(
thermo
.
dpdt
())
{
dpdt
=
fvc
::
ddt
(
p
);
}
applications/solvers/lagrangian/coalChemistryFoam/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
)
==
coalParcels
.
Srho
(
rho
)
+
fvOptions
(
rho
)
);
rhoEqn
.
solve
();
fvOptions
.
correct
(
rho
);
}
// ************************************************************************* //
applications/solvers/lagrangian/coalChemistryFoam/setRDeltaT.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-2016 OpenFOAM Foundation
Copyright (C) 2020 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/>.
\*---------------------------------------------------------------------------*/
{
volScalarField
&
rDeltaT
=
trDeltaT
.
ref
();
const
dictionary
&
pimpleDict
=
pimple
.
dict
();
// Maximum flow Courant number
scalar
maxCo
(
pimpleDict
.
get
<
scalar
>
(
"maxCo"
));
// Maximum time scale
scalar
maxDeltaT
(
pimpleDict
.
getOrDefault
<
scalar
>
(
"maxDeltaT"
,
GREAT
));
// Smoothing parameter (0-1) when smoothing iterations > 0
scalar
rDeltaTSmoothingCoeff
(
pimpleDict
.
getOrDefault
<
scalar
>
(
"rDeltaTSmoothingCoeff"
,
0
.
1
)
);
// Damping coefficient (1-0)
scalar
rDeltaTDampingCoeff
(
pimpleDict
.
getOrDefault
<
scalar
>
(
"rDeltaTDampingCoeff"
,
0
.
2
)
);
// Maximum change in cell temperature per iteration
// (relative to previous value)
scalar
alphaTemp
(
pimpleDict
.
getOrDefault
(
"alphaTemp"
,
0
.
05
));
Info
<<
"Time scales min/max:"
<<
endl
;
// Cache old reciprocal time scale field
volScalarField
rDeltaT0
(
"rDeltaT0"
,
rDeltaT
);
// Flow time scale
{
rDeltaT
.
ref
()
=
(
fvc
::
surfaceSum
(
mag
(
phi
))()()
/
((
2
*
maxCo
)
*
mesh
.
V
()
*
rho
())
);
// Limit the largest time scale
rDeltaT
.
max
(
1
/
maxDeltaT
);
Info
<<
" Flow = "
<<
gMin
(
1
/
rDeltaT
.
primitiveField
())
<<
", "
<<
gMax
(
1
/
rDeltaT
.
primitiveField
())
<<
endl
;
}
// Reaction source time scale
{
volScalarField
::
Internal
rDeltaTT
(
mag
(
(
coalParcels
.
hsTrans
()
+
limestoneParcels
.
hsTrans
())
/
(
mesh
.
V
()
*
runTime
.
deltaT
())
+
Qdot
)
/
(
alphaTemp
*
rho
()
*
thermo
.
Cp
()()()
*
T
()
)
);
Info
<<
" Temperature = "
<<
gMin
(
1
/
(
rDeltaTT
.
field
()
+
VSMALL
))
<<
", "
<<
gMax
(
1
/
(
rDeltaTT
.
field
()
+
VSMALL
))
<<
endl
;
rDeltaT
.
ref
()
=
max
(
rDeltaT
(),
rDeltaTT
);
}
// Update tho boundary values of the reciprocal time-step
rDeltaT
.
correctBoundaryConditions
();
// Spatially smooth the time scale field
if
(
rDeltaTSmoothingCoeff
<
1
.
0
)
{
fvc
::
smooth
(
rDeltaT
,
rDeltaTSmoothingCoeff
);
}
// Limit rate of change of time scale
// - reduce as much as required
// - only increase at a fraction of old time scale
if
(
rDeltaTDampingCoeff
<
1
.
0
&&
runTime
.
timeIndex
()
>
runTime
.
startTimeIndex
()
+
1
)
{
rDeltaT
=
max
(
rDeltaT
,
(
scalar
(
1
)
-
rDeltaTDampingCoeff
)
*
rDeltaT0
);
}
Info
<<
" Overall = "
<<
gMin
(
1
/
rDeltaT
.
primitiveField
())
<<
", "
<<
gMax
(
1
/
rDeltaT
.
primitiveField
())
<<
endl
;
}
// ************************************************************************* //
applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/Make/files
0 → 100644
View file @
ea17556c
icoUncoupledKinematicParcelFoam.C
EXE = $(FOAM_APPBIN)/icoUncoupledKinematicParcelFoam
applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/Make/options
0 → 100644
View file @
ea17556c
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/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)/thermophysicalModels/radiation/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)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-llagrangian \
-llagrangianIntermediate \
-llagrangianTurbulence \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \
-lradiationModels \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \
-lregionModels \
-lsurfaceFilmModels \
-lregionFaModels \
-lfiniteArea \
-lfaOptions
applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/createFields.H
0 → 100644
View file @
ea17556c
#include "readGravitationalAcceleration.H"
Info
<<
"Reading field U
\n
"
<<
endl
;
volVectorField
U
(
IOobject
(
"U"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
#include "createPhi.H"
singlePhaseTransportModel
laminarTransport
(
U
,
phi
);
dimensionedScalar
rhoInfValue
(
"rhoInf"
,
dimDensity
,
laminarTransport
);
volScalarField
rhoInf
(
IOobject
(
"rho"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
mesh
,
rhoInfValue
);
autoPtr
<
incompressible
::
turbulenceModel
>
turbulence
(
incompressible
::
turbulenceModel
::
New
(
U
,
phi
,
laminarTransport
)
);
volScalarField
mu
(
IOobject
(
"mu"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
laminarTransport
.
nu
()
*
rhoInfValue
);
const
word
kinematicCloudName
(
args
.
getOrDefault
<
word
>
(
"cloud"
,
"kinematicCloud"
)
);
Info
<<
"Constructing kinematicCloud "
<<
kinematicCloudName
<<
endl
;
basicKinematicCollidingCloud
kinematicCloud
(
kinematicCloudName
,
rhoInf
,
U
,
mu
,
g
);
IOobject
Hheader
(
"H"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
);
autoPtr
<
volVectorField
>
HPtr
;
if
(
Hheader
.
typeHeaderOk
<
volVectorField
>
(
true
))
{
Info
<<
"
\n
Reading field H
\n
"
<<
endl
;
HPtr
.
reset
(
new
volVectorField
(
Hheader
,
mesh
));
}
IOobject
HdotGradHheader
(
"HdotGradH"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
);
autoPtr
<
volVectorField
>
HdotGradHPtr
;
if
(
HdotGradHheader
.
typeHeaderOk
<
volVectorField
>
(
true
))
{
Info
<<
"Reading field HdotGradH"
<<
endl
;
HdotGradHPtr
.
reset
(
new
volVectorField
(
HdotGradHheader
,
mesh
));
}
#include "createNonInertialFrameFields.H"
applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/createNonInertialFrameFields.H
0 → 100644
View file @
ea17556c
Info
<<
"Reading non-inertial frame fields"
<<
endl
;
IOobject
linearAccelerationHeader
(
"linearAcceleration"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
);
autoPtr
<
uniformDimensionedVectorField
>
linearAccelerationPtr
;
if
(
linearAccelerationHeader
.
typeHeaderOk
<
uniformDimensionedVectorField
>
(
true
)
)
{
Info
<<
" Reading "
<<
linearAccelerationHeader
.
name
()
<<
endl
;
linearAccelerationPtr
.
reset
(
new
uniformDimensionedVectorField
(
linearAccelerationHeader
)
);
}
IOobject
angularVelocityHeader
(
"angularVelocity"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
);
autoPtr
<
uniformDimensionedVectorField
>
angularVelocityPtr
;
if
(
angularVelocityHeader
.
typeHeaderOk
<
uniformDimensionedVectorField
>
(
true
))
{
Info
<<
" Reading "
<<
angularVelocityHeader
.
name
()
<<
endl
;
angularVelocityPtr
.
reset
(
new
uniformDimensionedVectorField
(
angularVelocityHeader
)
);
}
IOobject
angularAccelerationHeader
(
"angularAcceleration"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
);
autoPtr
<
uniformDimensionedVectorField
>
angularAccelerationPtr
;
if
(
angularAccelerationHeader
.
typeHeaderOk
<
uniformDimensionedVectorField
>
(
true
)
)
{
Info
<<
" Reading "
<<
angularAccelerationHeader
.
name
()
<<
endl
;
angularAccelerationPtr
.
reset
(
new
uniformDimensionedVectorField
(
angularAccelerationHeader
)
);
}
IOobject
centreOfRotationHeader
(
"centreOfRotation"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
);
autoPtr
<
uniformDimensionedVectorField
>
centreOfRotationPtr
;
if
(
centreOfRotationHeader
.
typeHeaderOk
<
uniformDimensionedVectorField
>
(
true
)
)
{
Info
<<
" Reading "
<<
centreOfRotationHeader
.
name
()
<<
endl
;
centreOfRotationPtr
.
reset
(
new
uniformDimensionedVectorField
(
centreOfRotationHeader
)
);
}
applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelDyMFoam/Make/files
0 → 100644
View file @
ea17556c
icoUncoupledKinematicParcelDyMFoam.C
EXE = $(FOAM_APPBIN)/icoUncoupledKinematicParcelDyMFoam
applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelDyMFoam/Make/options
0 → 100644
View file @
ea17556c
EXE_INC = \
-I.. \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/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)/thermophysicalModels/radiation/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)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-llagrangian \
-llagrangianIntermediate \
-llagrangianTurbulence \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \
-lradiationModels \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \
-lregionModels \
-lsurfaceFilmModels \
-ldynamicMesh \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-lregionFaModels \
-lfiniteArea \
-lfaOptions
applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelDyMFoam/icoUncoupledKinematicParcelDyMFoam.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
uncoupledKinematicParcelDyMFoam
Group
grpLagrangianSolvers grpMovingMeshSolvers
Description
Transient solver for the passive transport of a single kinematic
particle cloud, with optional mesh motion and mesh topology changes.
Uses a pre-calculated velocity field to evolve the cloud.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "basicKinematicCollidingCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Transient solver for the passive transport"
" of a single kinematic particle cloud.
\n
"
"With optional mesh motion and mesh topology changes."
);
argList
::
addOption
(
"cloud"
,
"name"
,
"specify alternative cloud name. default is 'kinematicCloud'"
);
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createControl.H"
#include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"
\n
Starting time loop
\n
"
<<
endl
;
while
(
runTime
.
loop
())
{
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
kinematicCloud
.
storeGlobalPositions
();
mesh
.
update
();
U
.
correctBoundaryConditions
();
Info
<<
"Evolving "
<<
kinematicCloud
.
name
()
<<
endl
;
laminarTransport
.
correct
();
mu
=
laminarTransport
.
nu
()
*
rhoInfValue
;
kinematicCloud
.
evolve
();
runTime
.
write
();
runTime
.
printExecutionTime
(
Info
);
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
Prev
1
…
26
27
28
29
30
31
32
33
34
…
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