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
793 additions
and
0 deletions
+793
-0
applications/solvers/incompressible/shallowWaterFoam/Make/files
...ations/solvers/incompressible/shallowWaterFoam/Make/files
+3
-0
applications/solvers/incompressible/shallowWaterFoam/Make/options
...ions/solvers/incompressible/shallowWaterFoam/Make/options
+7
-0
applications/solvers/incompressible/shallowWaterFoam/createFields.H
...ns/solvers/incompressible/shallowWaterFoam/createFields.H
+79
-0
applications/solvers/incompressible/shallowWaterFoam/createPhi.H
...tions/solvers/incompressible/shallowWaterFoam/createPhi.H
+52
-0
applications/solvers/incompressible/shallowWaterFoam/readGravitationalAcceleration.H
...ressible/shallowWaterFoam/readGravitationalAcceleration.H
+24
-0
applications/solvers/incompressible/shallowWaterFoam/shallowWaterFoam.C
...olvers/incompressible/shallowWaterFoam/shallowWaterFoam.C
+172
-0
applications/solvers/incompressible/simpleFoam/Make/files
applications/solvers/incompressible/simpleFoam/Make/files
+3
-0
applications/solvers/incompressible/simpleFoam/Make/options
applications/solvers/incompressible/simpleFoam/Make/options
+18
-0
applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/Make/files
...olvers/incompressible/simpleFoam/SRFSimpleFoam/Make/files
+3
-0
applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/Make/options
...vers/incompressible/simpleFoam/SRFSimpleFoam/Make/options
+18
-0
applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/SRFSimpleFoam.C
...s/incompressible/simpleFoam/SRFSimpleFoam/SRFSimpleFoam.C
+97
-0
applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/UrelEqn.H
...solvers/incompressible/simpleFoam/SRFSimpleFoam/UrelEqn.H
+22
-0
applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/createFields.H
...rs/incompressible/simpleFoam/SRFSimpleFoam/createFields.H
+72
-0
applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/pEqn.H
...ns/solvers/incompressible/simpleFoam/SRFSimpleFoam/pEqn.H
+51
-0
applications/solvers/incompressible/simpleFoam/UEqn.H
applications/solvers/incompressible/simpleFoam/UEqn.H
+24
-0
applications/solvers/incompressible/simpleFoam/createFields.H
...ications/solvers/incompressible/simpleFoam/createFields.H
+46
-0
applications/solvers/incompressible/simpleFoam/overSimpleFoam/Make/files
...lvers/incompressible/simpleFoam/overSimpleFoam/Make/files
+3
-0
applications/solvers/incompressible/simpleFoam/overSimpleFoam/Make/options
...ers/incompressible/simpleFoam/overSimpleFoam/Make/options
+24
-0
applications/solvers/incompressible/simpleFoam/overSimpleFoam/UEqn.H
...s/solvers/incompressible/simpleFoam/overSimpleFoam/UEqn.H
+24
-0
applications/solvers/incompressible/simpleFoam/overSimpleFoam/continuityErrs.H
...incompressible/simpleFoam/overSimpleFoam/continuityErrs.H
+51
-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/shallowWaterFoam/Make/files
0 → 100644
View file @
ea17556c
shallowWaterFoam.C
EXE = $(FOAM_APPBIN)/shallowWaterFoam
applications/solvers/incompressible/shallowWaterFoam/Make/options
0 → 100644
View file @
ea17556c
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools
applications/solvers/incompressible/shallowWaterFoam/createFields.H
0 → 100644
View file @
ea17556c
#include "readGravitationalAcceleration.H"
Info
<<
"Reading field h
\n
"
<<
endl
;
volScalarField
h
(
IOobject
(
"h"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
Info
<<
"Reading field h0 if present
\n
"
<<
endl
;
volScalarField
h0
(
IOobject
(
"h0"
,
runTime
.
findInstance
(
"polyMesh"
,
"points"
),
mesh
,
IOobject
::
READ_IF_PRESENT
),
mesh
,
dimensionedScalar
(
dimLength
,
Zero
)
);
Info
<<
"Creating field hU
\n
"
<<
endl
;
volVectorField
hU
(
IOobject
(
"hU"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
Info
<<
"Reading field U
\n
"
<<
endl
;
volVectorField
U
(
IOobject
(
"U"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
hU
/
h
);
Info
<<
"Creating field hTotal for post processing
\n
"
<<
endl
;
volScalarField
hTotal
(
IOobject
(
"hTotal"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
READ_IF_PRESENT
,
IOobject
::
AUTO_WRITE
),
h
+
h0
);
hTotal
.
write
();
#include "createPhi.H"
Info
<<
"Creating Coriolis Force"
<<
endl
;
const
dimensionedVector
F
(
"F"
,
((
2
.
0
*
Omega
)
&
gHat
)
*
gHat
);
mesh
.
setFluxRequired
(
h
.
name
());
applications/solvers/incompressible/shallowWaterFoam/createPhi.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
-------------------------------------------------------------------------------
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
createPhi
Description
Creates and initialises the face-flux field phi.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"Reading/calculating face flux field phi
\n
"
<<
endl
;
surfaceScalarField
phi
(
IOobject
(
"phi"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
READ_IF_PRESENT
,
IOobject
::
AUTO_WRITE
),
linearInterpolate
(
hU
)
&
mesh
.
Sf
()
);
// ************************************************************************* //
applications/solvers/incompressible/shallowWaterFoam/readGravitationalAcceleration.H
0 → 100644
View file @
ea17556c
Info
<<
"
\n
Reading gravitationalProperties"
<<
endl
;
IOdictionary
gravitationalProperties
(
IOobject
(
"gravitationalProperties"
,
runTime
.
constant
(),
mesh
,
IOobject
::
MUST_READ_IF_MODIFIED
,
IOobject
::
NO_WRITE
)
);
const
dimensionedVector
g
(
"g"
,
dimAcceleration
,
gravitationalProperties
);
const
bool
rotating
(
gravitationalProperties
.
get
<
bool
>
(
"rotating"
));
const
dimensionedVector
Omega
=
(
rotating
?
dimensionedVector
(
"Omega"
,
dimless
/
dimTime
,
gravitationalProperties
)
:
dimensionedVector
(
"Omega"
,
dimless
/
dimTime
,
Zero
)
);
const
dimensionedScalar
magg
=
mag
(
g
);
const
dimensionedVector
gHat
=
g
/
magg
;
applications/solvers/incompressible/shallowWaterFoam/shallowWaterFoam.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-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/>.
Application
shallowWaterFoam
Group
grpIncompressibleSolvers
Description
Transient solver for inviscid shallow-water equations with rotation.
If the geometry is 3D then it is assumed to be one layers of cells and the
component of the velocity normal to gravity is removed.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Transient solver for inviscid shallow-water equations with rotation"
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"
\n
Starting time loop
\n
"
<<
endl
;
while
(
runTime
.
loop
())
{
Info
<<
"
\n
Time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
#include "CourantNo.H"
// --- Pressure-velocity PIMPLE corrector loop
while
(
pimple
.
loop
())
{
surfaceScalarField
phiv
(
"phiv"
,
phi
/
fvc
::
interpolate
(
h
));
fvVectorMatrix
hUEqn
(
fvm
::
ddt
(
hU
)
+
fvm
::
div
(
phiv
,
hU
)
);
hUEqn
.
relax
();
if
(
pimple
.
momentumPredictor
())
{
if
(
rotating
)
{
solve
(
hUEqn
+
(
F
^
hU
)
==
-
magg
*
h
*
fvc
::
grad
(
h
+
h0
));
}
else
{
solve
(
hUEqn
==
-
magg
*
h
*
fvc
::
grad
(
h
+
h0
));
}
// Constrain the momentum to be in the geometry if 3D geometry
if
(
mesh
.
nGeometricD
()
==
3
)
{
hU
-=
(
gHat
&
hU
)
*
gHat
;
hU
.
correctBoundaryConditions
();
}
}
// --- Pressure corrector loop
while
(
pimple
.
correct
())
{
volScalarField
rAU
(
1
.
0
/
hUEqn
.
A
());
surfaceScalarField
ghrAUf
(
magg
*
fvc
::
interpolate
(
h
*
rAU
));
surfaceScalarField
phih0
(
ghrAUf
*
mesh
.
magSf
()
*
fvc
::
snGrad
(
h0
));
volVectorField
HbyA
(
"HbyA"
,
hU
);
if
(
rotating
)
{
HbyA
=
rAU
*
(
hUEqn
.
H
()
-
(
F
^
hU
));
}
else
{
HbyA
=
rAU
*
hUEqn
.
H
();
}
surfaceScalarField
phiHbyA
(
"phiHbyA"
,
fvc
::
flux
(
HbyA
)
+
fvc
::
interpolate
(
rAU
)
*
fvc
::
ddtCorr
(
h
,
hU
,
phi
)
-
phih0
);
while
(
pimple
.
correctNonOrthogonal
())
{
fvScalarMatrix
hEqn
(
fvm
::
ddt
(
h
)
+
fvc
::
div
(
phiHbyA
)
-
fvm
::
laplacian
(
ghrAUf
,
h
)
);
hEqn
.
solve
(
mesh
.
solver
(
h
.
select
(
pimple
.
finalInnerIter
())));
if
(
pimple
.
finalNonOrthogonalIter
())
{
phi
=
phiHbyA
+
hEqn
.
flux
();
}
}
hU
=
HbyA
-
rAU
*
h
*
magg
*
fvc
::
grad
(
h
+
h0
);
// Constrain the momentum to be in the geometry if 3D geometry
if
(
mesh
.
nGeometricD
()
==
3
)
{
hU
-=
(
gHat
&
hU
)
*
gHat
;
}
hU
.
correctBoundaryConditions
();
}
}
U
==
hU
/
h
;
hTotal
==
h
+
h0
;
runTime
.
write
();
runTime
.
printExecutionTime
(
Info
);
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
applications/solvers/incompressible/simpleFoam/Make/files
0 → 100644
View file @
ea17556c
simpleFoam.C
EXE = $(FOAM_APPBIN)/simpleFoam
applications/solvers/incompressible/simpleFoam/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)/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 \
-latmosphericModels
applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/Make/files
0 → 100644
View file @
ea17556c
SRFSimpleFoam.C
EXE = $(FOAM_APPBIN)/SRFSimpleFoam
applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/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/SRFSimpleFoam/SRFSimpleFoam.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
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
;
}
// ************************************************************************* //
applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/UrelEqn.H
0 → 100644
View file @
ea17556c
// 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
);
}
applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/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 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"
applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/pEqn.H
0 → 100644
View file @
ea17556c
{
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
);
}
applications/solvers/incompressible/simpleFoam/UEqn.H
0 → 100644
View file @
ea17556c
// 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
);
}
applications/solvers/incompressible/simpleFoam/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"
#include "createFvOptions.H"
applications/solvers/incompressible/simpleFoam/overSimpleFoam/Make/files
0 → 100644
View file @
ea17556c
overSimpleFoam.C
EXE = $(FOAM_APPBIN)/overSimpleFoam
applications/solvers/incompressible/simpleFoam/overSimpleFoam/Make/options
0 → 100644
View file @
ea17556c
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
applications/solvers/incompressible/simpleFoam/overSimpleFoam/UEqn.H
0 → 100644
View file @
ea17556c
// 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
);
applications/solvers/incompressible/simpleFoam/overSimpleFoam/continuityErrs.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
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
;
}
// ************************************************************************* //
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