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
a8a0dd63
Commit
a8a0dd63
authored
Jan 08, 2013
by
andy
Browse files
ENH: Propagated basicSource->fv::option changes across field sources
parent
792fbf1a
Changes
52
Hide whitespace changes
Inline
Side-by-side
src/fieldSources/Make/files
View file @
a8a0dd63
basicSource/basicSource
.C
basicSource/basicSource
IO.C
basicSource/basicSource
List.C
basicSource/IObasicSource
List.C
fvOptions/fvOption
.C
fvOptions/fvOption
IO.C
fvOptions/fvOption
List.C
fvOptions/fvIOoption
List.C
/* sources */
...
...
src/fieldSources/constraints/derived/fixedTemperatureConstraint/fixedTemperatureConstraint.C
View file @
a8a0dd63
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -34,16 +34,19 @@ License
namespace
Foam
{
defineTypeNameAndDebug
(
fixedTemperatureConstraint
,
0
);
addToRunTimeSelectionTable
(
basicSource
,
fixedTemperatureConstraint
,
dictionary
);
namespace
fv
{
defineTypeNameAndDebug
(
fixedTemperatureConstraint
,
0
);
addToRunTimeSelectionTable
(
option
,
fixedTemperatureConstraint
,
dictionary
);
}
template
<>
const
char
*
NamedEnum
<
fixedTemperatureConstraint
::
temperatureMode
,
2
>::
const
char
*
NamedEnum
<
fv
::
fixedTemperatureConstraint
::
temperatureMode
,
2
>::
names
[]
=
{
"uniform"
,
...
...
@@ -51,13 +54,13 @@ namespace Foam
};
}
const
Foam
::
NamedEnum
<
Foam
::
fixedTemperatureConstraint
::
temperatureMode
,
2
>
Foam
::
fixedTemperatureConstraint
::
temperatureModeNames_
;
const
Foam
::
NamedEnum
<
Foam
::
fv
::
fixedTemperatureConstraint
::
temperatureMode
,
2
>
Foam
::
fv
::
fixedTemperatureConstraint
::
temperatureModeNames_
;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam
::
fixedTemperatureConstraint
::
fixedTemperatureConstraint
Foam
::
fv
::
fixedTemperatureConstraint
::
fixedTemperatureConstraint
(
const
word
&
name
,
const
word
&
modelType
,
...
...
@@ -65,7 +68,7 @@ Foam::fixedTemperatureConstraint::fixedTemperatureConstraint
const
fvMesh
&
mesh
)
:
basicSource
(
name
,
modelType
,
dict
,
mesh
),
option
(
name
,
modelType
,
dict
,
mesh
),
mode_
(
temperatureModeNames_
.
read
(
coeffs_
.
lookup
(
"mode"
))),
Tuniform_
(
NULL
),
TName_
(
"T"
)
...
...
@@ -99,13 +102,13 @@ Foam::fixedTemperatureConstraint::fixedTemperatureConstraint
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool
Foam
::
fixedTemperatureConstraint
::
alwaysApply
()
const
bool
Foam
::
fv
::
fixedTemperatureConstraint
::
alwaysApply
()
const
{
return
true
;
}
void
Foam
::
fixedTemperatureConstraint
::
setValue
void
Foam
::
fv
::
fixedTemperatureConstraint
::
setValue
(
fvMatrix
<
scalar
>&
eqn
,
const
label
...
...
@@ -146,16 +149,16 @@ void Foam::fixedTemperatureConstraint::setValue
}
void
Foam
::
fixedTemperatureConstraint
::
writeData
(
Ostream
&
os
)
const
void
Foam
::
fv
::
fixedTemperatureConstraint
::
writeData
(
Ostream
&
os
)
const
{
os
<<
indent
<<
name_
<<
endl
;
dict_
.
write
(
os
);
}
bool
Foam
::
fixedTemperatureConstraint
::
read
(
const
dictionary
&
dict
)
bool
Foam
::
fv
::
fixedTemperatureConstraint
::
read
(
const
dictionary
&
dict
)
{
if
(
basicSource
::
read
(
dict
))
if
(
option
::
read
(
dict
))
{
if
(
coeffs_
.
found
(
Tuniform_
->
name
()))
{
...
...
src/fieldSources/constraints/derived/fixedTemperatureConstraint/fixedTemperatureConstraint.H
View file @
a8a0dd63
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::fixedTemperatureConstraint
Foam::
fv::
fixedTemperatureConstraint
Description
Fixed temperature equation constraint
...
...
@@ -46,14 +46,14 @@ Note:
by means of the DataEntry type.
SourceFiles
basicSource
.C
fvOption
.C
\*---------------------------------------------------------------------------*/
#ifndef fixedTemperatureConstraint_H
#define fixedTemperatureConstraint_H
#include
"
basicSource
.H"
#include
"
fvOption
.H"
#include
"NamedEnum.H"
#include
"DataEntry.H"
...
...
@@ -61,6 +61,8 @@ SourceFiles
namespace
Foam
{
namespace
fv
{
/*---------------------------------------------------------------------------*\
Class fixedTemperatureConstraint Declaration
...
...
@@ -68,7 +70,7 @@ namespace Foam
class
fixedTemperatureConstraint
:
public
basicSource
public
option
{
public:
...
...
@@ -156,6 +158,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace fv
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
src/fieldSources/constraints/derived/temperatureLimitsConstraint/temperatureLimitsConstraint.C
View file @
a8a0dd63
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -32,19 +32,22 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace
Foam
{
namespace
fv
{
defineTypeNameAndDebug
(
temperatureLimitsConstraint
,
0
);
addToRunTimeSelectionTable
(
basicSource
,
option
,
temperatureLimitsConstraint
,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam
::
temperatureLimitsConstraint
::
temperatureLimitsConstraint
Foam
::
fv
::
temperatureLimitsConstraint
::
temperatureLimitsConstraint
(
const
word
&
name
,
const
word
&
modelType
,
...
...
@@ -52,7 +55,7 @@ Foam::temperatureLimitsConstraint::temperatureLimitsConstraint
const
fvMesh
&
mesh
)
:
basicSource
(
name
,
modelType
,
dict
,
mesh
),
option
(
name
,
modelType
,
dict
,
mesh
),
Tmin_
(
readScalar
(
coeffs_
.
lookup
(
"Tmin"
))),
Tmax_
(
readScalar
(
coeffs_
.
lookup
(
"Tmax"
)))
{
...
...
@@ -63,13 +66,13 @@ Foam::temperatureLimitsConstraint::temperatureLimitsConstraint
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool
Foam
::
temperatureLimitsConstraint
::
alwaysApply
()
const
bool
Foam
::
fv
::
temperatureLimitsConstraint
::
alwaysApply
()
const
{
return
true
;
}
void
Foam
::
temperatureLimitsConstraint
::
correct
(
volScalarField
&
he
)
void
Foam
::
fv
::
temperatureLimitsConstraint
::
correct
(
volScalarField
&
he
)
{
const
basicThermo
&
thermo
=
mesh_
.
lookupObject
<
basicThermo
>
(
"thermophysicalProperties"
);
...
...
@@ -123,16 +126,16 @@ void Foam::temperatureLimitsConstraint::correct(volScalarField& he)
}
void
Foam
::
temperatureLimitsConstraint
::
writeData
(
Ostream
&
os
)
const
void
Foam
::
fv
::
temperatureLimitsConstraint
::
writeData
(
Ostream
&
os
)
const
{
os
<<
indent
<<
name_
<<
endl
;
dict_
.
write
(
os
);
}
bool
Foam
::
temperatureLimitsConstraint
::
read
(
const
dictionary
&
dict
)
bool
Foam
::
fv
::
temperatureLimitsConstraint
::
read
(
const
dictionary
&
dict
)
{
if
(
basicSource
::
read
(
dict
))
if
(
option
::
read
(
dict
))
{
coeffs_
.
readIfPresent
(
"Tmin"
,
Tmin_
);
coeffs_
.
readIfPresent
(
"Tmax"
,
Tmax_
);
...
...
src/fieldSources/constraints/derived/temperatureLimitsConstraint/temperatureLimitsConstraint.H
View file @
a8a0dd63
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::temperatureLimitsConstraint
Foam::
fv::
temperatureLimitsConstraint
Description
Constraint for temperature to apply limits between minimum and maximum
...
...
@@ -39,19 +39,21 @@ Description
SourceFiles
basicSource
.C
fvOption
.C
\*---------------------------------------------------------------------------*/
#ifndef temperatureLimitsConstraint_H
#define temperatureLimitsConstraint_H
#include
"
basicSource
.H"
#include
"
fvOption
.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
namespace
fv
{
/*---------------------------------------------------------------------------*\
Class temperatureLimitsConstraint Declaration
...
...
@@ -59,7 +61,7 @@ namespace Foam
class
temperatureLimitsConstraint
:
public
basicSource
public
option
{
protected:
...
...
@@ -130,6 +132,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace fv
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
src/fieldSources/constraints/general/explicitSetValue/ExplicitSetValue.C
View file @
a8a0dd63
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-201
2
OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-201
3
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -31,7 +31,7 @@ License
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template
<
class
Type
>
void
Foam
::
ExplicitSetValue
<
Type
>::
setFieldData
(
const
dictionary
&
dict
)
void
Foam
::
fv
::
ExplicitSetValue
<
Type
>::
setFieldData
(
const
dictionary
&
dict
)
{
fieldNames_
.
setSize
(
dict
.
toc
().
size
());
injectionRate_
.
setSize
(
fieldNames_
.
size
());
...
...
@@ -51,7 +51,7 @@ void Foam::ExplicitSetValue<Type>::setFieldData(const dictionary& dict)
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template
<
class
Type
>
Foam
::
ExplicitSetValue
<
Type
>::
ExplicitSetValue
Foam
::
fv
::
ExplicitSetValue
<
Type
>::
ExplicitSetValue
(
const
word
&
name
,
const
word
&
modelType
,
...
...
@@ -59,7 +59,7 @@ Foam::ExplicitSetValue<Type>::ExplicitSetValue
const
fvMesh
&
mesh
)
:
basicSource
(
name
,
modelType
,
dict
,
mesh
),
option
(
name
,
modelType
,
dict
,
mesh
),
injectionRate_
()
{
read
(
dict
);
...
...
@@ -69,7 +69,7 @@ Foam::ExplicitSetValue<Type>::ExplicitSetValue
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
<
class
Type
>
void
Foam
::
ExplicitSetValue
<
Type
>::
setValue
void
Foam
::
fv
::
ExplicitSetValue
<
Type
>::
setValue
(
fvMatrix
<
Type
>&
eqn
,
const
label
fieldI
...
...
src/fieldSources/constraints/general/explicitSetValue/ExplicitSetValue.H
View file @
a8a0dd63
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-201
2
OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-201
3
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::explicitSetValue
Foam::
fv::
explicitSetValue
Description
Set values field values explicity.
...
...
@@ -41,7 +41,7 @@ Description
\endverbatim
SeeAlso
Foam::
basicSource
Foam::
fvOption
SourceFiles
explicitSetValue.C
...
...
@@ -51,13 +51,15 @@ SourceFiles
#ifndef ExplicitSetValue_H
#define ExplicitSetValue_H
#include
"
basicSource
.H"
#include
"
fvOption
.H"
#include
"Tuple2.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
namespace
fv
{
/*---------------------------------------------------------------------------*\
Class explicitSetValue Declaration
...
...
@@ -66,7 +68,7 @@ namespace Foam
template
<
class
Type
>
class
ExplicitSetValue
:
public
basicSource
public
option
{
protected:
...
...
@@ -121,6 +123,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace fv
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
src/fieldSources/constraints/general/explicitSetValue/ExplicitSetValueIO.C
View file @
a8a0dd63
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-201
2
OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-201
3
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -28,7 +28,7 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
<
class
Type
>
void
Foam
::
ExplicitSetValue
<
Type
>::
writeData
(
Ostream
&
os
)
const
void
Foam
::
fv
::
ExplicitSetValue
<
Type
>::
writeData
(
Ostream
&
os
)
const
{
os
<<
indent
<<
name_
<<
endl
;
dict_
.
write
(
os
);
...
...
@@ -36,9 +36,9 @@ void Foam::ExplicitSetValue<Type>::writeData(Ostream& os) const
template
<
class
Type
>
bool
Foam
::
ExplicitSetValue
<
Type
>::
read
(
const
dictionary
&
dict
)
bool
Foam
::
fv
::
ExplicitSetValue
<
Type
>::
read
(
const
dictionary
&
dict
)
{
if
(
basicSource
::
read
(
dict
))
if
(
option
::
read
(
dict
))
{
setFieldData
(
coeffs_
.
subDict
(
"injectionRate"
));
return
true
;
...
...
src/fieldSources/constraints/general/explicitSetValue/explicitSetValue.C
View file @
a8a0dd63
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-201
2
OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-201
3
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -23,18 +23,21 @@ License
\*---------------------------------------------------------------------------*/
#include
"make
BasicSource
.H"
#include
"make
FvOption
.H"
#include
"ExplicitSetValue.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
makeBasicSource
(
ExplicitSetValue
,
scalar
);
makeBasicSource
(
ExplicitSetValue
,
vector
);
makeBasicSource
(
ExplicitSetValue
,
sphericalTensor
);
makeBasicSource
(
ExplicitSetValue
,
symmTensor
);
makeBasicSource
(
ExplicitSetValue
,
tensor
);
namespace
fv
{
makeFvOption
(
ExplicitSetValue
,
scalar
);
makeFvOption
(
ExplicitSetValue
,
vector
);
makeFvOption
(
ExplicitSetValue
,
sphericalTensor
);
makeFvOption
(
ExplicitSetValue
,
symmTensor
);
makeFvOption
(
ExplicitSetValue
,
tensor
);
}
}
...
...
src/fieldSources/include/createFvOptions.H
View file @
a8a0dd63
Info
<<
"Creating
source
s"
<<
endl
;
IObasicSourceList
source
s
(
mesh
);
Info
<<
"Creating
finite volume option
s"
<<
endl
;
fv
::
IOoptionList
fvOption
s
(
mesh
);
src/fieldSources/sources/derived/MRFSource/MRFSource.C
View file @
a8a0dd63
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -33,19 +33,22 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace
Foam
{
namespace
fv
{
defineTypeNameAndDebug
(
MRFSource
,
0
);
addToRunTimeSelectionTable
(
basicSource
,
option
,
MRFSource
,
dictionary
);
}
}
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
void
Foam
::
MRFSource
::
initialise
()
void
Foam
::
fv
::
MRFSource
::
initialise
()
{
if
(
selectionMode_
!=
smCellZone
)
{
...
...
@@ -77,7 +80,7 @@ void Foam::MRFSource::initialise()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam
::
MRFSource
::
MRFSource
Foam
::
fv
::
MRFSource
::
MRFSource
(
const
word
&
name
,
const
word
&
modelType
,
...
...
@@ -85,7 +88,7 @@ Foam::MRFSource::MRFSource
const
fvMesh
&
mesh
)
:
basicSource
(
name
,
modelType
,
dict
,
mesh
),
option
(
name
,
modelType
,
dict
,
mesh
),
mrfPtr_
(
NULL
),
UName_
(
coeffs_
.
lookupOrDefault
<
word
>
(
"UName"
,
"U"
)),
rhoName_
(
coeffs_
.
lookupOrDefault
<
word
>
(
"rhoName"
,
"rho"
))
...
...
@@ -96,7 +99,7 @@ Foam::MRFSource::MRFSource
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void
Foam
::
MRFSource
::
addSup
void
Foam
::
fv
::
MRFSource
::
addSup
(
fvMatrix
<
vector
>&
eqn
,
const
label
fieldI
...
...
@@ -118,13 +121,13 @@ void Foam::MRFSource::addSup
}
void
Foam
::
MRFSource
::
relativeFlux
(
surfaceScalarField
&
phi
)
const
void
Foam
::
fv
::
MRFSource
::
relativeFlux
(
surfaceScalarField
&
phi
)
const
{
mrfPtr_
->
relativeFlux
(
phi
);
}
void
Foam
::
MRFSource
::
relativeFlux
void
Foam
::
fv
::
MRFSource
::
relativeFlux
(
const
surfaceScalarField
&
rho
,
surfaceScalarField
&
phi
...
...
@@ -134,13 +137,13 @@ void Foam::MRFSource::relativeFlux
}
void
Foam
::
MRFSource
::
absoluteFlux
(
surfaceScalarField
&
phi
)
const
void
Foam
::
fv
::
MRFSource
::
absoluteFlux
(
surfaceScalarField
&
phi
)
const
{
mrfPtr_
->
absoluteFlux
(
phi
);
}
void
Foam
::
MRFSource
::
absoluteFlux
void
Foam
::
fv
::
MRFSource
::
absoluteFlux
(
const
surfaceScalarField
&
rho
,
surfaceScalarField
&
phi
...
...
@@ -150,16 +153,16 @@ void Foam::MRFSource::absoluteFlux
}
void
Foam
::
MRFSource
::
writeData
(
Ostream
&
os
)
const
void
Foam
::
fv
::
MRFSource
::
writeData
(
Ostream
&
os
)
const
{
os
<<
indent
<<
name_
<<
endl
;
dict_
.
write
(
os
);
}
bool
Foam
::
MRFSource
::
read
(
const
dictionary
&
dict
)
bool
Foam
::
fv
::
MRFSource
::
read
(
const
dictionary
&
dict
)
{
if
(
basicSource
::
read
(
dict
))
if
(
option
::
read
(
dict
))
{
coeffs_
.
readIfPresent
(
"UName"
,
UName_
);
coeffs_
.
readIfPresent
(
"rhoName"
,
rhoName_
);
...
...
src/fieldSources/sources/derived/MRFSource/MRFSource.H
View file @
a8a0dd63
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::MRFSource