Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
9887c8f5
Commit
9887c8f5
authored
Aug 10, 2017
by
sergio
Committed by
Andrew Heather
Aug 10, 2017
Browse files
ENH: adding thermo changes to handle multiphase T based thermos
parent
017213de
Changes
45
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/Make/options
View file @
9887c8f5
EXE_INC = -I$(OBJECTS_DIR)
EXE_INC = \
-I$(OBJECTS_DIR)
LIB_LIBS = \
$(FOAM_LIBBIN)/libOSspecific.o \
...
...
src/OpenFOAM/primitives/functions/Function1/Constant/Constant.C
View file @
9887c8f5
...
...
@@ -95,7 +95,18 @@ Foam::tmp<Foam::Field<Type>> Foam::Function1Types::Constant<Type>::value
template
<
class
Type
>
<<<<<<<
HEAD
Foam
::
tmp
<
Foam
::
Field
<
Type
>>
Foam
::
Function1Types
::
Constant
<
Type
>::
integrate
=======
bool
Foam
::
Function1Types
::
Constant
<
Type
>::
isConstant
()
const
{
return
true
;
}
template
<
class
Type
>
Type
Foam
::
Function1Types
::
Constant
<
Type
>::
integrate
>>>>>>>
c61dc5e
...
ENH
:
adding
thermo
changes
to
handle
multiphase
T
based
thermos
(
const
scalarField
&
x1
,
const
scalarField
&
x2
...
...
@@ -104,7 +115,6 @@ Foam::tmp<Foam::Field<Type>> Foam::Function1Types::Constant<Type>::integrate
return
(
x2
-
x1
)
*
value_
;
}
template
<
class
Type
>
void
Foam
::
Function1Types
::
Constant
<
Type
>::
writeData
(
Ostream
&
os
)
const
{
...
...
src/OpenFOAM/primitives/functions/Function1/Constant/Constant.H
View file @
9887c8f5
...
...
@@ -121,6 +121,9 @@ public:
const
scalarField
&
x2
)
const
;
//- Return true for Constant type
virtual
bool
isConstant
()
const
;
//- Write in dictionary format
virtual
void
writeData
(
Ostream
&
os
)
const
;
};
...
...
src/OpenFOAM/primitives/functions/Function1/Function1/Function1.C
View file @
9887c8f5
...
...
@@ -157,6 +157,13 @@ Foam::FieldFunction1<Function1Type>::integrate
}
template
<
class
Type
>
bool
Foam
::
Function1
<
Type
>::
isConstant
()
const
{
return
false
;
}
template
<
class
Type
>
void
Foam
::
Function1
<
Type
>::
writeData
(
Ostream
&
os
)
const
{
...
...
src/OpenFOAM/primitives/functions/Function1/Function1/Function1.H
View file @
9887c8f5
...
...
@@ -154,6 +154,9 @@ public:
const
scalarField
&
x2
)
const
;
//- Return true for Constant type
virtual
bool
isConstant
()
const
;
// I/O
...
...
src/OpenFOAM/primitives/functions/Function1/makeDataEntries.C
0 → 100644
View file @
9887c8f5
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
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
"Constant.H"
#include
"PolynomialEntry.H"
#include
"Sine.H"
#include
"Square.H"
#include
"CSV.H"
#include
"Table.H"
#include
"TableFile.H"
#include
"fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeFunction1s(Type) \
makeFunction1(Type); \
makeFunction1Type(Constant, Type); \
makeFunction1Type(Polynomial, Type); \
makeFunction1Type(Sine, Type); \
makeFunction1Type(Square, Type); \
makeFunction1Type(CSV, Type); \
makeFunction1Type(Table, Type); \
makeFunction1Type(TableFile, Type);
namespace
Foam
{
makeFunction1
(
label
);
//makeFunction1Type(Constant, label);
// Polynomial functions and interpolation do evaluate to label
// Instead evaluate a scalar and convert to label as appropriate
makeFunction1s
(
scalar
);
makeFunction1s
(
vector
);
makeFunction1s
(
sphericalTensor
);
makeFunction1s
(
symmTensor
);
makeFunction1s
(
tensor
);
}
// ************************************************************************* //
src/OpenFOAM/primitives/functions/TimeFunction1/TimeFunction1.C
View file @
9887c8f5
...
...
@@ -119,6 +119,12 @@ Type Foam::TimeFunction1<Type>::integrate
}
template
<
class
Type
>
bool
Foam
::
TimeFunction1
<
Type
>::
isConstant
()
const
{
return
entry_
->
isConstant
();
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template
<
class
Type
>
...
...
src/OpenFOAM/primitives/functions/TimeFunction1/TimeFunction1.H
View file @
9887c8f5
...
...
@@ -121,6 +121,9 @@ public:
//- Integrate between two (scalar) values
virtual
Type
integrate
(
const
scalar
x1
,
const
scalar
x2
)
const
;
//- Return true for Constant type
virtual
bool
isConstant
()
const
;
// I/O
...
...
src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C
View file @
9887c8f5
...
...
@@ -2,8 +2,8 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-201
7
OpenFOAM Foundation
\\/ M anipulation |
\\ / A nd | Copyright (C) 2011-201
6
OpenFOAM Foundation
\\/ M anipulation |
Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -167,6 +167,13 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
return
thermo
.
kappa
(
patchi
);
}
else
if
(
mesh
.
foundObject
<
basicThermo
>
(
"phaseProperties"
))
{
const
basicThermo
&
thermo
=
mesh
.
lookupObject
<
basicThermo
>
(
"phaseProperties"
);
return
thermo
.
kappa
(
patchi
);
}
else
{
FatalErrorInFunction
...
...
src/regionModels/pyrolysisModels/Make/options
View file @
9887c8f5
...
...
@@ -10,7 +10,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude
LIB_LIBS = \
-lfiniteVolume \
...
...
src/thermophysicalModels/basic/basicThermo/basicThermo.C
View file @
9887c8f5
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-201
7
OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-201
6
OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
...
...
@@ -40,6 +40,7 @@ namespace Foam
{
defineTypeNameAndDebug
(
basicThermo
,
0
);
defineRunTimeSelectionTable
(
basicThermo
,
fvMesh
);
defineRunTimeSelectionTable
(
basicThermo
,
fvMeshDictPhase
);
}
const
Foam
::
word
Foam
::
basicThermo
::
dictName
(
"thermophysicalProperties"
);
...
...
@@ -125,7 +126,7 @@ Foam::wordList Foam::basicThermo::heBoundaryTypes()
Foam
::
volScalarField
&
Foam
::
basicThermo
::
lookupOrConstruct
(
const
fvMesh
&
mesh
,
const
char
*
name
const
word
&
name
)
const
{
if
(
!
mesh
.
objectRegistry
::
foundObject
<
volScalarField
>
(
name
))
...
...
@@ -188,18 +189,7 @@ Foam::basicThermo::basicThermo
p_
(
lookupOrConstruct
(
mesh
,
"p"
)),
T_
(
IOobject
(
phasePropertyName
(
"T"
),
mesh
.
time
().
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
),
T_
(
lookupOrConstruct
(
mesh
,
phasePropertyName
(
"T"
))),
alpha_
(
...
...
@@ -220,7 +210,9 @@ Foam::basicThermo::basicThermo
)
),
dpdt_
(
lookupOrDefault
<
Switch
>
(
"dpdt"
,
true
))
dpdt_
(
lookupOrDefault
<
Switch
>
(
"dpdt"
,
true
)),
tempBased_
(
lookupOrDefault
<
Switch
>
(
"tempBased"
,
false
))
{}
...
...
@@ -248,24 +240,60 @@ Foam::basicThermo::basicThermo
p_
(
lookupOrConstruct
(
mesh
,
"p"
)),
T_
T_
(
lookupOrConstruct
(
mesh
,
phasePropertyName
(
"T"
))),
alpha_
(
IOobject
(
phasePropertyName
(
"
T
"
),
phasePropertyName
(
"
thermo:alpha
"
),
mesh
.
time
().
timeName
(),
mesh
,
IOobject
::
MUST
_READ
,
IOobject
::
AUT
O_WRITE
IOobject
::
NO
_READ
,
IOobject
::
N
O_WRITE
),
mesh
mesh
,
dimensionedScalar
(
"zero"
,
dimensionSet
(
1
,
-
1
,
-
1
,
0
,
0
),
Zero
)
),
tempBased_
(
lookupOrDefault
<
Switch
>
(
"tempBased"
,
false
))
{}
Foam
::
basicThermo
::
basicThermo
(
const
fvMesh
&
mesh
,
const
word
&
phaseName
,
const
word
&
dictionaryName
)
:
IOdictionary
(
IOobject
(
dictionaryName
,
mesh
.
time
().
constant
(),
mesh
,
IOobject
::
MUST_READ_IF_MODIFIED
,
IOobject
::
NO_WRITE
)
),
phaseName_
(
phaseName
),
p_
(
lookupOrConstruct
(
mesh
,
"p"
)),
T_
(
lookupOrConstruct
(
mesh
,
"T"
)),
alpha_
(
IOobject
(
phasePropertyName
(
"thermo:alpha"
)
,
"thermo:alpha"
,
mesh
.
time
().
timeName
(),
mesh
,
IOobject
::
READ_IF_PRESENT
,
...
...
@@ -278,7 +306,11 @@ Foam::basicThermo::basicThermo
dimensionSet
(
1
,
-
1
,
-
1
,
0
,
0
),
Zero
)
)
),
dpdt_
(
lookupOrDefault
<
Switch
>
(
"dpdt"
,
true
)),
tempBased_
(
lookupOrDefault
<
Switch
>
(
"tempBased"
,
true
))
{}
...
...
src/thermophysicalModels/basic/basicThermo/basicThermo.H
View file @
9887c8f5
...
...
@@ -69,7 +69,7 @@ protected:
volScalarField
&
p_
;
//- Temperature [K]
volScalarField
T_
;
volScalarField
&
T_
;
//- Laminar thermal diffusivity [kg/m/s]
volScalarField
alpha_
;
...
...
@@ -77,6 +77,9 @@ protected:
//- Should the dpdt term be included in the enthalpy equation
Switch
dpdt_
;
//- Temperature based thermo
Switch
tempBased_
;
// Protected Member Functions
...
...
@@ -87,7 +90,7 @@ protected:
volScalarField
&
lookupOrConstruct
(
const
fvMesh
&
mesh
,
const
char
*
name
const
word
&
)
const
;
//- Lookup and check out field
...
...
@@ -119,6 +122,17 @@ public:
);
//- Declare run-time constructor selection table for dictionary based
declareRunTimeSelectionTable
(
autoPtr
,
basicThermo
,
fvMeshDictPhase
,
(
const
fvMesh
&
mesh
,
const
word
&
phaseName
,
const
word
&
dictName
),
(
mesh
,
phaseName
,
dictName
)
);
// Constructors
//- Construct from mesh and phase name
...
...
@@ -136,6 +150,15 @@ public:
const
word
&
phaseName
);
//- Construct from mesh,dictionary,phase name with a single temperature
// solved on the top level solver (tempBased = true)
basicThermo
(
const
fvMesh
&
,
const
word
&
phaseName
,
const
word
&
dictionaryName
);
// Selectors
...
...
@@ -175,6 +198,15 @@ public:
const
word
&
phaseName
=
word
::
null
);
//- Generic New for each of the related thermodynamics packages
template
<
class
Thermo
>
static
autoPtr
<
Thermo
>
New
(
const
fvMesh
&
,
const
word
&
phaseName
,
const
word
&
dictName
);
//- Specialisation of the Generic New for basicThermo
static
autoPtr
<
basicThermo
>
New
(
...
...
@@ -272,6 +304,12 @@ public:
return
dpdt_
;
}
//- Is the thermo T based
Switch
tempBased
()
const
{
return
tempBased_
;
}
// Access to thermodynamic state variables
...
...
src/thermophysicalModels/basic/basicThermo/basicThermoTemplates.C
View file @
9887c8f5
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -247,4 +247,37 @@ Foam::autoPtr<Thermo> Foam::basicThermo::New
}
template
<
class
Thermo
>
Foam
::
autoPtr
<
Thermo
>
Foam
::
basicThermo
::
New
(
const
fvMesh
&
mesh
,
const
word
&
phaseName
,
const
word
&
dictName
)
{
IOdictionary
thermoDict
(
IOobject
(
dictName
,
mesh
.
time
().
constant
(),
mesh
,
IOobject
::
MUST_READ_IF_MODIFIED
,
IOobject
::
NO_WRITE
,
false
)
);
typename
Thermo
::
fvMeshDictPhaseConstructorTable
::
iterator
cstrIter
=
lookupThermo
<
Thermo
,
typename
Thermo
::
fvMeshDictPhaseConstructorTable
>
(
thermoDict
,
Thermo
::
fvMeshDictPhaseConstructorTablePtr_
);
return
autoPtr
<
Thermo
>
(
cstrIter
()(
mesh
,
phaseName
,
dictName
));
}
// ************************************************************************* //
src/thermophysicalModels/basic/fluidThermo/fluidThermo.C
View file @
9887c8f5
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -31,6 +31,7 @@ namespace Foam
{
defineTypeNameAndDebug
(
fluidThermo
,
0
);
defineRunTimeSelectionTable
(
fluidThermo
,
fvMesh
);
defineRunTimeSelectionTable
(
fluidThermo
,
fvMeshDictPhase
);
}
...
...
@@ -54,6 +55,17 @@ Foam::fluidThermo::fluidThermo
{}
Foam
::
fluidThermo
::
fluidThermo
(
const
fvMesh
&
mesh
,
const
word
&
phaseName
,
const
word
&
dictionaryName
)
:
basicThermo
(
mesh
,
phaseName
,
dictionaryName
)
{}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam
::
autoPtr
<
Foam
::
fluidThermo
>
Foam
::
fluidThermo
::
New
...
...
@@ -66,6 +78,17 @@ Foam::autoPtr<Foam::fluidThermo> Foam::fluidThermo::New
}
Foam
::
autoPtr
<
Foam
::
fluidThermo
>
Foam
::
fluidThermo
::
New
(
const
fvMesh
&
mesh
,
const
word
&
phaseName
,
const
word
&
dictName
)
{
return
basicThermo
::
New
<
fluidThermo
>
(
mesh
,
phaseName
,
dictName
);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam
::
fluidThermo
::~
fluidThermo
()
...
...
src/thermophysicalModels/basic/fluidThermo/fluidThermo.H
View file @
9887c8f5
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -69,6 +69,17 @@ public:
(
mesh
,
phaseName
)
);
//- Declare run-time constructor selection table for dictionary based
declareRunTimeSelectionTable
(
autoPtr
,
fluidThermo
,
fvMeshDictPhase
,
(
const
fvMesh
&
mesh
,
const
word
&
phaseName
,
const
word
&
dictName
),
(
mesh
,
phaseName
,
dictName
)
);
// Constructors
//- Construct from mesh and phase name
...
...
@@ -87,6 +98,15 @@ public:
);
//- Construct from mesh,dictionary,phase name with a single temperature
fluidThermo
(
const
fvMesh
&
,
const
word
&
phaseName
,
const
word
&
dictionaryName
);
//- Selector
static
autoPtr
<
fluidThermo
>
New
(
...
...
@@ -95,6 +115,15 @@ public:
);
//- Selector
static
autoPtr
<
fluidThermo
>
New
(
const
fvMesh
&
,
const
word
&
phaseName
,
const
word
&
dictName
);
//- Destructor
virtual
~
fluidThermo
();
...
...
src/thermophysicalModels/basic/fluidThermo/makeThermo.H
View file @
9887c8f5
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
Copyright (C) 2018 OpenCFD Ltd
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -83,6 +83,13 @@ Description
CThermoMixtureThermoPhys, \
fvMesh \
); \
\
addToRunTimeSelectionTable \
( \
BaseThermo, \
CThermoMixtureThermoPhys, \
fvMeshDictPhase \
);
#define makeThermoPhysicsThermo(BaseThermo,CThermo,Mixture,ThermoPhys) \
...
...
@@ -96,6 +103,7 @@ Description
\
defineThermoPhysicsThermo(BaseThermo, CThermo, Mixture, ThermoPhys); \
\
\
addThermoPhysicsThermo(basicThermo, CThermo##Mixture##ThermoPhys); \
addThermoPhysicsThermo(fluidThermo, CThermo##Mixture##ThermoPhys); \
addThermoPhysicsThermo(BaseThermo, CThermo##Mixture##ThermoPhys)
...
...
src/thermophysicalModels/basic/heThermo/heThermo.C
View file @
9887c8f5
...
...
@@ -90,6 +90,45 @@ void Foam::heThermo<BasicThermo, MixtureType>::init
}
}