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
55e5a777
Commit
55e5a777
authored
Oct 17, 2024
by
shunbo
Browse files
initial commit
parents
Changes
677
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1535 additions
and
0 deletions
+1535
-0
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/Allwmake
...2112/applications/solvers/rhoReactingCentralFoam/Allwmake
+7
-0
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/Make/files
...pplications/solvers/rhoReactingCentralFoam/BCs/Make/files
+5
-0
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/Make/options
...lications/solvers/rhoReactingCentralFoam/BCs/Make/options
+15
-0
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalargpuField.C
...entralFoam/BCs/T/smoluchowskiJumpTFvPatchScalargpuField.C
+236
-0
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalargpuField.H
...entralFoam/BCs/T/smoluchowskiJumpTFvPatchScalargpuField.H
+176
-0
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/U/maxwellSlipUFvPatchVectorgpuField.C
...tingCentralFoam/BCs/U/maxwellSlipUFvPatchVectorgpuField.C
+233
-0
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/U/maxwellSlipUFvPatchVectorgpuField.H
...tingCentralFoam/BCs/U/maxwellSlipUFvPatchVectorgpuField.H
+168
-0
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/lnInclude/fixedRhoFvPatchScalargpuField.C
...CentralFoam/BCs/lnInclude/fixedRhoFvPatchScalargpuField.C
+2
-0
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/lnInclude/fixedRhoFvPatchScalargpuField.H
...CentralFoam/BCs/lnInclude/fixedRhoFvPatchScalargpuField.H
+2
-0
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/lnInclude/maxwellSlipUFvPatchVectorgpuField.C
...ralFoam/BCs/lnInclude/maxwellSlipUFvPatchVectorgpuField.C
+2
-0
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/lnInclude/maxwellSlipUFvPatchVectorgpuField.H
...ralFoam/BCs/lnInclude/maxwellSlipUFvPatchVectorgpuField.H
+2
-0
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/lnInclude/smoluchowskiJumpTFvPatchScalargpuField.C
...am/BCs/lnInclude/smoluchowskiJumpTFvPatchScalargpuField.C
+2
-0
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/lnInclude/smoluchowskiJumpTFvPatchScalargpuField.H
...am/BCs/lnInclude/smoluchowskiJumpTFvPatchScalargpuField.H
+2
-0
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/rho/fixedRhoFvPatchScalargpuField.C
...actingCentralFoam/BCs/rho/fixedRhoFvPatchScalargpuField.C
+139
-0
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/rho/fixedRhoFvPatchScalargpuField.H
...actingCentralFoam/BCs/rho/fixedRhoFvPatchScalargpuField.H
+188
-0
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/Make/files
...12/applications/solvers/rhoReactingCentralFoam/Make/files
+3
-0
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/Make/options
.../applications/solvers/rhoReactingCentralFoam/Make/options
+39
-0
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/centralCourantNo.H
...cations/solvers/rhoReactingCentralFoam/centralCourantNo.H
+47
-0
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/createFieldRefs.H
...ications/solvers/rhoReactingCentralFoam/createFieldRefs.H
+56
-0
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/createFields.H
...pplications/solvers/rhoReactingCentralFoam/createFields.H
+211
-0
No files found.
Too many changes to show.
To preserve performance only
677 of 677+
files are displayed.
Plain diff
Email patch
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/Allwmake
0 → 100644
View file @
55e5a777
#!/bin/sh
cd
${
0
%/*
}
||
exit
1
# Run from this directory
set
-x
(
wmake libso BCs
&&
wmake
)
# ----------------------------------------------------------------- end-of-file
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/Make/files
0 → 100644
View file @
55e5a777
U/maxwellSlipUFvPatchVectorgpuField.C
T/smoluchowskiJumpTFvPatchScalargpuField.C
rho/fixedRhoFvPatchScalargpuField.C
LIB = $(FOAM_LIBBIN)/librhoCentralFoam-GPU
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/Make/options
0 → 100644
View file @
55e5a777
EXE_INC = \
-I$(LIB_SRC)/gpufiniteVolume/lnInclude \
-I$(LIB_SRC)/gpuOpenFOAM/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels-GPU/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels-GPU/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels-GPU/specie/lnInclude
LIB_LIBS = \
-lgpufiniteVolume \
-lgpuOpenFOAM \
-lfiniteVolume \
-lcompressibleTransportModels-GPU \
-lfluidThermophysicalModels-GPU \
-lspecie-GPU
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalargpuField.C
0 → 100644
View file @
55e5a777
/*---------------------------------------------------------------------------*\
========= |
\\ / 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) 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/>.
\*---------------------------------------------------------------------------*/
#include "smoluchowskiJumpTFvPatchScalargpuField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchgpuFieldMapper.H"
#include "volgpuFields.H"
#include "basicThermo.H"
#include "mathematicalConstants.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam
::
smoluchowskiJumpTFvPatchScalargpuField
::
smoluchowskiJumpTFvPatchScalargpuField
(
const
gpufvPatch
&
p
,
const
DimensionedgpuField
<
scalar
,
gpuvolMesh
>&
iF
)
:
mixedFvPatchScalargpuField
(
p
,
iF
),
UName_
(
"U"
),
rhoName_
(
"rho"
),
psiName_
(
"thermo:psi"
),
muName_
(
"thermo:mu"
),
accommodationCoeff_
(
1
.
0
),
Twall_
(
p
.
size
(),
Zero
),
gamma_
(
1
.
4
)
{
refValue
()
=
0
.
0
;
refGrad
()
=
0
.
0
;
valueFraction
()
=
0
.
0
;
}
Foam
::
smoluchowskiJumpTFvPatchScalargpuField
::
smoluchowskiJumpTFvPatchScalargpuField
(
const
smoluchowskiJumpTFvPatchScalargpuField
&
ptf
,
const
gpufvPatch
&
p
,
const
DimensionedgpuField
<
scalar
,
gpuvolMesh
>&
iF
,
const
fvPatchgpuFieldMapper
&
mapper
)
:
mixedFvPatchScalargpuField
(
ptf
,
p
,
iF
,
mapper
),
UName_
(
ptf
.
UName_
),
rhoName_
(
ptf
.
rhoName_
),
psiName_
(
ptf
.
psiName_
),
muName_
(
ptf
.
muName_
),
accommodationCoeff_
(
ptf
.
accommodationCoeff_
),
Twall_
(
ptf
.
Twall_
),
gamma_
(
ptf
.
gamma_
)
{}
Foam
::
smoluchowskiJumpTFvPatchScalargpuField
::
smoluchowskiJumpTFvPatchScalargpuField
(
const
gpufvPatch
&
p
,
const
DimensionedgpuField
<
scalar
,
gpuvolMesh
>&
iF
,
const
dictionary
&
dict
)
:
mixedFvPatchScalargpuField
(
p
,
iF
),
UName_
(
dict
.
getOrDefault
<
word
>
(
"U"
,
"U"
)),
rhoName_
(
dict
.
getOrDefault
<
word
>
(
"rho"
,
"rho"
)),
psiName_
(
dict
.
getOrDefault
<
word
>
(
"psi"
,
"thermo:psi"
)),
muName_
(
dict
.
getOrDefault
<
word
>
(
"mu"
,
"thermo:mu"
)),
accommodationCoeff_
(
dict
.
get
<
scalar
>
(
"accommodationCoeff"
)),
Twall_
(
"Twall"
,
dict
,
p
.
size
()),
gamma_
(
dict
.
getOrDefault
<
scalar
>
(
"gamma"
,
1
.
4
))
{
if
(
mag
(
accommodationCoeff_
)
<
SMALL
||
mag
(
accommodationCoeff_
)
>
2
.
0
)
{
FatalIOErrorInFunction
(
dict
)
<<
"unphysical accommodationCoeff specified"
<<
"(0 < accommodationCoeff <= 1)"
<<
endl
<<
exit
(
FatalIOError
);
}
if
(
dict
.
found
(
"value"
))
{
fvPatchgpuField
<
scalar
>::
operator
=
(
scalargpuField
(
"value"
,
dict
,
p
.
size
())
);
}
else
{
fvPatchgpuField
<
scalar
>::
operator
=
(
patchInternalField
());
}
refValue
()
=
*
this
;
refGrad
()
=
0
.
0
;
valueFraction
()
=
0
.
0
;
}
Foam
::
smoluchowskiJumpTFvPatchScalargpuField
::
smoluchowskiJumpTFvPatchScalargpuField
(
const
smoluchowskiJumpTFvPatchScalargpuField
&
ptpsf
,
const
DimensionedgpuField
<
scalar
,
gpuvolMesh
>&
iF
)
:
mixedFvPatchScalargpuField
(
ptpsf
,
iF
),
accommodationCoeff_
(
ptpsf
.
accommodationCoeff_
),
Twall_
(
ptpsf
.
Twall_
),
gamma_
(
ptpsf
.
gamma_
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Map from self
void
Foam
::
smoluchowskiJumpTFvPatchScalargpuField
::
autoMap
(
const
fvPatchgpuFieldMapper
&
m
)
{
mixedFvPatchScalargpuField
::
autoMap
(
m
);
}
// Reverse-map the given fvPatchField onto this fvPatchField
void
Foam
::
smoluchowskiJumpTFvPatchScalargpuField
::
rmap
(
const
fvPatchgpuField
<
scalar
>&
ptf
,
const
labelgpuList
&
addr
)
{
mixedFvPatchgpuField
<
scalar
>::
rmap
(
ptf
,
addr
);
}
// Update the coefficients associated with the patch field
void
Foam
::
smoluchowskiJumpTFvPatchScalargpuField
::
updateCoeffs
()
{
if
(
updated
())
{
return
;
}
const
fvPatchScalargpuField
&
pmu
=
patch
().
lookupPatchField
<
volScalargpuField
,
scalar
>
(
muName_
);
const
fvPatchScalargpuField
&
prho
=
patch
().
lookupPatchField
<
volScalargpuField
,
scalar
>
(
rhoName_
);
const
fvPatchgpuField
<
scalar
>&
ppsi
=
patch
().
lookupPatchField
<
volScalargpuField
,
scalar
>
(
psiName_
);
const
fvPatchVectorgpuField
&
pU
=
patch
().
lookupPatchField
<
volVectorgpuField
,
vector
>
(
UName_
);
// Prandtl number reading consistent with rhoCentralFoam
const
dictionary
&
thermophysicalProperties
=
db
().
lookupObject
<
IOdictionary
>
(
basicThermo
::
dictName
);
dimensionedScalar
Pr
(
"Pr"
,
dimless
,
thermophysicalProperties
.
subDict
(
"mixture"
).
subDict
(
"transport"
)
);
gpuField
<
scalar
>
C2
(
pmu
/
prho
*
sqrt
(
ppsi
*
constant
::
mathematical
::
piByTwo
)
*
2
.
0
*
gamma_
/
Pr
.
value
()
/
(
gamma_
+
1
.
0
)
*
(
2
.
0
-
accommodationCoeff_
)
/
accommodationCoeff_
);
gpuField
<
scalar
>
aCoeff
(
prho
.
snGrad
()
-
prho
/
C2
);
gpuField
<
scalar
>
KEbyRho
(
0
.
5
*
magSqr
(
pU
));
valueFraction
()
=
(
1
.
0
/
(
1
.
0
+
patch
().
deltaCoeffs
()
*
C2
));
refValue
()
=
Twall_
;
refGrad
()
=
0
.
0
;
mixedFvPatchScalargpuField
::
updateCoeffs
();
}
// Write
void
Foam
::
smoluchowskiJumpTFvPatchScalargpuField
::
write
(
Ostream
&
os
)
const
{
fvPatchScalargpuField
::
write
(
os
);
os
.
writeEntryIfDifferent
<
word
>
(
"U"
,
"U"
,
UName_
);
os
.
writeEntryIfDifferent
<
word
>
(
"rho"
,
"rho"
,
rhoName_
);
os
.
writeEntryIfDifferent
<
word
>
(
"psi"
,
"thermo:psi"
,
psiName_
);
os
.
writeEntryIfDifferent
<
word
>
(
"mu"
,
"thermo:mu"
,
muName_
);
os
.
writeEntry
(
"accommodationCoeff"
,
accommodationCoeff_
);
Twall_
.
writeEntry
(
"Twall"
,
os
);
os
.
writeEntry
(
"gamma"
,
gamma_
);
writeEntry
(
"value"
,
os
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
makePatchTypeField
(
fvPatchScalargpuField
,
smoluchowskiJumpTFvPatchScalargpuField
);
}
// ************************************************************************* //
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalargpuField.H
0 → 100644
View file @
55e5a777
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2012 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/>.
Class
Foam::smoluchowskiJumpTFvPatchScalarField
Description
Smoluchowski temperature jump boundary condition
SourceFiles
smoluchowskiJumpTFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef smoluchowskiJumpTFvPatchScalargpuField_H
#define smoluchowskiJumpTFvPatchScalargpuField_H
#include "mixedFvPatchgpuFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
/*---------------------------------------------------------------------------*\
Class smoluchowskiJumpTFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class
smoluchowskiJumpTFvPatchScalargpuField
:
public
mixedFvPatchScalargpuField
{
// Private data
//- Velocity field name, default = "U"
word
UName_
;
//- Density field name, default = "rho"
word
rhoName_
;
//- Compressibility field name, default = "thermo:psi"
word
psiName_
;
//- Dynamic viscosity field name, default = "thermo:mu"
word
muName_
;
//- Accommodation coefficient
scalar
accommodationCoeff_
;
//- Wall surface temperature
scalarField
Twall_
;
//- Heat capacity ratio (default 1.4)
scalar
gamma_
;
public:
//- Runtime type information
TypeName
(
"smoluchowskiJumpT"
);
// Constructors
//- Construct from patch and internal field
smoluchowskiJumpTFvPatchScalargpuField
(
const
gpufvPatch
&
,
const
DimensionedgpuField
<
scalar
,
gpuvolMesh
>&
);
//- Construct from patch, internal field and dictionary
smoluchowskiJumpTFvPatchScalargpuField
(
const
gpufvPatch
&
,
const
DimensionedgpuField
<
scalar
,
gpuvolMesh
>&
,
const
dictionary
&
);
//- Construct by mapping given smoluchowskiJumpTFvPatchScalarField
// onto a new patch
smoluchowskiJumpTFvPatchScalargpuField
(
const
smoluchowskiJumpTFvPatchScalargpuField
&
,
const
gpufvPatch
&
,
const
DimensionedgpuField
<
scalar
,
gpuvolMesh
>&
,
const
fvPatchgpuFieldMapper
&
);
//- Construct and return a clone
virtual
tmp
<
fvPatchScalargpuField
>
clone
()
const
{
return
tmp
<
fvPatchScalargpuField
>
(
new
smoluchowskiJumpTFvPatchScalargpuField
(
*
this
)
);
}
//- Construct as copy setting internal field reference
smoluchowskiJumpTFvPatchScalargpuField
(
const
smoluchowskiJumpTFvPatchScalargpuField
&
,
const
DimensionedgpuField
<
scalar
,
gpuvolMesh
>&
);
//- Construct and return a clone setting internal field reference
virtual
tmp
<
fvPatchScalargpuField
>
clone
(
const
DimensionedgpuField
<
scalar
,
gpuvolMesh
>&
iF
)
const
{
return
tmp
<
fvPatchScalargpuField
>
(
new
smoluchowskiJumpTFvPatchScalargpuField
(
*
this
,
iF
)
);
}
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual
void
autoMap
(
const
fvPatchgpuFieldMapper
&
);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual
void
rmap
(
const
fvPatchgpuField
<
scalar
>&
,
const
labelgpuList
&
);
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual
void
updateCoeffs
();
//- Write
virtual
void
write
(
Ostream
&
)
const
;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/U/maxwellSlipUFvPatchVectorgpuField.C
0 → 100644
View file @
55e5a777
/*---------------------------------------------------------------------------*\
========= |
\\ / 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) 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/>.
\*---------------------------------------------------------------------------*/
#include "maxwellSlipUFvPatchVectorgpuField.H"
#include "addToRunTimeSelectionTable.H"
#include "mathematicalConstants.H"
#include "fvPatchgpuFieldMapper.H"
#include "volgpuFields.H"
#include "gpufvcGrad.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam
::
maxwellSlipUFvPatchVectorgpuField
::
maxwellSlipUFvPatchVectorgpuField
(
const
gpufvPatch
&
p
,
const
DimensionedgpuField
<
vector
,
gpuvolMesh
>&
iF
)
:
partialSlipFvPatchVectorgpuField
(
p
,
iF
),
TName_
(
"T"
),
rhoName_
(
"rho"
),
psiName_
(
"thermo:psi"
),
muName_
(
"thermo:mu"
),
tauMCName_
(
"tauMC"
),
accommodationCoeff_
(
1
.
0
),
Uwall_
(
p
.
size
(),
Zero
),
thermalCreep_
(
true
),
curvature_
(
true
)
{}
Foam
::
maxwellSlipUFvPatchVectorgpuField
::
maxwellSlipUFvPatchVectorgpuField
(
const
maxwellSlipUFvPatchVectorgpuField
&
mspvf
,
const
gpufvPatch
&
p
,
const
DimensionedgpuField
<
vector
,
gpuvolMesh
>&
iF
,
const
fvPatchgpuFieldMapper
&
mapper
)
:
partialSlipFvPatchVectorgpuField
(
mspvf
,
p
,
iF
,
mapper
),
TName_
(
mspvf
.
TName_
),
rhoName_
(
mspvf
.
rhoName_
),
psiName_
(
mspvf
.
psiName_
),
muName_
(
mspvf
.
muName_
),
tauMCName_
(
mspvf
.
tauMCName_
),
accommodationCoeff_
(
mspvf
.
accommodationCoeff_
),
Uwall_
(
mspvf
.
Uwall_
),
thermalCreep_
(
mspvf
.
thermalCreep_
),
curvature_
(
mspvf
.
curvature_
)
{}
Foam
::
maxwellSlipUFvPatchVectorgpuField
::
maxwellSlipUFvPatchVectorgpuField
(
const
gpufvPatch
&
p
,
const
DimensionedgpuField
<
vector
,
gpuvolMesh
>&
iF
,
const
dictionary
&
dict
)
:
partialSlipFvPatchVectorgpuField
(
p
,
iF
),
TName_
(
dict
.
getOrDefault
<
word
>
(
"T"
,
"T"
)),
rhoName_
(
dict
.
getOrDefault
<
word
>
(
"rho"
,
"rho"
)),
psiName_
(
dict
.
getOrDefault
<
word
>
(
"psi"
,
"thermo:psi"
)),
muName_
(
dict
.
getOrDefault
<
word
>
(
"mu"
,
"thermo:mu"
)),
tauMCName_
(
dict
.
getOrDefault
<
word
>
(
"tauMC"
,
"tauMC"
)),
accommodationCoeff_
(
dict
.
get
<
scalar
>
(
"accommodationCoeff"
)),
Uwall_
(
"Uwall"
,
dict
,
p
.
size
()),
thermalCreep_
(
dict
.
getOrDefault
(
"thermalCreep"
,
true
)),
curvature_
(
dict
.
getOrDefault
(
"curvature"
,
true
))
{
if
(
mag
(
accommodationCoeff_
)
<
SMALL
||
mag
(
accommodationCoeff_
)
>
2
.
0
)
{
FatalIOErrorInFunction
(
dict
)
<<
"unphysical accommodationCoeff_ specified"
<<
"(0 < accommodationCoeff_ <= 1)"
<<
endl
<<
exit
(
FatalIOError
);
}
if
(
dict
.
found
(
"value"
))
{
fvPatchgpuField
<
vector
>::
operator
=
(
vectorgpuField
(
"value"
,
dict
,
p
.
size
())
);
if
(
dict
.
found
(
"refValue"
)
&&
dict
.
found
(
"valueFraction"
))
{
this
->
refValue
()
=
vectorgpuField
(
"refValue"
,
dict
,
p
.
size
());
this
->
valueFraction
()
=
scalargpuField
(
"valueFraction"
,
dict
,
p
.
size
());
}
else
{
this
->
refValue
()
=
*
this
;
this
->
valueFraction
()
=
scalar
(
1
);
}
}
}
Foam
::
maxwellSlipUFvPatchVectorgpuField
::
maxwellSlipUFvPatchVectorgpuField
(
const
maxwellSlipUFvPatchVectorgpuField
&
mspvf
,
const
DimensionedgpuField
<
vector
,
gpuvolMesh
>&
iF
)
:
partialSlipFvPatchVectorgpuField
(
mspvf
,
iF
),
TName_
(
mspvf
.
TName_
),
rhoName_
(
mspvf
.
rhoName_
),
psiName_
(
mspvf
.
psiName_
),
muName_
(
mspvf
.
muName_
),
tauMCName_
(
mspvf
.
tauMCName_
),
accommodationCoeff_
(
mspvf
.
accommodationCoeff_
),
Uwall_
(
mspvf
.
Uwall_
),
thermalCreep_
(
mspvf
.
thermalCreep_
),
curvature_
(
mspvf
.
curvature_
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void
Foam
::
maxwellSlipUFvPatchVectorgpuField
::
updateCoeffs
()
{
if
(
updated
())
{
return
;
}
const
fvPatchScalargpuField
&
pmu
=
patch
().
lookupPatchField
<
volScalargpuField
,
scalar
>
(
muName_
);
const
fvPatchScalargpuField
&
prho
=
patch
().
lookupPatchField
<
volScalargpuField
,
scalar
>
(
rhoName_
);
const
fvPatchgpuField
<
scalar
>&
ppsi
=
patch
().
lookupPatchField
<
volScalargpuField
,
scalar
>
(
psiName_
);
gpuField
<
scalar
>
C1
(
sqrt
(
ppsi
*
constant
::
mathematical
::
piByTwo
)
*
(
2
.
0
-
accommodationCoeff_
)
/
accommodationCoeff_
);
gpuField
<
scalar
>
pnu
(
pmu
/
prho
);
valueFraction
()
=
(
1
.
0
/
(
1
.
0
+
patch
().
deltaCoeffs
()
*
C1
*
pnu
));
refValue
()
=
Uwall_
;
if
(
thermalCreep_
)
{
const
volScalargpuField
&
vsfT
=
this
->
db
().
objectRegistry
::
lookupObject
<
volScalargpuField
>
(
TName_
);
label
patchi
=
this
->
patch
().
index
();
const
fvPatchScalargpuField
&
pT
=
vsfT
.
boundaryField
()[
patchi
];
gpuField
<
vector
>
gradpT
(
fvc
::
grad
(
vsfT
)().
boundaryField
()[
patchi
]);
vectorgpuField
n
(
patch
().
nf
());
refValue
()
-=
3
.
0
*
pnu
/
(
4
.
0
*
pT
)
*
transform
(
I
-
n
*
n
,
gradpT
);
}
if
(
curvature_
)
{
const
fvPatchTensorgpuField
&
ptauMC
=
patch
().
lookupPatchField
<
volTensorgpuField
,
tensor
>
(
tauMCName_
);
vectorgpuField
n
(
patch
().
nf
());
refValue
()
-=
C1
/
prho
*
transform
(
I
-
n
*
n
,
(
n
&
ptauMC
));
}
partialSlipFvPatchVectorgpuField
::
updateCoeffs
();
}
void
Foam
::
maxwellSlipUFvPatchVectorgpuField
::
write
(
Ostream
&
os
)
const
{
fvPatchVectorgpuField
::
write
(
os
);
os
.
writeEntryIfDifferent
<
word
>
(
"T"
,
"T"
,
TName_
);
os
.
writeEntryIfDifferent
<
word
>
(
"rho"
,
"rho"
,
rhoName_
);
os
.
writeEntryIfDifferent
<
word
>
(
"psi"
,
"thermo:psi"
,
psiName_
);
os
.
writeEntryIfDifferent
<
word
>
(
"mu"
,
"thermo:mu"
,
muName_
);
os
.
writeEntryIfDifferent
<
word
>
(
"tauMC"
,
"tauMC"
,
tauMCName_
);
os
.
writeEntry
(
"accommodationCoeff"
,
accommodationCoeff_
);
Uwall_
.
writeEntry
(
"Uwall"
,
os
);
os
.
writeEntry
(
"thermalCreep"
,
thermalCreep_
);
os
.
writeEntry
(
"curvature"
,
curvature_
);
refValue
().
writeEntry
(
"refValue"
,
os
);
valueFraction
().
writeEntry
(
"valueFraction"
,
os
);
writeEntry
(
"value"
,
os
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
makePatchTypeField
(
fvPatchVectorgpuField
,
maxwellSlipUFvPatchVectorgpuField
);
}
// ************************************************************************* //
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/U/maxwellSlipUFvPatchVectorgpuField.H
0 → 100644
View file @
55e5a777
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2012 OpenFOAM Foundation
Copyright (C) 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/>.
Class
Foam::maxwellSlipUFvPatchVectorField
Description
Maxwell slip boundary condition including thermal creep and surface
curvature terms that can be optionally switched off.
SourceFiles
fixedRhoFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef maxwellSlipUFvPatchVectorgpuField_H
#define maxwellSlipUFvPatchVectorgpuField_H
#include "partialSlipFvPatchgpuFields.H"
#include "Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
/*---------------------------------------------------------------------------*\
Class maxwellSlipUFvPatch Declaration
\*---------------------------------------------------------------------------*/
class
maxwellSlipUFvPatchVectorgpuField
:
public
partialSlipFvPatchVectorgpuField
{
// Private data
//- Temperature field name, default = "T"
word
TName_
;
//- Density field name, default = "rho"
word
rhoName_
;
//- Compressibility field name, default = "thermo:psi"
word
psiName_
;
//- Dynamic viscosity field name, default = "thermo:mu"
word
muName_
;
//- tauMC field name, default = "tauMC"
word
tauMCName_
;
// Accommodation coefficient
scalar
accommodationCoeff_
;
// Wall velocity
vectorgpuField
Uwall_
;
// Include thermal creep term (default on)
Switch
thermalCreep_
;
// Include boundary curvature term (default on)
Switch
curvature_
;
public:
//- Runtime type information
TypeName
(
"maxwellSlipU"
);
// Constructors
//- Construct from patch and internal field
maxwellSlipUFvPatchVectorgpuField
(
const
gpufvPatch
&
,
const
DimensionedgpuField
<
vector
,
gpuvolMesh
>&
);
//- Construct from patch, internal field and dictionary
maxwellSlipUFvPatchVectorgpuField
(
const
gpufvPatch
&
,
const
DimensionedgpuField
<
vector
,
gpuvolMesh
>&
,
const
dictionary
&
);
//- Construct by mapping given
// maxwellSlipUFvPatchVectorField onto a new patch
maxwellSlipUFvPatchVectorgpuField
(
const
maxwellSlipUFvPatchVectorgpuField
&
,
const
gpufvPatch
&
,
const
DimensionedgpuField
<
vector
,
gpuvolMesh
>&
,
const
fvPatchgpuFieldMapper
&
);
//- Construct and return a clone
virtual
tmp
<
fvPatchVectorgpuField
>
clone
()
const
{
return
tmp
<
fvPatchVectorgpuField
>
(
new
maxwellSlipUFvPatchVectorgpuField
(
*
this
)
);
}
//- Construct as copy setting internal field reference
maxwellSlipUFvPatchVectorgpuField
(
const
maxwellSlipUFvPatchVectorgpuField
&
,
const
DimensionedgpuField
<
vector
,
gpuvolMesh
>&
);
//- Construct and return a clone setting internal field reference
virtual
tmp
<
fvPatchVectorgpuField
>
clone
(
const
DimensionedgpuField
<
vector
,
gpuvolMesh
>&
iF
)
const
{
return
tmp
<
fvPatchVectorgpuField
>
(
new
maxwellSlipUFvPatchVectorgpuField
(
*
this
,
iF
)
);
}
// Member functions
//- Update the coefficients associated with the patch field
virtual
void
updateCoeffs
();
//- Write
virtual
void
write
(
Ostream
&
)
const
;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/lnInclude/fixedRhoFvPatchScalargpuField.C
0 → 100644
View file @
55e5a777
..
/
rho
/
fixedRhoFvPatchScalargpuField
.
C
\ No newline at end of file
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/lnInclude/fixedRhoFvPatchScalargpuField.H
0 → 100644
View file @
55e5a777
..
/
rho
/
fixedRhoFvPatchScalargpuField
.
H
\ No newline at end of file
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/lnInclude/maxwellSlipUFvPatchVectorgpuField.C
0 → 100644
View file @
55e5a777
..
/
U
/
maxwellSlipUFvPatchVectorgpuField
.
C
\ No newline at end of file
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/lnInclude/maxwellSlipUFvPatchVectorgpuField.H
0 → 100644
View file @
55e5a777
..
/
U
/
maxwellSlipUFvPatchVectorgpuField
.
H
\ No newline at end of file
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/lnInclude/smoluchowskiJumpTFvPatchScalargpuField.C
0 → 100644
View file @
55e5a777
..
/
T
/
smoluchowskiJumpTFvPatchScalargpuField
.
C
\ No newline at end of file
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/lnInclude/smoluchowskiJumpTFvPatchScalargpuField.H
0 → 100644
View file @
55e5a777
..
/
T
/
smoluchowskiJumpTFvPatchScalargpuField
.
H
\ No newline at end of file
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/rho/fixedRhoFvPatchScalargpuField.C
0 → 100644
View file @
55e5a777
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2012 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/>.
\*---------------------------------------------------------------------------*/
#include "fixedRhoFvPatchScalargpuField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchgpuFieldMapper.H"
#include "volgpuFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam
::
fixedRhoFvPatchScalargpuField
::
fixedRhoFvPatchScalargpuField
(
const
gpufvPatch
&
p
,
const
DimensionedgpuField
<
scalar
,
gpuvolMesh
>&
iF
)
:
fixedValueFvPatchScalargpuField
(
p
,
iF
),
pName_
(
"p"
),
psiName_
(
"thermo:psi"
)
{}
Foam
::
fixedRhoFvPatchScalargpuField
::
fixedRhoFvPatchScalargpuField
(
const
fixedRhoFvPatchScalargpuField
&
ptf
,
const
gpufvPatch
&
p
,
const
DimensionedgpuField
<
scalar
,
gpuvolMesh
>&
iF
,
const
fvPatchgpuFieldMapper
&
mapper
)
:
fixedValueFvPatchScalargpuField
(
ptf
,
p
,
iF
,
mapper
),
pName_
(
ptf
.
pName_
),
psiName_
(
ptf
.
psiName_
)
{}
Foam
::
fixedRhoFvPatchScalargpuField
::
fixedRhoFvPatchScalargpuField
(
const
gpufvPatch
&
p
,
const
DimensionedgpuField
<
scalar
,
gpuvolMesh
>&
iF
,
const
dictionary
&
dict
)
:
fixedValueFvPatchScalargpuField
(
p
,
iF
,
dict
),
pName_
(
dict
.
getOrDefault
<
word
>
(
"p"
,
"p"
)),
psiName_
(
dict
.
getOrDefault
<
word
>
(
"psi"
,
"thermo:psi"
))
{}
Foam
::
fixedRhoFvPatchScalargpuField
::
fixedRhoFvPatchScalargpuField
(
const
fixedRhoFvPatchScalargpuField
&
frpsf
)
:
fixedValueFvPatchScalargpuField
(
frpsf
),
pName_
(
frpsf
.
pName_
),
psiName_
(
frpsf
.
psiName_
)
{}
Foam
::
fixedRhoFvPatchScalargpuField
::
fixedRhoFvPatchScalargpuField
(
const
fixedRhoFvPatchScalargpuField
&
frpsf
,
const
DimensionedgpuField
<
scalar
,
gpuvolMesh
>&
iF
)
:
fixedValueFvPatchScalargpuField
(
frpsf
,
iF
),
pName_
(
frpsf
.
pName_
),
psiName_
(
frpsf
.
psiName_
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void
Foam
::
fixedRhoFvPatchScalargpuField
::
updateCoeffs
()
{
if
(
updated
())
{
return
;
}
const
fvPatchgpuField
<
scalar
>&
psip
=
patch
().
lookupPatchField
<
volScalargpuField
,
scalar
>
(
psiName_
);
const
fvPatchgpuField
<
scalar
>&
pp
=
patch
().
lookupPatchField
<
volScalargpuField
,
scalar
>
(
pName_
);
operator
==
(
psip
*
pp
);
fixedValueFvPatchScalargpuField
::
updateCoeffs
();
}
void
Foam
::
fixedRhoFvPatchScalargpuField
::
write
(
Ostream
&
os
)
const
{
fvPatchScalargpuField
::
write
(
os
);
os
.
writeEntryIfDifferent
<
word
>
(
"p"
,
"p"
,
pName_
);
os
.
writeEntryIfDifferent
<
word
>
(
"psi"
,
"thermo:psi"
,
psiName_
);
writeEntry
(
"value"
,
os
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
makePatchTypeField
(
fvPatchScalargpuField
,
fixedRhoFvPatchScalargpuField
);
}
// ************************************************************************* //
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/BCs/rho/fixedRhoFvPatchScalargpuField.H
0 → 100644
View file @
55e5a777
/*---------------------------------------------------------------------------*\
========= |
\\ / 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/>.
Class
Foam::fixedRhoFvPatchScalarField
Group
grpInletBoundaryConditions
Description
Foam::fixedRhoFvPatchScalarField
This boundary condition provides a fixed density inlet condition for
compressible solvers, where the density of calculated using:
\f[
\rho = \psi p
\f]
where
\vartable
p | pressure [Pa]
\rho | density [kg/m3]
\endvartable
Usage
\table
Property | Description | Required | Default value
p | Pressure field name | no | p
psi | Compressibility field name | no | thermo:psi
\endtable
Example of the boundary condition specification:
\verbatim
<patchName>
{
type fixedRho;
}
\endverbatim
SourceFiles
fixedRhoFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef fixedRhoFvPatchScalargpuField_H
#define fixedRhoFvPatchScalargpuField_H
#include "fixedValueFvPatchgpuFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
/*---------------------------------------------------------------------------*\
Class fixedRhoFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class
fixedRhoFvPatchScalargpuField
:
public
fixedValueFvPatchScalargpuField
{
private:
// Private data
//- Pressure field name, default = "p"
word
pName_
;
//- Compressibility field name, default = "thermo:psi"
word
psiName_
;
public:
//- Runtime type information
TypeName
(
"fixedRho"
);
// Constructors
//- Construct from patch and internal field
fixedRhoFvPatchScalargpuField
(
const
gpufvPatch
&
,
const
DimensionedgpuField
<
scalar
,
gpuvolMesh
>&
);
//- Construct from patch, internal field and dictionary
fixedRhoFvPatchScalargpuField
(
const
gpufvPatch
&
,
const
DimensionedgpuField
<
scalar
,
gpuvolMesh
>&
,
const
dictionary
&
);
//- Construct by mapping given fixedRhoFvPatchScalarField
// onto a new patch
fixedRhoFvPatchScalargpuField
(
const
fixedRhoFvPatchScalargpuField
&
,
const
gpufvPatch
&
,
const
DimensionedgpuField
<
scalar
,
gpuvolMesh
>&
,
const
fvPatchgpuFieldMapper
&
);
//- Construct as copy
fixedRhoFvPatchScalargpuField
(
const
fixedRhoFvPatchScalargpuField
&
);
//- Construct and return a clone
virtual
tmp
<
fvPatchScalargpuField
>
clone
()
const
{
return
tmp
<
fvPatchScalargpuField
>
(
new
fixedRhoFvPatchScalargpuField
(
*
this
)
);
}
//- Construct as copy setting internal field reference
fixedRhoFvPatchScalargpuField
(
const
fixedRhoFvPatchScalargpuField
&
,
const
DimensionedgpuField
<
scalar
,
gpuvolMesh
>&
);
//- Construct and return a clone setting internal field reference
virtual
tmp
<
fvPatchScalargpuField
>
clone
(
const
DimensionedgpuField
<
scalar
,
gpuvolMesh
>&
iF
)
const
{
return
tmp
<
fvPatchScalargpuField
>
(
new
fixedRhoFvPatchScalargpuField
(
*
this
,
iF
)
);
}
// Member functions
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual
void
updateCoeffs
();
//- Write
virtual
void
write
(
Ostream
&
)
const
;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/Make/files
0 → 100644
View file @
55e5a777
rhoReactingCentralFoam.C
EXE = $(FOAM_APPBIN)/rhoReactingCentralFoam
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/Make/options
0 → 100644
View file @
55e5a777
EXE_INC = \
-IBCs/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/gpufiniteVolume/lnInclude \
-I$(LIB_SRC)/gpuOpenFOAM/lnInclude \
-I${LIB_SRC}/meshTools/lnInclude \
-I${LIB_SRC}/sampling/lnInclude \
-I$(LIB_SRC)/TurbulenceModels-GPU/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels-GPU/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels-GPU/specie/lnInclude \
-I$(LIB_SRC)/transportModels-GPU/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels-GPU/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels-GPU/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels-GPU/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels-GPU/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels-GPU/reactionThermo/lnInclude \
-I$(LIB_SRC)/combustionModels-GPU/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lgpufiniteVolume \
-lgpuOpenFOAM \
-lmeshTools \
-lsampling \
-lturbulenceModels-GPU \
-lcompressibleTurbulenceModels-GPU \
-lspecie-GPU \
-lcompressibleTransportModels-GPU \
-lfluidThermophysicalModels-GPU \
-lthermophysicalProperties-GPU \
-lreactionThermophysicalModels-GPU \
-lchemistryModel-GPU \
-lcombustionModels-GPU \
-lrhoCentralFoam-GPU \
-ldynamicFvMesh \
-ltopoChangerFvMesh
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/centralCourantNo.H
0 → 100644
View file @
55e5a777
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
centralCourantNo
Description
Calculates the mean and maximum wave speed based Courant Numbers.
\*---------------------------------------------------------------------------*/
if
(
devicemesh
.
hostmesh
().
nInternalFaces
())
{
scalargpuField
sumAmaxSf
(
fvc
::
surfaceSum
(
amaxSf
)().
primitiveField
());
CoNum
=
0
.
5
*
gMax
(
sumAmaxSf
/
devicemesh
.
V
().
field
())
*
runTime
.
deltaTValue
();
meanCoNum
=
0
.
5
*
(
gSum
(
sumAmaxSf
)
/
gSum
(
devicemesh
.
V
().
field
()))
*
runTime
.
deltaTValue
();
}
Info
<<
"Mean and max Courant Numbers = "
<<
meanCoNum
<<
" "
<<
CoNum
<<
endl
;
// ************************************************************************* //
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/createFieldRefs.H
0 → 100644
View file @
55e5a777
volScalargpuField
&
p
=
thermo
.
p
();
const
volScalargpuField
&
T
=
thermo
.
T
();
const
volScalargpuField
&
psi
=
thermo
.
psi
();
const
volScalargpuField
&
mu
=
thermo
.
mu
();
bool
inviscid
(
true
);
if
(
max
(
mu
.
primitiveField
())
>
0
.
0
)
{
inviscid
=
false
;
}
PtrList
<
volScalargpuField
>
DiffsY
(
Y
.
size
());
forAll
(
Y
,
i
)
{
DiffsY
.
set
(
i
,
new
volScalargpuField
(
IOobject
(
"DiffsY"
,
mesh
.
time
().
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
),
devicemesh
,
dimensionedScalar
(
"zero"
,
mu
.
dimensions
(),
0
.
0
),
zeroGradientFvPatchScalargpuField
::
typeName
)
);
}
PtrList
<
volScalargpuField
>
HsY
(
Y
.
size
());
forAll
(
Y
,
i
)
{
HsY
.
set
(
i
,
new
volScalargpuField
(
IOobject
(
"HsY"
,
mesh
.
time
().
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
),
devicemesh
,
dimensionedScalar
(
"zero"
,
e
.
dimensions
(),
0
.
0
),
zeroGradientFvPatchScalargpuField
::
typeName
)
);
}
OpenFOAM-v2112/applications/solvers/rhoReactingCentralFoam/createFields.H
0 → 100644
View file @
55e5a777
#include "gpucreateRDeltaT.H"
Info
<<
"Reading thermophysical properties
\n
"
<<
endl
;
autoPtr
<
psiReactionThermo
>
pThermo
(
psiReactionThermo
::
New
(
devicemesh
));
psiReactionThermo
&
thermo
=
pThermo
();
thermo
.
validate
(
args
.
executable
(),
"h"
,
"e"
);
/*autoPtr<psiThermo> pThermo
(
psiThermo::New(mesh)
);
psiThermo& thermo = pThermo();*/
// switch for cold flow or reacting flow
bool
SolveChemistry
=
readBool
(
runTime
.
controlDict
().
lookup
(
"SolveChemistry"
));
basicSpecieMixture
&
composition
=
thermo
.
composition
();
PtrList
<
volScalargpuField
>&
Y
=
composition
.
Y
();
const
word
inertSpecie
(
thermo
.
get
<
word
>
(
"inertSpecie"
));
if
(
!
composition
.
species
().
found
(
inertSpecie
))
{
FatalIOErrorIn
(
args
.
executable
().
c_str
(),
thermo
)
<<
"Inert specie "
<<
inertSpecie
<<
" not found in available species "
<<
composition
.
species
()
<<
exit
(
FatalIOError
);
}
volScalargpuField
&
e
=
thermo
.
he
();
Info
<<
"Reading field U
\n
"
<<
endl
;
volVectorgpuField
U
(
IOobject
(
"U"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
devicemesh
);
volScalargpuField
rho
(
IOobject
(
"rho"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
thermo
.
rho
()
);
volVectorgpuField
rhoU
(
IOobject
(
"rhoU"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
),
rho
*
U
);
volScalargpuField
rhoE
(
IOobject
(
"rhoE"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
),
rho
*
(
e
+
0
.
5
*
magSqr
(
U
))
);
surfaceScalargpuField
pos
(
IOobject
(
"pos"
,
runTime
.
timeName
(),
mesh
),
devicemesh
,
dimensionedScalar
(
"pos"
,
dimless
,
1
.
0
)
);
surfaceScalargpuField
neg
(
IOobject
(
"neg"
,
runTime
.
timeName
(),
mesh
),
devicemesh
,
dimensionedScalar
(
"neg"
,
dimless
,
-
1
.
0
)
);
surfaceScalargpuField
phi
(
"phi"
,
fvc
::
flux
(
rhoU
));
Info
<<
"Creating turbulence model
\n
"
<<
endl
;
autoPtr
<
compressible
::
turbulenceModel
>
turbulence
(
compressible
::
turbulenceModel
::
New
(
rho
,
U
,
phi
,
thermo
)
);
Info
<<
"Creating combustion model
\n
"
<<
endl
;
autoPtr
<
CombustionModel
<
psiReactionThermo
>>
combustion
(
CombustionModel
<
psiReactionThermo
>::
New
(
thermo
,
turbulence
())
);
gpumultivariateSurfaceInterpolationScheme
<
scalar
>::
fieldTable
fields
;
forAll
(
Y
,
i
)
{
fields
.
add
(
Y
[
i
]);
}
fields
.
add
(
thermo
.
he
());
Info
<<
"Creating field kinetic energy K
\n
"
<<
endl
;
volScalargpuField
K
(
"K"
,
0
.
5
*
magSqr
(
U
));
PtrList
<
volScalargpuField
>
rhoY
(
Y
.
size
());
forAll
(
Y
,
i
)
{
rhoY
.
set
(
i
,
new
volScalargpuField
(
IOobject
(
"rho"
+
Y
[
i
].
name
(),
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
),
rho
*
Y
[
i
]
)
);
}
volScalargpuField
Qdot
(
IOobject
(
"Qdot"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
devicemesh
,
dimensionedScalar
(
dimEnergy
/
dimVolume
/
dimTime
,
0
.
0
)
);
const
label
inertIndex
(
composition
.
species
()[
inertSpecie
]);
volScalargpuField
Yt
(
IOobject
(
"Yt"
,
mesh
.
time
().
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
),
devicemesh
,
dimensionedScalar
(
dimless
,
0
)
//,
);
Info
<<
"Reading transport properties"
<<
endl
;
IOdictionary
transportProperties
(
IOobject
(
"transportProperties"
,
runTime
.
constant
(),
runTime
,
IOobject
::
MUST_READ_IF_MODIFIED
,
IOobject
::
NO_WRITE
)
);
dictionary
Schmidt
(
transportProperties
.
subDict
(
"Sc"
));
scalarField
Sc
(
Y
.
size
(),
0
.
75
);
forAll
(
Sc
,
i
)
{
const
word
&
name
=
Y
[
i
].
name
();
if
(
Schmidt
.
found
(
name
))
{
Sc
[
i
]
=
readScalar
(
Schmidt
.
lookup
(
name
));
}
}
const
scalar
Sct
(
Schmidt
.
lookupOrDefault
<
scalar
>
(
"Sct"
,
0
.
7
));
Prev
1
2
3
4
5
6
7
8
…
34
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