Commit Graph

16844 Commits

Author SHA1 Message Date
Henry Weller
ccd958a8f1 GeometricField::dimensionedInteralFieldRef() -> GeometricField::ref()
In order to simplify expressions involving dimensioned internal field it
is preferable to use a simpler access convention.  Given that
GeometricField is derived from DimensionedField it is simply a matter of
de-referencing this underlying type unlike the boundary field which is
peripheral information.  For consistency with the new convention in
"tmp"  "dimensionedInteralFieldRef()" has been renamed "ref()".
2016-04-30 18:43:51 +01:00
Henry Weller
68b69a25a4 CrankNicolsonDdtScheme: Use the new GeometricField constructor from DimensionedField and boundary FieldField 2016-04-30 14:29:11 +01:00
Henry Weller
5df2b96489 GeometricField::internalField() -> GeometricField::internalFieldRef()
Non-const access to the internal field now obtained from a specifically
named access function consistent with the new names for non-canst access
to the boundary field boundaryFieldRef() and dimensioned internal field
dimensionedInternalFieldRef().

See also commit 22f4ad32b1
2016-04-30 14:25:21 +01:00
Henry Weller
67e2d02800 functionObjectFile: Separated into functionObjectFile and functionObjectFiles
functionObjectFile provides basic directory, file and formatting functions
functionObjectFiles provides multi-file cache
2016-04-30 09:18:42 +01:00
Henry Weller
3c61a1dbeb singlePhaseTransportModel: Added run-time type information
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=2075
2016-04-29 20:21:15 +01:00
Henry Weller
154150d710 Updated header 2016-04-29 17:18:33 +01:00
Henry Weller
c43b78e8de List: Removed unused constructor from iterators
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=2074
2016-04-29 17:17:45 +01:00
Henry Weller
81041e5d3c functionObjects/field/histogram: New functionObject to write the volume-weighted histogram of a volScalarField
e.g.
    pressureHistogram
    {
        type            histogram;

        functionObjectLibs ("libfieldFunctionObjects.so");

        field           p;
        nBins           100;
        min             -5;
        max             5;
        setFormat       gnuplot;
    }
2016-04-28 20:40:32 +01:00
Henry Weller
62c62abda8 fireFoam: New additional controls switch "solvePyrolysisRegion"
provides optional control for solving the pyrolysis region.

Patch contributed by Karl Meredith, FMGlobal.
2016-04-28 12:54:17 +01:00
Henry Weller
15b36331fe Remove .internalField() clutter for const-access to the internal field 2016-04-28 12:37:31 +01:00
Henry Weller
ea5401c770 GeometricField::GeometricBoundaryField -> GeometricField::Boundary
When the GeometricBoundaryField template class was originally written it
was a separate class in the Foam namespace rather than a sub-class of
GeometricField as it is now.  Without loss of clarity and simplifying
code which access the boundary field of GeometricFields it is better
that GeometricBoundaryField be renamed Boundary for consistency with the
new naming convention for the type of the dimensioned internal field:
Internal, see commit 4a57b9be2e

This is a very simple text substitution change which can be applied to
any code which compiles with the OpenFOAM-dev libraries.
2016-04-28 07:22:02 +01:00
Henry Weller
4a57b9be2e GeometricField: Rationalized and simplified access to the dimensioned internal field
Given that the type of the dimensioned internal field is encapsulated in
the GeometricField class the name need not include "Field"; the type
name is "Internal" so

volScalarField::DimensionedInternalField -> volScalarField::Internal

In addition to the ".dimensionedInternalField()" access function the
simpler "()" de-reference operator is also provided to greatly simplify
FV equation source term expressions which need not evaluate boundary
conditions.  To demonstrate this kEpsilon.C has been updated to use
dimensioned internal field expressions in the k and epsilon equation
source terms.
2016-04-27 21:32:45 +01:00
Henry Weller
c9a57e4009 tutorials/combustion/fireFoam/les: Added missing ph_rgh.orig files 2016-04-27 16:18:25 +01:00
Henry Weller
ec5cc92d37 geometricOneField: Added support for DimensionedInternalField 2016-04-27 12:46:38 +01:00
Henry Weller
b2ea0ab2bd DimensionedField: Corrected (currently unused) constructor from tmp 2016-04-27 12:45:55 +01:00
Henry Weller
785cebed88 GeometricField, volFields: Added experimental member function ".v()" and perfix operator "~"
both of which return the dimensionedInternalField for volFields only.

