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
813 additions
and
0 deletions
+813
-0
applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/storeOldFluidFields.H
...atTransfer/chtMultiRegionFoam/fluid/storeOldFluidFields.H
+2
-0
applications/solvers/heatTransfer/chtMultiRegionFoam/include/correctThermos.H
.../heatTransfer/chtMultiRegionFoam/include/correctThermos.H
+20
-0
applications/solvers/heatTransfer/chtMultiRegionFoam/include/createCoupledRegions.H
...ransfer/chtMultiRegionFoam/include/createCoupledRegions.H
+69
-0
applications/solvers/heatTransfer/chtMultiRegionFoam/include/setInitialMultiRegionDeltaT.H
.../chtMultiRegionFoam/include/setInitialMultiRegionDeltaT.H
+60
-0
applications/solvers/heatTransfer/chtMultiRegionFoam/include/setMultiRegionDeltaT.H
...ransfer/chtMultiRegionFoam/include/setMultiRegionDeltaT.H
+70
-0
applications/solvers/heatTransfer/chtMultiRegionFoam/readPIMPLEControls.H
...vers/heatTransfer/chtMultiRegionFoam/readPIMPLEControls.H
+8
-0
applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H
...heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H
+111
-0
applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidMeshes.H
...heatTransfer/chtMultiRegionFoam/solid/createSolidMeshes.H
+29
-0
applications/solvers/heatTransfer/chtMultiRegionFoam/solid/readSolidMultiRegionPIMPLEControls.H
...ultiRegionFoam/solid/readSolidMultiRegionPIMPLEControls.H
+4
-0
applications/solvers/heatTransfer/chtMultiRegionFoam/solid/readSolidTimeControls.H
...Transfer/chtMultiRegionFoam/solid/readSolidTimeControls.H
+37
-0
applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H
...tTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H
+37
-0
applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.C
...heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.C
+58
-0
applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.H
...heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.H
+50
-0
applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffusionNo.H
...ransfer/chtMultiRegionFoam/solid/solidRegionDiffusionNo.H
+37
-0
applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H
...olvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H
+45
-0
applications/solvers/heatTransfer/heatTransferSolversDoc.H
applications/solvers/heatTransfer/heatTransferSolversDoc.H
+32
-0
applications/solvers/heatTransfer/solidFoam/Make/files
applications/solvers/heatTransfer/solidFoam/Make/files
+3
-0
applications/solvers/heatTransfer/solidFoam/Make/options
applications/solvers/heatTransfer/solidFoam/Make/options
+24
-0
applications/solvers/heatTransfer/solidFoam/createFieldRefs.H
...ications/solvers/heatTransfer/solidFoam/createFieldRefs.H
+4
-0
applications/solvers/heatTransfer/solidFoam/createFields.H
applications/solvers/heatTransfer/solidFoam/createFields.H
+113
-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/heatTransfer/chtMultiRegionFoam/fluid/storeOldFluidFields.H
0 → 100644
View file @
ea17556c
p_rghFluid
[
i
].
storePrevIter
();
rhoFluid
[
i
].
storePrevIter
();
applications/solvers/heatTransfer/chtMultiRegionFoam/include/correctThermos.H
0 → 100644
View file @
ea17556c
forAll
(
fluidRegions
,
i
)
{
rhoThermo
&
thermo
=
thermoFluid
[
i
];
radiation
::
radiationModel
&
rad
=
radiation
[
i
];
fv
::
options
&
fvOptions
=
fluidFvOptions
[
i
];
volScalarField
&
he
=
thermo
.
he
();
fvOptions
.
correct
(
he
);
thermo
.
correct
();
rad
.
correct
();
}
forAll
(
solidRegions
,
i
)
{
solidThermo
&
thermo
=
thermos
[
i
];
fv
::
options
&
fvOptions
=
solidHeatSources
[
i
];
volScalarField
&
h
=
thermo
.
he
();
fvOptions
.
correct
(
h
);
thermo
.
correct
();
}
applications/solvers/heatTransfer/chtMultiRegionFoam/include/createCoupledRegions.H
0 → 100644
View file @
ea17556c
fvSolution
solutionDict
(
runTime
);
bool
coupled
(
solutionDict
.
getOrDefault
(
"coupledEnergyField"
,
false
));
autoPtr
<
fvMatrix
<
scalar
>>
fvMatrixAssemblyPtr
;
forAll
(
fluidRegions
,
i
)
{
const
rhoThermo
&
thermo
=
refCast
<
const
rhoThermo
>
(
thermoFluid
[
i
]);
const
auto
&
bpsi
=
thermo
.
T
().
boundaryField
();
forAll
(
bpsi
,
patchI
)
{
if
(
bpsi
[
patchI
].
useImplicit
())
{
coupled
=
true
;
}
}
}
forAll
(
solidRegions
,
i
)
{
solidThermo
&
thermo
=
thermos
[
i
];
const
auto
&
bpsi
=
thermo
.
T
().
boundaryField
();
forAll
(
bpsi
,
patchI
)
{
if
(
bpsi
[
patchI
].
useImplicit
())
{
coupled
=
true
;
}
}
}
forAll
(
fluidRegions
,
i
)
{
const
rhoThermo
&
thermo
=
refCast
<
const
rhoThermo
>
(
thermoFluid
[
i
]);
if
(
coupled
)
{
Info
<<
"Create fvMatrixAssembly."
<<
endl
;
fvMatrixAssemblyPtr
.
reset
(
new
fvMatrix
<
scalar
>
(
thermo
.
he
(),
dimEnergy
/
dimTime
)
);
break
;
}
}
if
(
coupled
&&
!
fvMatrixAssemblyPtr
)
{
forAll
(
solidRegions
,
i
)
{
solidThermo
&
thermo
=
thermos
[
i
];
Info
<<
"Create fvMatrixAssembly."
<<
endl
;
fvMatrixAssemblyPtr
.
reset
(
new
fvMatrix
<
scalar
>
(
thermo
.
he
(),
dimEnergy
/
dimTime
)
);
break
;
}
}
applications/solvers/heatTransfer/chtMultiRegionFoam/include/setInitialMultiRegionDeltaT.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
setInitialMultiRegionDeltaT
Description
Set the initial timestep for the CHT MultiRegion solver.
\*---------------------------------------------------------------------------*/
if
(
adjustTimeStep
)
{
if
((
runTime
.
timeIndex
()
==
0
)
&&
((
CoNum
>
SMALL
)
||
(
DiNum
>
SMALL
)))
{
if
(
CoNum
<
SMALL
)
{
CoNum
=
SMALL
;
}
if
(
DiNum
<
SMALL
)
{
DiNum
=
SMALL
;
}
runTime
.
setDeltaT
(
min
(
min
(
maxCo
/
CoNum
,
maxDi
/
DiNum
)
*
runTime
.
deltaT
().
value
(),
min
(
runTime
.
deltaTValue
(),
maxDeltaT
)
)
);
Info
<<
"deltaT = "
<<
runTime
.
deltaT
().
value
()
<<
endl
;
}
}
// ************************************************************************* //
applications/solvers/heatTransfer/chtMultiRegionFoam/include/setMultiRegionDeltaT.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
-------------------------------------------------------------------------------
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
setMultiRegionDeltaT
Description
Reset the timestep to maintain a constant maximum courant and
diffusion Numbers. Reduction of time-step is immediate, but
increase is damped to avoid unstable oscillations.
\*---------------------------------------------------------------------------*/
if
(
adjustTimeStep
)
{
if
(
CoNum
==
-
GREAT
)
{
CoNum
=
SMALL
;
}
if
(
DiNum
==
-
GREAT
)
{
DiNum
=
SMALL
;
}
scalar
maxDeltaTFluid
=
maxCo
/
(
CoNum
+
SMALL
);
scalar
maxDeltaTSolid
=
maxDi
/
(
DiNum
+
SMALL
);
scalar
deltaTFluid
=
min
(
min
(
maxDeltaTFluid
,
1
.
0
+
0
.
1
*
maxDeltaTFluid
),
1
.
2
);
runTime
.
setDeltaT
(
min
(
min
(
deltaTFluid
,
maxDeltaTSolid
)
*
runTime
.
deltaT
().
value
(),
maxDeltaT
)
);
Info
<<
"deltaT = "
<<
runTime
.
deltaT
().
value
()
<<
endl
;
}
// ************************************************************************* //
applications/solvers/heatTransfer/chtMultiRegionFoam/readPIMPLEControls.H
0 → 100644
View file @
ea17556c
// We do not have a top-level mesh. Construct the fvSolution for
// the runTime instead.
fvSolution
solutionDict
(
runTime
);
const
dictionary
&
pimple
=
solutionDict
.
subDict
(
"PIMPLE"
);
const
int
nOuterCorr
=
pimple
.
getOrDefault
<
int
>
(
"nOuterCorrectors"
,
1
);
applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H
0 → 100644
View file @
ea17556c
// Initialise solid field pointer lists
PtrList
<
coordinateSystem
>
coordinates
(
solidRegions
.
size
());
PtrList
<
solidThermo
>
thermos
(
solidRegions
.
size
());
PtrList
<
radiation
::
radiationModel
>
radiations
(
solidRegions
.
size
());
PtrList
<
fv
::
options
>
solidHeatSources
(
solidRegions
.
size
());
PtrList
<
volScalarField
>
betavSolid
(
solidRegions
.
size
());
PtrList
<
volSymmTensorField
>
aniAlphas
(
solidRegions
.
size
());
// Populate solid field pointer lists
forAll
(
solidRegions
,
i
)
{
Info
<<
"*** Reading solid mesh thermophysical properties for region "
<<
solidRegions
[
i
].
name
()
<<
nl
<<
endl
;
Info
<<
" Adding to thermos
\n
"
<<
endl
;
thermos
.
set
(
i
,
solidThermo
::
New
(
solidRegions
[
i
]));
Info
<<
" Adding to radiations
\n
"
<<
endl
;
radiations
.
set
(
i
,
radiation
::
radiationModel
::
New
(
thermos
[
i
].
T
()));
Info
<<
" Adding fvOptions
\n
"
<<
endl
;
solidHeatSources
.
set
(
i
,
new
fv
::
options
(
solidRegions
[
i
])
);
if
(
!
thermos
[
i
].
isotropic
())
{
Info
<<
" Adding coordinateSystems
\n
"
<<
endl
;
coordinates
.
set
(
i
,
coordinateSystem
::
New
(
solidRegions
[
i
],
thermos
[
i
],
coordinateSystem
::
typeName_
()
)
);
tmp
<
volVectorField
>
tkappaByCp
=
thermos
[
i
].
Kappa
()
/
thermos
[
i
].
Cp
();
aniAlphas
.
set
(
i
,
new
volSymmTensorField
(
IOobject
(
"Anialpha"
,
runTime
.
timeName
(),
solidRegions
[
i
],
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
),
solidRegions
[
i
],
dimensionedSymmTensor
(
tkappaByCp
().
dimensions
(),
Zero
),
zeroGradientFvPatchSymmTensorField
::
typeName
)
);
aniAlphas
[
i
].
primitiveFieldRef
()
=
coordinates
[
i
].
transformPrincipal
(
solidRegions
[
i
].
cellCentres
(),
tkappaByCp
()
);
aniAlphas
[
i
].
correctBoundaryConditions
();
}
IOobject
betavSolidIO
(
"betavSolid"
,
runTime
.
timeName
(),
solidRegions
[
i
],
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
);
if
(
betavSolidIO
.
typeHeaderOk
<
volScalarField
>
(
true
))
{
betavSolid
.
set
(
i
,
new
volScalarField
(
betavSolidIO
,
solidRegions
[
i
])
);
}
else
{
betavSolid
.
set
(
i
,
new
volScalarField
(
IOobject
(
"betavSolid"
,
runTime
.
timeName
(),
solidRegions
[
i
],
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
),
solidRegions
[
i
],
dimensionedScalar
(
"1"
,
dimless
,
scalar
(
1
))
)
);
}
}
applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidMeshes.H
0 → 100644
View file @
ea17556c
const
wordList
solidNames
(
rp
[
"solid"
]);
PtrList
<
fvMesh
>
solidRegions
(
solidNames
.
size
());
forAll
(
solidNames
,
i
)
{
Info
<<
"Create solid mesh for region "
<<
solidNames
[
i
]
<<
" for time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
solidRegions
.
set
(
i
,
new
fvMesh
(
IOobject
(
solidNames
[
i
],
runTime
.
timeName
(),
runTime
,
IOobject
::
MUST_READ
)
)
);
// Force calculation of geometric properties to prevent it being done
// later in e.g. some boundary evaluation
//(void)solidRegions[i].weights();
//(void)solidRegions[i].deltaCoeffs();
}
applications/solvers/heatTransfer/chtMultiRegionFoam/solid/readSolidMultiRegionPIMPLEControls.H
0 → 100644
View file @
ea17556c
const
dictionary
&
pimple
=
mesh
.
solutionDict
().
subDict
(
"PIMPLE"
);
int
nNonOrthCorr
=
pimple
.
getOrDefault
<
int
>
(
"nNonOrthogonalCorrectors"
,
0
);
applications/solvers/heatTransfer/chtMultiRegionFoam/solid/readSolidTimeControls.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) 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/>.
Global
readSolidTimeControls
Description
Read the control parameters used in the solid
\*---------------------------------------------------------------------------*/
scalar
maxDi
=
runTime
.
controlDict
().
getOrDefault
<
scalar
>
(
"maxDi"
,
10
);
// ************************************************************************* //
applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H
0 → 100644
View file @
ea17556c
fvMesh
&
mesh
=
solidRegions
[
i
];
solidThermo
&
thermo
=
thermos
[
i
];
tmp
<
volScalarField
>
trho
=
thermo
.
rho
();
const
volScalarField
&
rho
=
trho
();
tmp
<
volScalarField
>
tcp
=
thermo
.
Cp
();
const
volScalarField
&
cp
=
tcp
();
tmp
<
volSymmTensorField
>
taniAlpha
;
if
(
!
thermo
.
isotropic
())
{
volSymmTensorField
&
aniAlpha
=
aniAlphas
[
i
];
tmp
<
volVectorField
>
tkappaByCp
=
thermo
.
Kappa
()
/
cp
;
const
coordinateSystem
&
coodSys
=
coordinates
[
i
];
aniAlpha
.
primitiveFieldRef
()
=
coodSys
.
transformPrincipal
(
mesh
.
cellCentres
(),
tkappaByCp
()
);
aniAlpha
.
correctBoundaryConditions
();
taniAlpha
=
tmp
<
volSymmTensorField
>
(
new
volSymmTensorField
(
aniAlpha
)
);
}
volScalarField
&
h
=
thermo
.
he
();
const
volScalarField
&
betav
=
betavSolid
[
i
];
fv
::
options
&
fvOptions
=
solidHeatSources
[
i
];
applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.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/>.
\*---------------------------------------------------------------------------*/
#include "solidRegionDiffNo.H"
#include "surfaceInterpolate.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam
::
scalar
Foam
::
solidRegionDiffNo
(
const
fvMesh
&
mesh
,
const
Time
&
runTime
,
const
volScalarField
&
Cprho
,
const
volScalarField
&
kappa
)
{
surfaceScalarField
kapparhoCpbyDelta
(
sqr
(
mesh
.
surfaceInterpolation
::
deltaCoeffs
())
*
fvc
::
interpolate
(
kappa
)
/
fvc
::
interpolate
(
Cprho
)
);
const
scalar
DiNum
=
max
(
kapparhoCpbyDelta
).
value
()
*
runTime
.
deltaTValue
();
const
scalar
meanDiNum
=
average
(
kapparhoCpbyDelta
).
value
()
*
runTime
.
deltaTValue
();
Info
<<
"Region: "
<<
mesh
.
name
()
<<
" Diffusion Number mean: "
<<
meanDiNum
<<
" max: "
<<
DiNum
<<
endl
;
return
DiNum
;
}
// ************************************************************************* //
applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.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-2013 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/>.
Description
Calculates and outputs the mean and maximum Diffusion Numbers for the solid
regions
\*---------------------------------------------------------------------------*/
#ifndef solidRegionDiffNo_H
#define solidRegionDiffNo_H
#include "fvMesh.H"
namespace
Foam
{
scalar
solidRegionDiffNo
(
const
fvMesh
&
mesh
,
const
Time
&
runTime
,
const
volScalarField
&
Cprho
,
const
volScalarField
&
kappa
);
}
#endif
// ************************************************************************* //
applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffusionNo.H
0 → 100644
View file @
ea17556c
scalar
DiNum
=
-
GREAT
;
forAll
(
solidRegions
,
i
)
{
//- Note: do not use setRegionSolidFields.H to avoid double registering Cp
//#include "setRegionSolidFields.H"
const
solidThermo
&
thermo
=
thermos
[
i
];
tmp
<
volScalarField
>
magKappa
;
if
(
thermo
.
isotropic
())
{
magKappa
=
thermo
.
kappa
();
}
else
{
magKappa
=
mag
(
thermo
.
Kappa
());
}
tmp
<
volScalarField
>
tcp
=
thermo
.
Cp
();
const
volScalarField
&
cp
=
tcp
();
tmp
<
volScalarField
>
trho
=
thermo
.
rho
();
const
volScalarField
&
rho
=
trho
();
DiNum
=
max
(
solidRegionDiffNo
(
solidRegions
[
i
],
runTime
,
rho
*
cp
,
magKappa
()
),
DiNum
);
}
applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H
0 → 100644
View file @
ea17556c
{
fvScalarMatrix
hEqn
(
fvm
::
ddt
(
betav
*
rho
,
h
)
-
(
thermo
.
isotropic
()
?
fvm
::
laplacian
(
betav
*
thermo
.
alpha
(),
h
,
"laplacian(alpha,h)"
)
:
fvm
::
laplacian
(
betav
*
taniAlpha
(),
h
,
"laplacian(alpha,h)"
)
)
==
fvOptions
(
rho
,
h
)
);
hEqn
.
relax
();
fvOptions
.
constrain
(
hEqn
);
if
(
coupled
)
{
fvMatrixAssemblyPtr
->
addFvMatrix
(
hEqn
);
}
else
{
Info
<<
"
\n
Solving for solid region "
<<
solidRegions
[
i
].
name
()
<<
endl
;
if
(
finalIter
)
{
mesh
.
data
::
add
(
"finalIteration"
,
true
);
}
hEqn
.
solve
(
mesh
.
solver
(
h
.
select
(
finalIter
)));
fvOptions
.
correct
(
h
);
thermo
.
correct
();
Info
<<
"Min/max T:"
<<
min
(
thermo
.
T
()).
value
()
<<
' '
<<
max
(
thermo
.
T
()).
value
()
<<
endl
;
if
(
finalIter
)
{
mesh
.
data
::
remove
(
"finalIteration"
);
}
}
}
applications/solvers/heatTransfer/heatTransferSolversDoc.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 grpHeatTransferSolvers Heat transfer solvers
@{
\ingroup grpSolvers
This group contains heat transfer solvers.
@}
\*---------------------------------------------------------------------------*/
applications/solvers/heatTransfer/solidFoam/Make/files
0 → 100644
View file @
ea17556c
solidFoam.C
EXE = $(FOAM_APPBIN)/solidFoam
applications/solvers/heatTransfer/solidFoam/Make/options
0 → 100644
View file @
ea17556c
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-ldynamicMesh \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lsolidThermo \
-lradiationModels \
-lspecie
applications/solvers/heatTransfer/solidFoam/createFieldRefs.H
0 → 100644
View file @
ea17556c
const
volScalarField
&
rho
=
trho
();
volScalarField
&
h
=
thermo
.
he
();
const
volScalarField
&
betav
=
*
betavPtr
;
applications/solvers/heatTransfer/solidFoam/createFields.H
0 → 100644
View file @
ea17556c
Info
<<
"Reading thermophysical properties
\n
"
<<
endl
;
autoPtr
<
solidThermo
>
pThermo
(
solidThermo
::
New
(
mesh
));
solidThermo
&
thermo
=
pThermo
();
tmp
<
volScalarField
>
trho
=
thermo
.
rho
();
autoPtr
<
coordinateSystem
>
coordinatesPtr
;
autoPtr
<
volSymmTensorField
>
taniAlpha
;
if
(
!
thermo
.
isotropic
())
{
Info
<<
"Adding coordinateSystem
\n
"
<<
endl
;
coordinatesPtr
=
coordinateSystem
::
New
(
mesh
,
thermo
,
coordinateSystem
::
typeName_
()
);
tmp
<
volVectorField
>
tkappaByCp
=
thermo
.
Kappa
()
/
thermo
.
Cp
();
taniAlpha
.
reset
(
new
volSymmTensorField
(
IOobject
(
"Anialpha"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
),
mesh
,
dimensionedSymmTensor
(
tkappaByCp
().
dimensions
(),
Zero
),
zeroGradientFvPatchSymmTensorField
::
typeName
)
);
volSymmTensorField
&
aniAlpha
=
*
taniAlpha
;
aniAlpha
.
primitiveFieldRef
()
=
coordinatesPtr
->
transformPrincipal
(
mesh
.
cellCentres
(),
tkappaByCp
()
);
aniAlpha
.
correctBoundaryConditions
();
}
IOobject
betavSolidIO
(
"betavSolid"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
);
autoPtr
<
volScalarField
>
betavPtr
;
if
(
betavSolidIO
.
typeHeaderOk
<
volScalarField
>
(
true
))
{
betavPtr
.
reset
(
new
volScalarField
(
betavSolidIO
,
mesh
)
);
}
else
{
betavPtr
.
reset
(
new
volScalarField
(
IOobject
(
"betavSolid"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
),
mesh
,
dimensionedScalar
(
"1"
,
dimless
,
scalar
(
1
))
)
);
}
// Consider mesh flux to correct for mesh deformation
bool
meshFluxCorr
(
false
);
if
(
mesh
.
solutionDict
().
found
(
"SIMPLE"
))
{
meshFluxCorr
=
mesh
.
solutionDict
().
subDict
(
"SIMPLE"
).
getOrDefault
<
bool
>
(
"meshFluxCorrection"
,
false
);
}
else
if
(
mesh
.
solutionDict
().
found
(
"PIMPLE"
))
{
meshFluxCorr
=
mesh
.
solutionDict
().
subDict
(
"PIMPLE"
).
getOrDefault
<
bool
>
(
"meshFluxCorrection"
,
false
);
}
#include "createRadiationModel.H"
#include "createFvOptions.H"
Prev
1
…
18
19
20
21
22
23
24
25
26
…
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