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
1004 additions
and
0 deletions
+1004
-0
applications/solvers/incompressible/simpleFoam/overSimpleFoam/createFields.H
...s/incompressible/simpleFoam/overSimpleFoam/createFields.H
+45
-0
applications/solvers/incompressible/simpleFoam/overSimpleFoam/createOversetFields.H
...pressible/simpleFoam/overSimpleFoam/createOversetFields.H
+30
-0
applications/solvers/incompressible/simpleFoam/overSimpleFoam/createUpdatedDynamicFvMesh.H
...le/simpleFoam/overSimpleFoam/createUpdatedDynamicFvMesh.H
+22
-0
applications/solvers/incompressible/simpleFoam/overSimpleFoam/overSimpleFoam.C
...incompressible/simpleFoam/overSimpleFoam/overSimpleFoam.C
+132
-0
applications/solvers/incompressible/simpleFoam/overSimpleFoam/pEqn.H
...s/solvers/incompressible/simpleFoam/overSimpleFoam/pEqn.H
+57
-0
applications/solvers/incompressible/simpleFoam/pEqn.H
applications/solvers/incompressible/simpleFoam/pEqn.H
+50
-0
applications/solvers/incompressible/simpleFoam/porousSimpleFoam/Make/files
...ers/incompressible/simpleFoam/porousSimpleFoam/Make/files
+3
-0
applications/solvers/incompressible/simpleFoam/porousSimpleFoam/Make/options
...s/incompressible/simpleFoam/porousSimpleFoam/Make/options
+18
-0
applications/solvers/incompressible/simpleFoam/porousSimpleFoam/UEqn.H
...solvers/incompressible/simpleFoam/porousSimpleFoam/UEqn.H
+55
-0
applications/solvers/incompressible/simpleFoam/porousSimpleFoam/createPorousZones.H
...pressible/simpleFoam/porousSimpleFoam/createPorousZones.H
+1
-0
applications/solvers/incompressible/simpleFoam/porousSimpleFoam/pEqn.H
...solvers/incompressible/simpleFoam/porousSimpleFoam/pEqn.H
+59
-0
applications/solvers/incompressible/simpleFoam/porousSimpleFoam/porousSimpleFoam.C
...mpressible/simpleFoam/porousSimpleFoam/porousSimpleFoam.C
+100
-0
applications/solvers/incompressible/simpleFoam/porousSimpleFoam/setPorosityTreatment.H
...ssible/simpleFoam/porousSimpleFoam/setPorosityTreatment.H
+19
-0
applications/solvers/incompressible/simpleFoam/simpleFoam.C
applications/solvers/incompressible/simpleFoam/simpleFoam.C
+121
-0
applications/solvers/lagrangian/DPMFoam/Allwclean
applications/solvers/lagrangian/DPMFoam/Allwclean
+12
-0
applications/solvers/lagrangian/DPMFoam/Allwmake
applications/solvers/lagrangian/DPMFoam/Allwmake
+13
-0
applications/solvers/lagrangian/DPMFoam/CourantNo.H
applications/solvers/lagrangian/DPMFoam/CourantNo.H
+53
-0
applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/DPMDyMFoam.C
...ations/solvers/lagrangian/DPMFoam/DPMDyMFoam/DPMDyMFoam.C
+168
-0
applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/MPPICDyMFoam.C
...lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/MPPICDyMFoam.C
+43
-0
applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/Make/files
...ers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/Make/files
+3
-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/incompressible/simpleFoam/overSimpleFoam/createFields.H
0 → 100644
View file @
ea17556c
Info
<<
"Reading field p
\n
"
<<
endl
;
volScalarField
p
(
IOobject
(
"p"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
Info
<<
"Reading field U
\n
"
<<
endl
;
volVectorField
U
(
IOobject
(
"U"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
#include "createPhi.H"
label
pRefCell
=
0
;
scalar
pRefValue
=
0
.
0
;
setRefCell
(
p
,
simple
.
dict
(),
pRefCell
,
pRefValue
);
mesh
.
setFluxRequired
(
p
.
name
());
singlePhaseTransportModel
laminarTransport
(
U
,
phi
);
autoPtr
<
incompressible
::
turbulenceModel
>
turbulence
(
incompressible
::
turbulenceModel
::
New
(
U
,
phi
,
laminarTransport
)
);
#include "createMRF.H"
applications/solvers/incompressible/simpleFoam/overSimpleFoam/createOversetFields.H
0 → 100644
View file @
ea17556c
//- Overset specific
// Add solver-specific interpolations
{
wordHashSet
&
nonInt
=
const_cast
<
wordHashSet
&>
(
Stencil
::
New
(
mesh
).
nonInterpolatedFields
());
nonInt
.
insert
(
"HbyA"
);
nonInt
.
insert
(
"grad(p)"
);
nonInt
.
insert
(
"surfaceIntegrate(phi)"
);
nonInt
.
insert
(
"surfaceIntegrate(phiHbyA)"
);
nonInt
.
insert
(
"cellMask"
);
nonInt
.
insert
(
"cellDisplacement"
);
nonInt
.
insert
(
"interpolatedCells"
);
nonInt
.
insert
(
"cellInterpolationWeight"
);
}
// Mask field for zeroing out contributions on hole cells
#include "createCellMask.H"
#include "createInterpolatedCells.H"
bool
adjustFringe
(
simple
.
dict
().
getOrDefault
(
"oversetAdjustPhi"
,
false
)
);
bool
massFluxInterpolation
(
simple
.
dict
().
getOrDefault
(
"massFluxInterpolation"
,
false
)
);
applications/solvers/incompressible/simpleFoam/overSimpleFoam/createUpdatedDynamicFvMesh.H
0 → 100644
View file @
ea17556c
Info
<<
"Create dynamic mesh for time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
autoPtr
<
dynamicFvMesh
>
meshPtr
(
dynamicFvMesh
::
New
(
IOobject
(
polyMesh
::
defaultRegion
,
runTime
.
timeName
(),
runTime
,
IOobject
::
MUST_READ
)
)
);
dynamicFvMesh
&
mesh
=
meshPtr
();
// Calculate initial mesh-to-mesh mapping. Note that this should be
// done under the hood, e.g. as a MeshObject
mesh
.
update
();
applications/solvers/incompressible/simpleFoam/overSimpleFoam/overSimpleFoam.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-2014 OpenFOAM Foundation
Copyright (C) 2016-2017 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
overSimpleFoam
Group
grpIncompressibleSolvers
Description
Steady-state solver for incompressible flows with turbulence modelling.
\heading Solver details
The solver uses the SIMPLE algorithm to solve the continuity equation:
\f[
\div \vec{U} = 0
\f]
and momentum equation:
\f[
\div \left( \vec{U} \vec{U} \right) - \div \gvec{R}
= - \grad p + \vec{S}_U
\f]
Where:
\vartable
\vec{U} | Velocity
p | Pressure
\vec{R} | Stress tensor
\vec{S}_U | Momentum source
\endvartable
\heading Required fields
\plaintable
U | Velocity [m/s]
p | Kinematic pressure, p/rho [m2/s2]
\<turbulence fields\> | As required by user selection
\endplaintable
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "simpleControl.H"
#include "fvOptions.H"
#include "dynamicFvMesh.H"
#include "cellCellStencilObject.H"
#include "localMin.H"
#include "interpolationCellPoint.H"
#include "fvMeshSubset.H"
#include "transform.H"
#include "oversetAdjustPhi.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Steady-state solver for incompressible, turbulent flow"
);
#define CREATE_MESH createUpdatedDynamicFvMesh.H
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createUpdatedDynamicFvMesh.H"
#include "createControl.H"
#include "createFields.H"
#include "createOversetFields.H"
#include "createFvOptions.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 "pEqn.H"
}
laminarTransport
.
correct
();
turbulence
->
correct
();
runTime
.
write
();
runTime
.
printExecutionTime
(
Info
);
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
applications/solvers/incompressible/simpleFoam/overSimpleFoam/pEqn.H
0 → 100644
View file @
ea17556c
{
surfaceScalarField
faceMask
(
localMin
<
scalar
>
(
mesh
).
interpolate
(
cellMask
));
volScalarField
rAU
(
1
.
0
/
UEqn
.
A
());
surfaceScalarField
rAUf
(
"rAUf"
,
faceMask
*
fvc
::
interpolate
(
rAU
));
volVectorField
HbyA
(
"HbyA"
,
U
);
HbyA
=
constrainHbyA
(
cellMask
*
rAU
*
UEqn
.
H
(),
U
,
p
);
//mesh.interpolate(HbyA);
if
(
massFluxInterpolation
)
{
#include "interpolatedFaces.H"
}
tUEqn
.
clear
();
surfaceScalarField
phiHbyA
(
"phiHbyA"
,
fvc
::
flux
(
HbyA
));
adjustPhi
(
phiHbyA
,
U
,
p
);
if
(
adjustFringe
)
{
oversetAdjustPhi
(
phiHbyA
,
U
);
}
// Non-orthogonal pressure corrector loop
while
(
simple
.
correctNonOrthogonal
())
{
fvScalarMatrix
pEqn
(
fvm
::
laplacian
(
rAUf
,
p
)
==
fvc
::
div
(
phiHbyA
)
);
pEqn
.
setReference
(
pRefCell
,
pRefValue
);
pEqn
.
solve
();
if
(
simple
.
finalNonOrthogonalIter
())
{
phi
=
phiHbyA
-
pEqn
.
flux
();
}
}
#include "continuityErrs.H"
// Explicitly relax pressure for momentum corrector
p
.
relax
();
// Momentum corrector
volVectorField
gradP
(
fvc
::
grad
(
p
));
//mesh.interpolate(gradP);
U
=
HbyA
-
rAU
*
cellMask
*
gradP
;
U
.
correctBoundaryConditions
();
fvOptions
.
correct
(
U
);
}
applications/solvers/incompressible/simpleFoam/pEqn.H
0 → 100644
View file @
ea17556c
{
volScalarField
rAU
(
1
.
0
/
UEqn
.
A
());
volVectorField
HbyA
(
constrainHbyA
(
rAU
*
UEqn
.
H
(),
U
,
p
));
surfaceScalarField
phiHbyA
(
"phiHbyA"
,
fvc
::
flux
(
HbyA
));
MRF
.
makeRelative
(
phiHbyA
);
adjustPhi
(
phiHbyA
,
U
,
p
);
tmp
<
volScalarField
>
rAtU
(
rAU
);
if
(
simple
.
consistent
())
{
rAtU
=
1
.
0
/
(
1
.
0
/
rAU
-
UEqn
.
H1
());
phiHbyA
+=
fvc
::
interpolate
(
rAtU
()
-
rAU
)
*
fvc
::
snGrad
(
p
)
*
mesh
.
magSf
();
HbyA
-=
(
rAU
-
rAtU
())
*
fvc
::
grad
(
p
);
}
tUEqn
.
clear
();
// Update the pressure BCs to ensure flux consistency
constrainPressure
(
p
,
U
,
phiHbyA
,
rAtU
(),
MRF
);
// Non-orthogonal pressure corrector loop
while
(
simple
.
correctNonOrthogonal
())
{
fvScalarMatrix
pEqn
(
fvm
::
laplacian
(
rAtU
(),
p
)
==
fvc
::
div
(
phiHbyA
)
);
pEqn
.
setReference
(
pRefCell
,
pRefValue
);
pEqn
.
solve
();
if
(
simple
.
finalNonOrthogonalIter
())
{
phi
=
phiHbyA
-
pEqn
.
flux
();
}
}
#include "continuityErrs.H"
// Explicitly relax pressure for momentum corrector
p
.
relax
();
// Momentum corrector
U
=
HbyA
-
rAtU
()
*
fvc
::
grad
(
p
);
U
.
correctBoundaryConditions
();
fvOptions
.
correct
(
U
);
}
applications/solvers/incompressible/simpleFoam/porousSimpleFoam/Make/files
0 → 100644
View file @
ea17556c
porousSimpleFoam.C
EXE = $(FOAM_APPBIN)/porousSimpleFoam
applications/solvers/incompressible/simpleFoam/porousSimpleFoam/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)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels
applications/solvers/incompressible/simpleFoam/porousSimpleFoam/UEqn.H
0 → 100644
View file @
ea17556c
// Construct the Momentum equation
MRF
.
correctBoundaryVelocity
(
U
);
tmp
<
fvVectorMatrix
>
tUEqn
(
fvm
::
div
(
phi
,
U
)
+
MRF
.
DDt
(
U
)
+
turbulence
->
divDevReff
(
U
)
==
fvOptions
(
U
)
);
fvVectorMatrix
&
UEqn
=
tUEqn
.
ref
();
UEqn
.
relax
();
// 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/incompressible/simpleFoam/porousSimpleFoam/createPorousZones.H
0 → 100644
View file @
ea17556c
IOporosityModelList
pZones
(
mesh
);
applications/solvers/incompressible/simpleFoam/porousSimpleFoam/pEqn.H
0 → 100644
View file @
ea17556c
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
();
surfaceScalarField
phiHbyA
(
"phiHbyA"
,
fvc
::
flux
(
HbyA
));
MRF
.
makeRelative
(
phiHbyA
);
adjustPhi
(
phiHbyA
,
U
,
p
);
while
(
simple
.
correctNonOrthogonal
())
{
tmp
<
fvScalarMatrix
>
tpEqn
;
if
(
pressureImplicitPorosity
)
{
tpEqn
=
(
fvm
::
laplacian
(
trTU
(),
p
)
==
fvc
::
div
(
phiHbyA
));
}
else
{
tpEqn
=
(
fvm
::
laplacian
(
trAU
(),
p
)
==
fvc
::
div
(
phiHbyA
));
}
fvScalarMatrix
pEqn
=
tpEqn
.
ref
();
pEqn
.
setReference
(
pRefCell
,
pRefValue
);
pEqn
.
solve
();
if
(
simple
.
finalNonOrthogonalIter
())
{
phi
=
phiHbyA
-
pEqn
.
flux
();
}
}
#include "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
);
applications/solvers/incompressible/simpleFoam/porousSimpleFoam/porousSimpleFoam.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
porousSimpleFoam
Group
grpIncompressibleSolvers
Description
Steady-state solver for incompressible, turbulent flow with
implicit or explicit porosity treatment and support for multiple reference
frames (MRF).
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "simpleControl.H"
#include "IOporosityModelList.H"
#include "fvOptions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Steady-state solver for incompressible, turbulent flow with"
"implicit/explicit porosity treatment
\n
"
"With MRF support."
);
#define CREATE_FIELDS_2 createPorousZones.H
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createFields.H"
#include "createPorousZones.H"
#include "setPorosityTreatment.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 "pEqn.H"
}
laminarTransport
.
correct
();
turbulence
->
correct
();
runTime
.
write
();
runTime
.
printExecutionTime
(
Info
);
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
applications/solvers/incompressible/simpleFoam/porousSimpleFoam/setPorosityTreatment.H
0 → 100644
View file @
ea17556c
bool
pressureImplicitPorosity
(
false
);
// nUCorrectors used for pressureImplicitPorosity
int
nUCorr
=
0
;
if
(
pZones
.
active
())
{
// nUCorrectors for pressureImplicitPorosity
nUCorr
=
simple
.
dict
().
getOrDefault
<
int
>
(
"nUCorrectors"
,
0
);
if
(
nUCorr
>
0
)
{
pressureImplicitPorosity
=
true
;
Info
<<
"Using pressure implicit porosity"
<<
endl
;
}
else
{
Info
<<
"Using pressure explicit porosity"
<<
endl
;
}
}
applications/solvers/incompressible/simpleFoam/simpleFoam.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
simpleFoam
Group
grpIncompressibleSolvers
Description
Steady-state solver for incompressible, turbulent flows.
\heading Solver details
The solver uses the SIMPLE algorithm to solve the continuity equation:
\f[
\div \vec{U} = 0
\f]
and momentum equation:
\f[
\div \left( \vec{U} \vec{U} \right) - \div \gvec{R}
= - \grad p + \vec{S}_U
\f]
Where:
\vartable
\vec{U} | Velocity
p | Pressure
\vec{R} | Stress tensor
\vec{S}_U | Momentum source
\endvartable
\heading Required fields
\plaintable
U | Velocity [m/s]
p | Kinematic pressure, p/rho [m2/s2]
\<turbulence fields\> | As required by user selection
\endplaintable
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "simpleControl.H"
#include "fvOptions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Steady-state solver for incompressible, turbulent flows."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createFields.H"
#include "initContinuityErrs.H"
turbulence
->
validate
();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"
\n
Starting time loop
\n
"
<<
endl
;
while
(
simple
.
loop
())
{
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
// --- Pressure-velocity SIMPLE corrector
{
#include "UEqn.H"
#include "pEqn.H"
}
laminarTransport
.
correct
();
turbulence
->
correct
();
runTime
.
write
();
runTime
.
printExecutionTime
(
Info
);
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
applications/solvers/lagrangian/DPMFoam/Allwclean
0 → 100644
View file @
ea17556c
#!/bin/sh
cd
"
${
0
%/*
}
"
||
exit
# Run from this directory
#------------------------------------------------------------------------------
wclean libso DPMTurbulenceModels
wclean
wclean MPPICFoam
wclean DPMDyMFoam
wclean DPMDyMFoam/MPPICDyMFoam
#------------------------------------------------------------------------------
applications/solvers/lagrangian/DPMFoam/Allwmake
0 → 100644
View file @
ea17556c
#!/bin/sh
cd
"
${
0
%/*
}
"
||
exit
# Run from this directory
.
${
WM_PROJECT_DIR
:?
}
/wmake/scripts/AllwmakeParseArguments
#------------------------------------------------------------------------------
wmake
$targetType
DPMTurbulenceModels
wmake
$targetType
wmake
$targetType
MPPICFoam
wmake
$targetType
DPMDyMFoam
wmake
$targetType
DPMDyMFoam/MPPICDyMFoam
#------------------------------------------------------------------------------
applications/solvers/lagrangian/DPMFoam/CourantNo.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) 2013-2016 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
CourantNo
Description
Calculates and outputs the mean and maximum Courant Numbers.
\*---------------------------------------------------------------------------*/
scalar
CoNum
=
0
.
0
;
scalar
meanCoNum
=
0
.
0
;
if
(
mesh
.
nInternalFaces
())
{
scalarField
sumPhi
(
fvc
::
surfaceSum
(
mag
(
phic
))().
primitiveField
()
);
CoNum
=
0
.
5
*
gMax
(
sumPhi
/
mesh
.
V
().
field
())
*
runTime
.
deltaTValue
();
meanCoNum
=
0
.
5
*
(
gSum
(
sumPhi
)
/
gSum
(
mesh
.
V
().
field
()))
*
runTime
.
deltaTValue
();
}
Info
<<
"Courant Number mean: "
<<
meanCoNum
<<
" max: "
<<
CoNum
<<
endl
;
// ************************************************************************* //
applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/DPMDyMFoam.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) 2017 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/>.
Application
DPMDyMFoam
Description
Transient solver for the coupled transport of a single kinematic particle
cloud including the effect of the volume fraction of particles on the
continuous phase, with optional mesh motion and mesh topology changes.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "singlePhaseTransportModel.H"
#include "DPMIncompressibleTurbulenceModel.H"
#include "pimpleControl.H"
#include "CorrectPhi.H"
#ifdef MPPIC
#include "basicKinematicCloud.H"
#define basicKinematicTypeCloud basicKinematicCloud
#else
#include "basicKinematicCollidingCloud.H"
#define basicKinematicTypeCloud basicKinematicCollidingCloud
#endif
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Transient solver for the coupled transport of a"
" single kinematic particle cloud including the effect"
" of the volume fraction of particles on the continuous phase.
\n
"
"With optional mesh motion and mesh topology changes."
);
argList
::
addOption
(
"cloudName"
,
"name"
,
"specify alternative cloud name. default is 'kinematicCloud'"
);
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createDyMControls.H"
#include "createFields.H"
#include "createUcf.H"
#include "initContinuityErrs.H"
Info
<<
"
\n
Starting time loop
\n
"
<<
endl
;
while
(
runTime
.
run
())
{
#include "readDyMControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
++
runTime
;
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
// Store the particle positions
kinematicCloud
.
storeGlobalPositions
();
mesh
.
update
();
// Calculate absolute flux from the mapped surface velocity
phic
=
mesh
.
Sf
()
&
Ucf
;
if
(
mesh
.
changing
()
&&
correctPhi
)
{
#include "correctPhic.H"
}
// Make the flux relative to the mesh motion
fvc
::
makeRelative
(
phic
,
Uc
);
if
(
mesh
.
changing
()
&&
checkMeshCourantNo
)
{
#include "meshCourantNo.H"
}
continuousPhaseTransport
.
correct
();
muc
=
rhoc
*
continuousPhaseTransport
.
nu
();
kinematicCloud
.
evolve
();
// Update continuous phase volume fraction field
alphac
=
max
(
1
.
0
-
kinematicCloud
.
theta
(),
alphacMin
);
alphac
.
correctBoundaryConditions
();
alphacf
=
fvc
::
interpolate
(
alphac
);
alphaPhic
=
alphacf
*
phic
;
fvVectorMatrix
cloudSU
(
kinematicCloud
.
SU
(
Uc
));
volVectorField
cloudVolSUSu
(
IOobject
(
"cloudVolSUSu"
,
runTime
.
timeName
(),
mesh
),
mesh
,
dimensionedVector
(
cloudSU
.
dimensions
()
/
dimVolume
,
Zero
),
zeroGradientFvPatchVectorField
::
typeName
);
cloudVolSUSu
.
primitiveFieldRef
()
=
-
cloudSU
.
source
()
/
mesh
.
V
();
cloudVolSUSu
.
correctBoundaryConditions
();
cloudSU
.
source
()
=
Zero
;
// --- Pressure-velocity PIMPLE corrector loop
while
(
pimple
.
loop
())
{
#include "UcEqn.H"
// --- PISO loop
while
(
pimple
.
correct
())
{
#include "pEqn.H"
}
if
(
pimple
.
turbCorr
())
{
continuousPhaseTurbulence
->
correct
();
}
}
runTime
.
write
();
runTime
.
printExecutionTime
(
Info
);
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/MPPICDyMFoam.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) 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
MPPICDyMFoam
Description
Transient solver for the coupled transport of a single kinematic particle
cloud including the effect of the volume fraction of particles on the
continuous phase. Multi-Phase Particle In Cell (MPPIC) modeling is used to
represent collisions without resolving particle-particle interactions,
with optional mesh motion and mesh topology changes.
\*---------------------------------------------------------------------------*/
#define MPPIC
#include "DPMDyMFoam.C"
// ************************************************************************* //
applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/Make/files
0 → 100644
View file @
ea17556c
MPPICDyMFoam.C
EXE = $(FOAM_APPBIN)/MPPICDyMFoam
Prev
1
…
24
25
26
27
28
29
30
31
32
…
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