These will be useful in FV equation source term expressions which need
not evaluate boundary conditions.
2016-04-26 20:45:53 +01:00
Henry Weller
f539fd4c4b Replaced StaticAssert with the C++11 equivalent static_assert 2016-04-26 20:44:55 +01:00
Henry Weller
f790663b78 src/postProcessing/functionObjects/field/Make/files: Corrected 2016-04-26 20:38:33 +01:00
Henry Weller
070515e9db Revert "src/postProcessing/functionObjects/field/Make/files: Corrected"
This reverts commit 3cfc54ba09.
2016-04-26 20:33:45 +01:00
Henry Weller
3cfc54ba09 src/postProcessing/functionObjects/field/Make/files: Corrected 2016-04-26 20:31:58 +01:00
Henry Weller
dc2951ca2f GeometricField::dimensionedInternalField() -> GeometricField::dimensionedInternalFieldRef()
See also commit 22f4ad32b1
2016-04-26 16:29:43 +01:00
Henry Weller
6962fd3ba4 fvDOM: Corrected type of maxIter_
Resolves bug-report http://openfoam.org/mantisbt/view.php?id=2068
2016-04-26 10:51:09 +01:00
Henry Weller
4107d312fa wmake/rules/linux.*Icc: Remove -xHost option which causes surfaceFeatureExtract to fail for some cases 2016-04-25 22:29:22 +01:00
Henry Weller
22f4ad32b1 Completed boundaryField() -> boundaryFieldRef()
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1938

Because C++ does not support overloading based on the return-type there
is a problem defining both const and non-const member functions which
are resolved based on the const-ness of the object for which they are
called rather than the intent of the programmer declared via the
const-ness of the returned type.  The issue for the "boundaryField()"
member function is that the non-const version increments the
event-counter and checks the state of the stored old-time fields in case
the returned value is altered whereas the const version has no
side-effects and simply returns the reference.  If the the non-const
function is called within the patch-loop the event-counter may overflow.
To resolve this it in necessary to avoid calling the non-const form of
"boundaryField()" if the results is not altered and cache the reference
outside the patch-loop when mutation of the patch fields is needed.

The most straight forward way of resolving this problem is to name the
const and non-const forms of the member functions differently e.g. the
non-const form could be named:

    mutableBoundaryField()
    mutBoundaryField()
    nonConstBoundaryField()
    boundaryFieldRef()

Given that in C++ a reference is non-const unless specified as const:
"T&" vs "const T&" the logical convention would be

    boundaryFieldRef()
    boundaryFieldConstRef()

and given that the const form which is more commonly used is it could
simply be named "boundaryField()" then the logical convention is

    GeometricBoundaryField& boundaryFieldRef();

    inline const GeometricBoundaryField& boundaryField() const;

This is also consistent with the new "tmp" class for which non-const
access to the stored object is obtained using the ".ref()" member function.

This new convention for non-const access to the components of
GeometricField will be applied to "dimensionedInternalField()" and "internalField()" in the
future, i.e. "dimensionedInternalFieldRef()" and "internalFieldRef()".
2016-04-25 16:16:05 +01:00
Henry Weller
450728ea84 Standardized cell, patch, face and processor loop index names 2016-04-25 12:00:53 +01:00
Henry Weller
43beb06018 Standardized cell, patch and face loop index names 2016-04-25 10:28:32 +01:00
Henry Weller
2d5ff31649 boundaryField() -> boundaryFieldRef() 2016-04-24 22:07:37 +01:00
Henry Weller
3758659ac6 noScatter.H: Corrected #ifdef
Resolved bug-report http://openfoam.org/mantisbt/view.php?id=2065
2016-04-24 21:05:29 +01:00
Henry Weller
a0e86416c5 Updated header 2016-04-23 23:38:10 +01:00
Henry Weller
d8f8498c87 boundaryField() -> boundaryFieldRef() 2016-04-23 23:37:53 +01:00
Henry Weller
7c12f7743b boundaryField() -> boundaryFieldRef() 2016-04-23 23:16:30 +01:00
Henry Weller
45f73bf64f GeometricField: New non-const access function boundaryFieldRef()
There is a need to specify const or non-const access to a non-const
object which is not currently possible with the "boundaryField()" access
function the const-ness of the return of which is defined by the
const-ness of the object for which it is called.  For consistency with
the latest "tmp" storage class in which non-const access is obtained
with the "ref()" function it is proposed to replace the non-const form
of "boundaryField()" with "boundaryFieldRef()".

Thanks to Mattijs Janssens for starting the process of migration to
"boundaryFieldRef()" and providing a patch for the OpenFOAM and
finiteVolume libraries.
2016-04-23 23:07:28 +01:00
Henry Weller
88561eea95 plenumPressureFvPatchScalarField: New plenum pressure boundary condition
This condition creates a zero-dimensional model of an enclosed volume of
gas upstream of the inlet. The pressure that the boundary condition
exerts on the inlet boundary is dependent on the thermodynamic state of
the upstream volume.  The upstream plenum density and temperature are
time-stepped along with the rest of the simulation, and momentum is
neglected. The plenum is supplied with a user specified mass flow and
temperature.

The result is a boundary condition which blends between a pressure inlet
condition condition and a fixed mass flow. The smaller the plenum
volume, the quicker the pressure responds to a deviation from the supply
mass flow, and the closer the model approximates a fixed mass flow. As
the plenum size increases, the model becomes more similar to a specified
pressure.

