This reduces code duplication within heheuPsiThermo. This also resolves
a Clang floating point error issue associated with loop vectorisation.
See commit 9675107f for the corresponding fix to heThermo.
This change formalises the usage of the "log" keyword in function
objects. By default, logging to stdout is activated when running
"postProcess" or "<solver> -postProcess", and deactivated when a
function is being executed as part of a run.
This behaviour can now be overridden in the function object dictionary
when operating in either mode.
The initialisation of energy in heThermo has been rewritten to use the
"he" method.
This has had the effect of resolving a floating point error in the
initialisation by disabling Clang's vectorisation of the loop in which
cell values of energy are calculated from the temperature field.
Usage
\constant
Property | Description
value | Constant property value
\endconstant
Example for the density of water between 280 and 350K
\verbatim
rho
{
type constant;
value 999.87;
}
\endverbatim
Description
Tabulated property function the linearly interpolates between
the table values.
Usage
\table
Property | Description
Tlow | Lower temperature limit of the table
Thigh | Upper temperature limit of the table
values | Property values, assumed uniformly distributed
\endtable
Example for the density of water between 280 and 350K
\verbatim
rho
{
type table;
Tlow 280;
Thigh 350;
values
(
999.87
991.53
973.7
);
}
\endverbatim
If the optional "type" entry is provided for the liquid specie that type is
looked-up rather than the entry name, e.g.
mixture
{
H2O
{
type liquid;
W 18.015;
Tc 647.13;
Pc 2.2055e+7;
Vc 0.05595;
Zc 0.229;
Tt 273.16;
Pt 6.113e+2;
Tb 373.15;
dipm 6.1709e-30;
omega 0.3449;
delta 4.7813e+4;
rho
{
type NSRDSfunc5;
a 98.343885;
b 0.30542;
c 647.13;
d 0.081;
}
.
.
.
}
ethanol
{
type liquid;
W 46.07;
.
.
.
}
}
Description
Generic thermophysical properties class for a liquid in which the
functions and coefficients for each property are run-time selected.
Property functions need only be specified for properties that are actually used
in the simulation, e.g. in the thermophysicalProperties.water dictionary of the
tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D case the water
properties can be specified directly as
mixture
{
liquid
{
W 18.015;
Tc 647.13;
Pc 2.2055e+7;
Vc 0.05595;
Zc 0.229;
Tt 273.16;
Pt 6.113e+2;
Tb 373.15;
dipm 6.1709e-30;
omega 0.3449;
delta 4.7813e+4;
rho
{
type NSRDSfunc5;
a 98.343885;
b 0.30542;
c 647.13;
d 0.081;
}
Cp
{
type NSRDSfunc0;
a 15341.1046350264;
b -116.019983347211;
c 0.451013044684985;
d -0.000783569247849015;
e 5.20127671384957e-07;
f 0;
}
h
{
type NSRDSfunc0;
a -17957283.7993676;
b 15341.1046350264;
c -58.0099916736053;
d 0.150337681561662;
e -0.000195892311962254;
f 1.04025534276991e-07;
}
mu
{
type NSRDSfunc1;
a -51.964;
b 3670.6;
c 5.7331;
d -5.3495e-29;
e 10;
}
kappa
{
type NSRDSfunc0;
a -0.4267;
b 0.0056903;
c -8.0065e-06;
d 1.815e-09;
e 0;
f 0;
}
sigma
{
type NSRDSfunc6;
Tc 647.13;
a 0.18548;
b 2.717;
c -3.554;
d 2.047;
e 0;
}
}
}
This fix ensures that the function still operates even if models only
exist on some interfaces.
Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
The wallHeatTransfer condition has been removed. It provided no
additional functionality beyond that available in
externalWallHeatFluxTemperature. It was also broken; it triggered
lookup errors due to it evaluating during construction and trying to
access a turbulence model that had not yet been created.
functionEntry expansion is enabled for dictionary expansion with the -expand
option. The disableFunctionEntries option is no longer needed and has been removed.
When reading dimensionSets and dimensionedConstants the name of the
dimensionedScalar is no longer required in addition to the dictionary keyword,
e.g.
c c [0 1 -1 0 0 0 0] 2.99792e+08;
can now be specified as
c [0 1 -1 0 0 0 0] 2.99792e+08;
As of 2ebed5ec, functonObjectList::start contains run commands that
trigger if some function objects are executable at time-zero. A call to
this method in functionObjectList::New has been removed (and replaced
with functonObjectList::read) as it was causing postProcess and <solver>
-postProcess to execute twice; once on construction, and once at the
selected initial time.
This change also fixes lookup errors generated by postProcess which
occured because fields (specified with -field or -fields arguments) are
not read and registered prior to function object construction.
Usage of functonObjectList::start within Time::run has not been altered.
A typical Function1 entry can be read in one of three ways; with the
parameters in the current dictionary, in a separate sub-dict, or with
the entry itself as the dictionary; e.g.,
// Current-dictionary form
<entryName> sine;
amplitude 0.1;
frequency 10;
level 0.2;
// Coeff-dictionary form
<entryName> sine;
<entryName>Coeffs
{
amplitude 0.1;
frequency 10;
level 0.2;
}
// Entry-as-dictionary form
<entryName>
{
type sine;
amplitude 0.1;
frequency 10;
level 0.2;
}
The latter two sub-dictionary forms are needed when there are multiple
Function1 entries of the same type in a dictionary. Enclosing the
parameters in a separate sub-dictionary prevents the keywords (in this
case "amplitude", "frequency" and "level") from being duplicated.
Table and constant Function1 entries are different in that they have
special formats which allow the data to be appended directly to the
entry name; e.g;
<entryName> table ((0 (1 0 0)) (1 (2 0 0)));
<entryName> constant (1 0 0);
// (constant can even have the "constant" keyword omitted)
<entryName> (1 0 0);
Table also has two optional additional controls; "outOfBounds" and
"interpolationScheme". In order for these to be written out in such a
way that the entries are not duplicated, table needs to be written out
(and therefore also read in) as one of the sub-dictionary forms. To that
effect, Table has been extended to additionally permit reading in the
three forms described previously, and to write in the coeff-dictionary
form.
// Current-dictionary form
<entryName> table;
values ((0 (1 0 0)) (1 (2 0 0)));
outOfBounds repeat;
interpolationScheme linear;
// Coeff-dictionary form
<entryName> sine;
<entryName>Coeffs
{
values ((0 (1 0 0)) (1 (2 0 0)));
outOfBounds repeat;
interpolationScheme linear;
}
// Entry-as-dictionary form
<entryName>
{
type table;
values ((0 (1 0 0)) (1 (2 0 0)));
outOfBounds repeat;
interpolationScheme linear;
}
For completeness and consistency, constant has also been modified so
that it can read in these forms. However, constant has no additional
control entries, which means writing a coeff-dictionary is unecessary,
so the output has not been changed.
// Find out if triangle inside shell with higher level
// What level does shell want to refine fc to?
//
// Note: it is not clear for what cases this additional requirement
// is beneficial but for triangulated surfaces with triangles that
// span refinement regions it introduces unnecessary refinement so
// it has been removed.
//
// This option can be reinstated under a switch if cases are
// provided which demonstrate the benefit.
/*
labelList shellLevel;
shells.findHigherLevel(ctrs, minLevelField, shellLevel);
forAll(minLevelField, i)
{
minLevelField[i] = max(minLevelField[i], shellLevel[i]);
}
*/
Resolves bug-report https://bugs.openfoam.org/view.php?id=3361
The update of mass transfer rates in the population balance system is
now done at the same time as other source terms. This benefits
synchronisation of the mass transfer rate and the source terms and
prevents the system converging to an incorrect state.
Patch contributed by VTT Technical Research Centre of Finland Ltd and
Institute of Fluid Dynamics, Helmholtz-Zentrum Dresden - Rossendorf (HZDR).
This avoids log messaged being generated by foamListTimes when optimisation
switches are set in the case controlDict, e.g.
OptimisationSwitches
{
writeNowSignal 10;
}
In order to improve stability and robustness of fluidised bed cases the
semi-implicit treatment of the particle pressure (pPrime) is now applied within
the time-step sub-cycling along with the phase differential flux update. This
allows the simulations to be performed reliably at a significantly increased
maximum Courant number (up to 5 for some cases) without introducing
chequerboarding patterns in regions of low particle phase fraction which
occurred with the previous algorithm.
The fluidisedBed tutorial has been updated to be more representative of real
bubbling bed cases and to demonstrate the new pPrime functionality.
Developed in collaboration with Timo Niemi, VTT.