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
1000
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
675 additions
and
0 deletions
+675
-0
applications/solvers/acoustic/acousticFoam/createFields.H
applications/solvers/acoustic/acousticFoam/createFields.H
+15
-0
applications/solvers/acoustic/acousticFoam/createRegionControls.H
...ions/solvers/acoustic/acousticFoam/createRegionControls.H
+8
-0
applications/solvers/acoustic/acousticFoam/paEqn.H
applications/solvers/acoustic/acousticFoam/paEqn.H
+15
-0
applications/solvers/acoustic/acousticFoam/readTransportProperties.H
...s/solvers/acoustic/acousticFoam/readTransportProperties.H
+23
-0
applications/solvers/basic/basicSolversDoc.H
applications/solvers/basic/basicSolversDoc.H
+32
-0
applications/solvers/basic/laplacianFoam/Make/files
applications/solvers/basic/laplacianFoam/Make/files
+3
-0
applications/solvers/basic/laplacianFoam/Make/options
applications/solvers/basic/laplacianFoam/Make/options
+8
-0
applications/solvers/basic/laplacianFoam/createFields.H
applications/solvers/basic/laplacianFoam/createFields.H
+49
-0
applications/solvers/basic/laplacianFoam/laplacianFoam.C
applications/solvers/basic/laplacianFoam/laplacianFoam.C
+114
-0
applications/solvers/basic/laplacianFoam/overLaplacianDyMFoam/Make/files
...lvers/basic/laplacianFoam/overLaplacianDyMFoam/Make/files
+3
-0
applications/solvers/basic/laplacianFoam/overLaplacianDyMFoam/Make/options
...ers/basic/laplacianFoam/overLaplacianDyMFoam/Make/options
+11
-0
applications/solvers/basic/laplacianFoam/overLaplacianDyMFoam/createFields.H
...s/basic/laplacianFoam/overLaplacianDyMFoam/createFields.H
+33
-0
applications/solvers/basic/laplacianFoam/overLaplacianDyMFoam/overLaplacianDyMFoam.C
...laplacianFoam/overLaplacianDyMFoam/overLaplacianDyMFoam.C
+115
-0
applications/solvers/basic/laplacianFoam/overLaplacianDyMFoam/write.H
.../solvers/basic/laplacianFoam/overLaplacianDyMFoam/write.H
+46
-0
applications/solvers/basic/laplacianFoam/write.H
applications/solvers/basic/laplacianFoam/write.H
+58
-0
applications/solvers/basic/potentialFoam/Make/files
applications/solvers/basic/potentialFoam/Make/files
+3
-0
applications/solvers/basic/potentialFoam/Make/options
applications/solvers/basic/potentialFoam/Make/options
+9
-0
applications/solvers/basic/potentialFoam/createControls.H
applications/solvers/basic/potentialFoam/createControls.H
+9
-0
applications/solvers/basic/potentialFoam/createFields.H
applications/solvers/basic/potentialFoam/createFields.H
+118
-0
applications/solvers/basic/potentialFoam/overPotentialFoam/Make/files
.../solvers/basic/potentialFoam/overPotentialFoam/Make/files
+3
-0
No files found.
Too many changes to show.
To preserve performance only
1000 of 1000+
files are displayed.
Plain diff
Email patch
applications/solvers/acoustic/acousticFoam/createFields.H
0 → 100644
View file @
ea17556c
Info
<<
"
\n
Reading pa"
<<
endl
;
volScalarField
pa
(
IOobject
(
"pa"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
applications/solvers/acoustic/acousticFoam/createRegionControls.H
0 → 100644
View file @
ea17556c
fvSolution
solutionDict
(
runTime
);
const
dictionary
&
pimpleDict
=
solutionDict
.
subDict
(
"PIMPLE"
);
bool
solvePrimaryRegion
(
pimpleDict
.
getOrDefault
(
"solvePrimaryRegion"
,
true
)
);
applications/solvers/acoustic/acousticFoam/paEqn.H
0 → 100644
View file @
ea17556c
fvScalarMatrix
paEqn
(
fvm
::
d2dt2
(
pa
)
-
sqr
(
c0
)
*
fvc
::
laplacian
(
pa
)
);
if
(
solvePrimaryRegion
)
{
paEqn
.
relax
();
paEqn
.
solve
();
}
else
{
pa
.
correctBoundaryConditions
();
}
applications/solvers/acoustic/acousticFoam/readTransportProperties.H
0 → 100644
View file @
ea17556c
Info
<<
"
\n
Reading transportProperties"
<<
endl
;
IOdictionary
transportProperties
(
IOobject
(
"transportProperties"
,
runTime
.
constant
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
NO_WRITE
)
);
dimensionedScalar
c0
(
"c0"
,
dimVelocity
,
transportProperties
);
dimensionedScalar
rho
(
"rho"
,
dimDensity
,
transportProperties
);
scalar
MaxCo
=
max
(
mesh
.
surfaceInterpolation
::
deltaCoeffs
()
*
c0
).
value
()
*
runTime
.
deltaT
().
value
();
Info
<<
"Max acoustic Courant Number = "
<<
MaxCo
<<
endl
;
applications/solvers/basic/basicSolversDoc.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) 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/>.
\defgroup grpBasicSolvers Basic solvers
@{
\ingroup grpSolvers
This group contains basic solvers.
@}
\*---------------------------------------------------------------------------*/
applications/solvers/basic/laplacianFoam/Make/files
0 → 100644
View file @
ea17556c
laplacianFoam.C
EXE = $(FOAM_APPBIN)/laplacianFoam
applications/solvers/basic/laplacianFoam/Make/options
0 → 100644
View file @
ea17556c
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools
applications/solvers/basic/laplacianFoam/createFields.H
0 → 100644
View file @
ea17556c
Info
<<
"Reading field T
\n
"
<<
endl
;
volScalarField
T
(
IOobject
(
"T"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
Info
<<
"Reading diffusivity DT
\n
"
<<
endl
;
volScalarField
DT
(
IOobject
(
"DT"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
READ_IF_PRESENT
,
IOobject
::
AUTO_WRITE
),
mesh
,
dimensionedScalar
(
dimViscosity
,
Zero
)
);
if
(
!
DT
.
headerOk
())
{
IOdictionary
transportProperties
(
IOobject
(
"transportProperties"
,
runTime
.
constant
(),
mesh
,
IOobject
::
MUST_READ_IF_MODIFIED
,
IOobject
::
NO_WRITE
)
);
DT
=
dimensionedScalar
(
"DT"
,
dimViscosity
,
transportProperties
);
}
#include "createFvOptions.H"
applications/solvers/basic/laplacianFoam/laplacianFoam.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
Copyright (C) 2019 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
laplacianFoam
Group
grpBasicSolvers
Description
Laplace equation solver for a scalar quantity.
\heading Solver details
The solver is applicable to, e.g. for thermal diffusion in a solid. The
equation is given by:
\f[
\ddt{T} = \div \left( D_T \grad T \right)
\f]
Where:
\vartable
T | Scalar field which is solved for, e.g. temperature
D_T | Diffusion coefficient
\endvartable
\heading Required fields
\plaintable
T | Scalar field which is solved for, e.g. temperature
\endplaintable
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "fvOptions.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Laplace equation solver for a scalar quantity."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createMesh.H"
simpleControl
simple
(
mesh
);
#include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"
\n
Calculating temperature distribution
\n
"
<<
endl
;
while
(
simple
.
loop
())
{
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
while
(
simple
.
correctNonOrthogonal
())
{
fvScalarMatrix
TEqn
(
fvm
::
ddt
(
T
)
-
fvm
::
laplacian
(
DT
,
T
)
==
fvOptions
(
T
)
);
fvOptions
.
constrain
(
TEqn
);
TEqn
.
solve
();
fvOptions
.
correct
(
T
);
}
#include "write.H"
runTime
.
printExecutionTime
(
Info
);
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
applications/solvers/basic/laplacianFoam/overLaplacianDyMFoam/Make/files
0 → 100644
View file @
ea17556c
overLaplacianDyMFoam.C
EXE = $(FOAM_APPBIN)/overLaplacianDyMFoam
applications/solvers/basic/laplacianFoam/overLaplacianDyMFoam/Make/options
0 → 100644
View file @
ea17556c
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/overset/lnInclude \
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-ldynamicFvMesh \
-loverset
applications/solvers/basic/laplacianFoam/overLaplacianDyMFoam/createFields.H
0 → 100644
View file @
ea17556c
Info
<<
"Reading field T
\n
"
<<
endl
;
volScalarField
T
(
IOobject
(
"T"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
Info
<<
"Reading transportProperties
\n
"
<<
endl
;
IOdictionary
transportProperties
(
IOobject
(
"transportProperties"
,
runTime
.
constant
(),
mesh
,
IOobject
::
MUST_READ_IF_MODIFIED
,
IOobject
::
NO_WRITE
)
);
Info
<<
"Reading diffusivity DT
\n
"
<<
endl
;
dimensionedScalar
DT
(
"DT"
,
dimViscosity
,
transportProperties
);
applications/solvers/basic/laplacianFoam/overLaplacianDyMFoam/overLaplacianDyMFoam.C
0 → 100644
View file @
ea17556c
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 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
overLaplacianDyMFoam
Group
grpBasicSolvers
Description
Laplace equation solver for a scalar quantity.
\heading Solver details
The solver is applicable to, e.g. for thermal diffusion in a solid. The
equation is given by:
\f[
\ddt{T} = \div \left( D_T \grad T \right)
\f]
Where:
\vartable
T | Scalar field which is solved for, e.g. temperature
D_T | Diffusion coefficient
\endvartable
\heading Required fields
\plaintable
T | Scalar field which is solved for, e.g. temperature
\endplaintable
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "fvOptions.H"
#include "simpleControl.H"
#include "dynamicFvMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Overset Laplace equation solver for a scalar quantity."
);
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createNamedDynamicFvMesh.H"
simpleControl
simple
(
mesh
);
#include "createFields.H"
#include "createFvOptions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"
\n
Calculating temperature distribution
\n
"
<<
endl
;
while
(
simple
.
loop
())
{
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
mesh
.
update
();
while
(
simple
.
correctNonOrthogonal
())
{
fvScalarMatrix
TEqn
(
fvm
::
ddt
(
T
)
-
fvm
::
laplacian
(
DT
,
T
)
==
fvOptions
(
T
)
);
fvOptions
.
constrain
(
TEqn
);
TEqn
.
solve
();
fvOptions
.
correct
(
T
);
}
#include "write.H"
runTime
.
printExecutionTime
(
Info
);
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
applications/solvers/basic/laplacianFoam/overLaplacianDyMFoam/write.H
0 → 100644
View file @
ea17556c
if
(
runTime
.
writeTime
())
{
volVectorField
gradT
(
fvc
::
grad
(
T
));
volScalarField
gradTx
(
IOobject
(
"gradTx"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
gradT
.
component
(
vector
::
X
)
);
volScalarField
gradTy
(
IOobject
(
"gradTy"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
gradT
.
component
(
vector
::
Y
)
);
volScalarField
gradTz
(
IOobject
(
"gradTz"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
gradT
.
component
(
vector
::
Z
)
);
runTime
.
write
();
}
applications/solvers/basic/laplacianFoam/write.H
0 → 100644
View file @
ea17556c
if
(
runTime
.
writeTime
())
{
volVectorField
gradT
(
fvc
::
grad
(
T
));
volScalarField
gradTx
(
IOobject
(
"gradTx"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
gradT
.
component
(
vector
::
X
)
);
volScalarField
gradTy
(
IOobject
(
"gradTy"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
gradT
.
component
(
vector
::
Y
)
);
volScalarField
gradTz
(
IOobject
(
"gradTz"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
gradT
.
component
(
vector
::
Z
)
);
volVectorField
DTgradT
(
IOobject
(
"flux"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
DT
*
gradT
);
runTime
.
write
();
}
applications/solvers/basic/potentialFoam/Make/files
0 → 100644
View file @
ea17556c
potentialFoam.C
EXE = $(FOAM_APPBIN)/potentialFoam
applications/solvers/basic/potentialFoam/Make/options
0 → 100644
View file @
ea17556c
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lsampling
applications/solvers/basic/potentialFoam/createControls.H
0 → 100644
View file @
ea17556c
const
dictionary
&
potentialFlow
(
mesh
.
solutionDict
().
subDict
(
"potentialFlow"
)
);
const
int
nNonOrthCorr
(
potentialFlow
.
getOrDefault
<
int
>
(
"nNonOrthogonalCorrectors"
,
0
)
);
applications/solvers/basic/potentialFoam/createFields.H
0 → 100644
View file @
ea17556c
Info
<<
"Reading velocity field U
\n
"
<<
endl
;
volVectorField
U
(
IOobject
(
"U"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
// Initialise the velocity internal field to zero
U
=
dimensionedVector
(
U
.
dimensions
(),
Zero
);
surfaceScalarField
phi
(
IOobject
(
"phi"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
fvc
::
flux
(
U
)
);
if
(
args
.
found
(
"initialiseUBCs"
))
{
U
.
correctBoundaryConditions
();
phi
=
fvc
::
flux
(
U
);
}
// Construct a pressure field
// If it is available read it otherwise construct from the velocity BCs
// converting fixed-value BCs to zero-gradient and vice versa.
// Allow override from command-line -pName option
const
word
pName
=
args
.
getOrDefault
<
word
>
(
"pName"
,
"p"
);
// Infer the pressure BCs from the velocity
wordList
pBCTypes
(
U
.
boundaryField
().
size
(),
fixedValueFvPatchScalarField
::
typeName
);
forAll
(
U
.
boundaryField
(),
patchi
)
{
if
(
U
.
boundaryField
()[
patchi
].
fixesValue
())
{
pBCTypes
[
patchi
]
=
zeroGradientFvPatchScalarField
::
typeName
;
}
}
Info
<<
"Constructing pressure field "
<<
pName
<<
nl
<<
endl
;
volScalarField
p
(
IOobject
(
pName
,
runTime
.
timeName
(),
mesh
,
IOobject
::
READ_IF_PRESENT
,
IOobject
::
NO_WRITE
),
mesh
,
dimensionedScalar
(
sqr
(
dimVelocity
),
Zero
),
pBCTypes
);
// Infer the velocity potential BCs from the pressure
wordList
PhiBCTypes
(
p
.
boundaryField
().
size
(),
zeroGradientFvPatchScalarField
::
typeName
);
forAll
(
p
.
boundaryField
(),
patchi
)
{
if
(
p
.
boundaryField
()[
patchi
].
fixesValue
())
{
PhiBCTypes
[
patchi
]
=
fixedValueFvPatchScalarField
::
typeName
;
}
}
Info
<<
"Constructing velocity potential field Phi
\n
"
<<
endl
;
volScalarField
Phi
(
IOobject
(
"Phi"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
READ_IF_PRESENT
,
IOobject
::
NO_WRITE
),
mesh
,
dimensionedScalar
(
dimLength
*
dimVelocity
,
Zero
),
PhiBCTypes
);
label
PhiRefCell
=
0
;
scalar
PhiRefValue
=
0
;
setRefCell
(
Phi
,
potentialFlow
.
dict
(),
PhiRefCell
,
PhiRefValue
);
mesh
.
setFluxRequired
(
Phi
.
name
());
#include "createMRF.H"
applications/solvers/basic/potentialFoam/overPotentialFoam/Make/files
0 → 100644
View file @
ea17556c
overPotentialFoam.C
EXE = $(FOAM_APPBIN)/overPotentialFoam
Prev
1
2
3
4
5
6
…
50
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