The expansion from the plenum to the inlet boundary is controlled by an
area ratio and a discharge coefficient. The area ratio can be used to
represent further acceleration between a sub-grid blockage such as fins.
The discharge coefficient represents a fractional deviation from an
ideal expansion process.

This condition is useful for simulating unsteady internal flow problems
for which both a mass flow boundary is unrealistic, and a pressure
boundary is susceptible to flow reversal. It was developed for use in
simulating confined combustion.

tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance:
    helmholtz resonance tutorial case for plenum pressure boundary

This development was contributed by Will Bainbridge
2016-04-23 13:43:49 +01:00
Henry Weller
673e0d1704 fireFoam: Added optional hydrostatic initialization of the pressure and density
Also added the new prghTotalHydrostaticPressure p_rgh BC which uses the
hydrostatic pressure field as the reference state for the far-field
which provides much more accurate entrainment is large open domains
typical of many fire simulations.

The hydrostatic field solution is controlled by the optional entries in
the fvSolution.PIMPLE dictionary, e.g.

    hydrostaticInitialization yes;
    nHydrostaticCorrectors 5;

and the solver must also be specified for the hydrostatic p_rgh field
ph_rgh e.g.

    ph_rgh
    {
        $p_rgh;
    }

Suitable boundary conditions for ph_rgh cannot always be derived from
those for p_rgh and so the ph_rgh is read to provide them.

To avoid accuracy issues with IO, restart and post-processing the p_rgh
and ph_rgh the option to specify a suitable reference pressure is
provided via the optional pRef file in the constant directory, e.g.

    dimensions      [1 -1 -2 0 0 0 0];
    value           101325;

which is used in the relationship between p_rgh and p:

    p = p_rgh + rho*gh + pRef;

Note that if pRef is specified all pressure BC specifications in the
p_rgh and ph_rgh files are relative to the reference to avoid round-off
errors.

For examples of suitable BCs for p_rgh and ph_rgh for a range of
fireFoam cases please study the tutorials in
tutorials/combustion/fireFoam/les which have all been updated.

Henry G. Weller
CFD Direct Ltd.
2016-04-23 10:04:39 +01:00
Henry Weller
6a7c4aca53 thermoSingleLayer: Corrected handling of non-constant Cp 2016-04-23 10:03:40 +01:00
Henry Weller
a78beef988 JohnsonJacksonSchaefferFrictionalStress: Updated I2D expression 2016-04-22 15:13:45 +01:00
Henry Weller
bbca1fd5e7 reactingTwoPhaseEulerFoam: Corrected kineticTheory frictional stress at walls
Patch contributed by Juho Peltola, VTT

The new JohnsonJacksonSchaefferFrictionalStress model is included and
the LBend tutorial case to demonstrate the need for the changes to the
frictional stress models.

Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=2058
2016-04-22 14:25:58 +01:00
Henry Weller
bbd6bfff22 foamCalcFunctions: Avoid the inclusion of fvCFD.H 2016-04-22 14:21:50 +01:00
Henry Weller
e5a029c187 tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle: Added alphaPhi to correctFluxes
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=2062
2016-04-21 21:19:01 +01:00
Henry Weller
294379d421 tutorials/incompressible/pisoFoam/les/motorBike: Corrected typos
Resolves bug-report http://openfoam.org/mantisbt/view.php?id=2061
2016-04-21 21:13:10 +01:00
Henry Weller
870d75c2d3 dictionary: Corrected topDict()
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=2060
2016-04-21 21:08:56 +01:00
Henry Weller
9d0f4997d3 Tensor, SymmTensor: Simplified invariantII
Now the calculation of the 2nd-invariant is more efficient and
accumulates less round-off error.
2016-04-21 21:07:39 +01:00
Henry Weller
5f13806591 Updated headers 2016-04-21 21:07:28 +01:00
Henry Weller
0aaf154100 utilities/mesh/manipulation: Rationalized "End" message 2016-04-21 21:06:45 +01:00
Henry Weller
d57464a99d transformPoints: Added "End" message
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=2059
2016-04-21 21:05:47 +01:00
Henry Weller
1197304b1e README.org: Added link to the OpenFOAM C++ Style Guide 2016-04-20 18:23:59 +01:00
Henry Weller
3639f36d37 codingStyleGuide: Corrected sectioning 2016-04-20 10:33:19 +01:00
Henry Weller
90f5cc6b9d rigidBodyDynamics: Generalized the interface to the restraints
Now internal forces and restraints may be applied between bodies within
the articulated structure.
2016-04-19 21:58:10 +01:00
Henry Weller
9b68e6d80c src/Allwmake: Added the new rigidBodyMeshMotion library 2016-04-19 11:11:22 +01:00
Henry Weller
bbc05bdf7e tutorials/multiphase/interDyMFoam/ras/DTCHull: Updated to use the rigidBodyDynamics solver 2016-04-19 10:35:09 +01:00