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
649c29f9
Commit
649c29f9
authored
Aug 30, 2023
by
quant
Browse files
Initial commit
parent
89db0b5a
Changes
789
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
844 additions
and
0 deletions
+844
-0
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/Make/options
...vers/incompressible/simpleFoam/SRFSimpleFoam/Make/options
+18
-0
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/SRFSimpleFoam.C
...s/incompressible/simpleFoam/SRFSimpleFoam/SRFSimpleFoam.C
+97
-0
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/UrelEqn.H
...solvers/incompressible/simpleFoam/SRFSimpleFoam/UrelEqn.H
+22
-0
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/createFields.H
...rs/incompressible/simpleFoam/SRFSimpleFoam/createFields.H
+72
-0
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/pEqn.H
...ns/solvers/incompressible/simpleFoam/SRFSimpleFoam/pEqn.H
+51
-0
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/UEqn.H
...112/applications/solvers/incompressible/simpleFoam/UEqn.H
+24
-0
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/createFields.H
...ications/solvers/incompressible/simpleFoam/createFields.H
+46
-0
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/overSimpleFoam/Make/files
...lvers/incompressible/simpleFoam/overSimpleFoam/Make/files
+3
-0
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/overSimpleFoam/Make/options
...ers/incompressible/simpleFoam/overSimpleFoam/Make/options
+24
-0
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/overSimpleFoam/UEqn.H
...s/solvers/incompressible/simpleFoam/overSimpleFoam/UEqn.H
+24
-0
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/overSimpleFoam/continuityErrs.H
...incompressible/simpleFoam/overSimpleFoam/continuityErrs.H
+51
-0
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/overSimpleFoam/createFields.H
...s/incompressible/simpleFoam/overSimpleFoam/createFields.H
+45
-0
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/overSimpleFoam/createOversetFields.H
...pressible/simpleFoam/overSimpleFoam/createOversetFields.H
+30
-0
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/overSimpleFoam/createUpdatedDynamicFvMesh.H
...le/simpleFoam/overSimpleFoam/createUpdatedDynamicFvMesh.H
+22
-0
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/overSimpleFoam/overSimpleFoam.C
...incompressible/simpleFoam/overSimpleFoam/overSimpleFoam.C
+132
-0
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/overSimpleFoam/pEqn.H
...s/solvers/incompressible/simpleFoam/overSimpleFoam/pEqn.H
+57
-0
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/pEqn.H
...112/applications/solvers/incompressible/simpleFoam/pEqn.H
+50
-0
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/Make/files
...ers/incompressible/simpleFoam/porousSimpleFoam/Make/files
+3
-0
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/Make/options
...s/incompressible/simpleFoam/porousSimpleFoam/Make/options
+18
-0
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/UEqn.H
...solvers/incompressible/simpleFoam/porousSimpleFoam/UEqn.H
+55
-0
No files found.
Too many changes to show.
To preserve performance only
789 of 789+
files are displayed.
Plain diff
Email patch
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/Make/options
0 → 100644
View file @
649c29f9
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
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/SRFSimpleFoam.C
0 → 100644
View file @
649c29f9
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
SRFSimpleFoam
Group
grpIncompressibleSolvers
Description
Steady-state solver for incompressible, turbulent flow of non-Newtonian
fluids in a single rotating frame.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "SRFModel.H"
#include "simpleControl.H"
#include "fvOptions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Steady-state solver for incompressible, turbulent flow"
" of non-Newtonian fluids in a single rotating frame."
);
#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 "UrelEqn.H"
#include "pEqn.H"
}
U
=
Urel
+
SRF
->
U
();
laminarTransport
.
correct
();
turbulence
->
correct
();
runTime
.
write
();
runTime
.
printExecutionTime
(
Info
);
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/UrelEqn.H
0 → 100644
View file @
649c29f9
// Relative momentum predictor
tmp
<
fvVectorMatrix
>
tUrelEqn
(
fvm
::
div
(
phi
,
Urel
)
+
turbulence
->
divDevReff
(
Urel
)
+
SRF
->
Su
()
==
fvOptions
(
Urel
)
);
fvVectorMatrix
&
UrelEqn
=
tUrelEqn
.
ref
();
UrelEqn
.
relax
();
fvOptions
.
constrain
(
UrelEqn
);
if
(
simple
.
momentumPredictor
())
{
solve
(
UrelEqn
==
-
fvc
::
grad
(
p
));
fvOptions
.
correct
(
Urel
);
}
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/createFields.H
0 → 100644
View file @
649c29f9
Info
<<
"Reading field p
\n
"
<<
endl
;
volScalarField
p
(
IOobject
(
"p"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
Info
<<
"Reading field Urel
\n
"
<<
endl
;
volVectorField
Urel
(
IOobject
(
"Urel"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
Info
<<
"Reading/calculating face flux field phi
\n
"
<<
endl
;
surfaceScalarField
phi
(
IOobject
(
"phi"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
READ_IF_PRESENT
,
IOobject
::
AUTO_WRITE
),
linearInterpolate
(
Urel
)
&
mesh
.
Sf
()
);
label
pRefCell
=
0
;
scalar
pRefValue
=
0
.
0
;
setRefCell
(
p
,
simple
.
dict
(),
pRefCell
,
pRefValue
);
mesh
.
setFluxRequired
(
p
.
name
());
Info
<<
"Creating SRF model
\n
"
<<
endl
;
autoPtr
<
SRF
::
SRFModel
>
SRF
(
SRF
::
SRFModel
::
New
(
Urel
));
// Construct the absolute velocity
volVectorField
U
(
IOobject
(
"U"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
Urel
+
SRF
->
U
()
);
singlePhaseTransportModel
laminarTransport
(
U
,
phi
);
autoPtr
<
incompressible
::
turbulenceModel
>
turbulence
(
incompressible
::
turbulenceModel
::
New
(
U
,
phi
,
laminarTransport
)
);
#include "createFvOptions.H"
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/pEqn.H
0 → 100644
View file @
649c29f9
{
volScalarField
rAUrel
(
1
.
0
/
UrelEqn
.
A
());
volVectorField
HbyA
(
"HbyA"
,
Urel
);
HbyA
=
rAUrel
*
UrelEqn
.
H
();
surfaceScalarField
phiHbyA
(
"phiHbyA"
,
fvc
::
flux
(
HbyA
));
adjustPhi
(
phiHbyA
,
Urel
,
p
);
tmp
<
volScalarField
>
rAtUrel
(
rAUrel
);
if
(
simple
.
consistent
())
{
rAtUrel
=
1
.
0
/
(
1
.
0
/
rAUrel
-
UrelEqn
.
H1
());
phiHbyA
+=
fvc
::
interpolate
(
rAtUrel
()
-
rAUrel
)
*
fvc
::
snGrad
(
p
)
*
mesh
.
magSf
();
HbyA
-=
(
rAUrel
-
rAtUrel
())
*
fvc
::
grad
(
p
);
}
tUrelEqn
.
clear
();
// Update the pressure BCs to ensure flux consistency
constrainPressure
(
p
,
Urel
,
phiHbyA
,
rAtUrel
());
// Non-orthogonal pressure corrector loop
while
(
simple
.
correctNonOrthogonal
())
{
fvScalarMatrix
pEqn
(
fvm
::
laplacian
(
rAtUrel
(),
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
Urel
=
HbyA
-
rAtUrel
()
*
fvc
::
grad
(
p
);
Urel
.
correctBoundaryConditions
();
fvOptions
.
correct
(
Urel
);
}
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/UEqn.H
0 → 100644
View file @
649c29f9
// Momentum predictor
MRF
.
correctBoundaryVelocity
(
U
);
tmp
<
fvVectorMatrix
>
tUEqn
(
fvm
::
div
(
phi
,
U
)
+
MRF
.
DDt
(
U
)
+
turbulence
->
divDevReff
(
U
)
==
fvOptions
(
U
)
);
fvVectorMatrix
&
UEqn
=
tUEqn
.
ref
();
UEqn
.
relax
();
fvOptions
.
constrain
(
UEqn
);
if
(
simple
.
momentumPredictor
())
{
solve
(
UEqn
==
-
fvc
::
grad
(
p
));
fvOptions
.
correct
(
U
);
}
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/createFields.H
0 → 100644
View file @
649c29f9
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"
#include "createFvOptions.H"
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/overSimpleFoam/Make/files
0 → 100644
View file @
649c29f9
overSimpleFoam.C
EXE = $(FOAM_APPBIN)/overSimpleFoam
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/overSimpleFoam/Make/options
0 → 100644
View file @
649c29f9
EXE_INC = \
-I$(FOAM_SOLVERS)/incompressible/pimpleFoam/overPimpleDyMFoam \
-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 \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/overset/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lsampling \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \
-ldynamicMesh \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-loverset
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/overSimpleFoam/UEqn.H
0 → 100644
View file @
649c29f9
// Momentum predictor
MRF
.
correctBoundaryVelocity
(
U
);
tmp
<
fvVectorMatrix
>
tUEqn
(
fvm
::
div
(
phi
,
U
)
+
MRF
.
DDt
(
U
)
+
turbulence
->
divDevReff
(
U
)
==
fvOptions
(
U
)
);
fvVectorMatrix
&
UEqn
=
tUEqn
.
ref
();
UEqn
.
relax
();
fvOptions
.
constrain
(
UEqn
);
if
(
simple
.
momentumPredictor
())
{
solve
(
UEqn
==
-
cellMask
*
fvc
::
grad
(
p
));
}
fvOptions
.
correct
(
U
);
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/overSimpleFoam/continuityErrs.H
0 → 100644
View file @
649c29f9
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 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/>.
Global
continuityErrs
Description
Calculates and prints the continuity errors.
\*---------------------------------------------------------------------------*/
{
volScalarField
contErr
(
interpolatedCells
*
cellMask
*
fvc
::
div
(
phi
));
scalar
sumLocalContErr
=
runTime
.
deltaTValue
()
*
mag
(
contErr
)().
weightedAverage
(
mesh
.
V
()).
value
();
scalar
globalContErr
=
runTime
.
deltaTValue
()
*
contErr
.
weightedAverage
(
mesh
.
V
()).
value
();
cumulativeContErr
+=
globalContErr
;
Info
<<
"time step continuity errors : sum local = "
<<
sumLocalContErr
<<
", global = "
<<
globalContErr
<<
", cumulative = "
<<
cumulativeContErr
<<
endl
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/overSimpleFoam/createFields.H
0 → 100644
View file @
649c29f9
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"
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/overSimpleFoam/createOversetFields.H
0 → 100644
View file @
649c29f9
//- 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
)
);
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/overSimpleFoam/createUpdatedDynamicFvMesh.H
0 → 100644
View file @
649c29f9
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
();
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/overSimpleFoam/overSimpleFoam.C
0 → 100644
View file @
649c29f9
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/overSimpleFoam/pEqn.H
0 → 100644
View file @
649c29f9
{
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
);
}
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/pEqn.H
0 → 100644
View file @
649c29f9
{
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
);
}
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/Make/files
0 → 100644
View file @
649c29f9
porousSimpleFoam.C
EXE = $(FOAM_APPBIN)/porousSimpleFoam
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/Make/options
0 → 100644
View file @
649c29f9
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
OpenFOAM-v2112/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/UEqn.H
0 → 100644
View file @
649c29f9
// 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"
);
}
Prev
1
…
23
24
25
26
27
28
29
30
31
…
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