Commit Graph

2325 Commits

Author SHA1 Message Date
49adef644f DimensionedField: Corrected (currently unused) constructor from tmp 2016-04-27 12:45:55 +01:00
f0d25904e4 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
cb9732204d Replaced StaticAssert with the C++11 equivalent static_assert 2016-04-26 20:44:55 +01:00
2c107a17b5 src/postProcessing/functionObjects/field/Make/files: Corrected 2016-04-26 20:38:33 +01:00
6fd4ce6cc3 Revert "src/postProcessing/functionObjects/field/Make/files: Corrected"
This reverts commit 73fe45cd27.
2016-04-26 20:33:45 +01:00
73fe45cd27 src/postProcessing/functionObjects/field/Make/files: Corrected 2016-04-26 20:31:58 +01:00
97f473ff0f GeometricField::dimensionedInternalField() -> GeometricField::dimensionedInternalFieldRef()
See also commit a4e2afa4b3
2016-04-26 16:29:43 +01:00
a0742586d0 fvDOM: Corrected type of maxIter_
Resolves bug-report http://openfoam.org/mantisbt/view.php?id=2068
2016-04-26 10:51:09 +01:00
a4e2afa4b3 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
a8bf4be58a Standardized cell, patch, face and processor loop index names 2016-04-25 12:00:53 +01:00
8c4f6b8fcb Standardized cell, patch and face loop index names 2016-04-25 10:28:32 +01:00
6a27f7af46 boundaryField() -> boundaryFieldRef() 2016-04-24 22:07:37 +01:00
6005258c10 noScatter.H: Corrected #ifdef
Resolved bug-report http://openfoam.org/mantisbt/view.php?id=2065
2016-04-24 21:05:29 +01:00
77cad08dfa boundaryField() -> boundaryFieldRef() 2016-04-23 23:37:53 +01:00
89397e8076 boundaryField() -> boundaryFieldRef() 2016-04-23 23:16:30 +01:00
c25b48a747 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
b63a532ad7 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
2c6b405043 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
c79f06079d thermoSingleLayer: Corrected handling of non-constant Cp 2016-04-23 10:03:40 +01:00
f33b40c202 foamCalcFunctions: Avoid the inclusion of fvCFD.H 2016-04-22 14:21:50 +01:00
db1f124025 dictionary: Corrected topDict()
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=2060
2016-04-21 21:08:56 +01:00
56059e7fb9 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
858146ca4b 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
39bfef2b11 src/Allwmake: Added the new rigidBodyMeshMotion library 2016-04-19 11:11:22 +01:00
ccbb0b93c6 rigidBodyDynamics: Added support for running in parallel
The joint-space dynamics is solved on the master processor only and the
resulting joint-state distributed to the slave processors on which the
body-state is then updated.  This guarantees consistency of the body
position and orientation on all processors.
2016-04-19 10:32:25 +01:00
04485798c4 Updated header 2016-04-18 15:40:57 +01:00
ebf0011020 src/rigidBodyDynamics/rigidBodyMotion: Added support for acceleration relaxation 2016-04-18 15:40:23 +01:00
51bb50935c rigidBodyDynamics/bodies/sphere: Added support for the centre of mass being offset from the centre of rotation 2016-04-18 15:39:07 +01:00
cca76719d5 rigidBodyDynamics/bodies/cuboid: New body shape
Calculate the inertia from the lengths of the sides
2016-04-18 15:37:57 +01:00
99a987f1d5 src/OpenFOAM/primitives: inherit operator=(const Foam::zero) from base class where appropriate 2016-04-17 21:02:57 +01:00
189c6c6820 rigidBodyMeshMotion: Read initial state and g from dictionary if present 2016-04-17 15:46:22 +01:00
bac78ef989 PtrListIO: Indent list elements on output.
Particularly useful for lists of dictionaries.
2016-04-17 15:45:29 +01:00
04fe885920 BrownianMotionForce: Corrected expression for s0
Patch provided by Bruno Santos
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=2036
2016-04-17 15:39:09 +01:00
c1c4862028 Updated references
See also http://www.openfoam.org/mantisbt/view.php?id=2036
2016-04-17 15:29:51 +01:00
eda27b9e75 externalWallHeatFluxTemperatureFvPatchScalarField: Corrected handling of QrPrevious_
Patch contributed by Bruno Santos
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=2052
2016-04-16 18:43:51 +01:00
287603474a vector::zero -> Zero 2016-04-16 18:34:41 +01:00
04e4e1a7bb rigidBodyMeshMotion: displacementMotionSolver for the mesh-motion of multiple articulated rigid-bodies
The motion of the bodies is integrated using the rigidBodyDynamics
library with joints, restraints and external forces.

The mesh-motion is interpolated using septernion averaging.

This development is sponsored by Carnegie Wave Energy Ltd.
2016-04-16 16:02:25 +01:00
831e429dc8 linearSpring: Minor improvement in messages 2016-04-16 16:01:38 +01:00
fc32d53828 quaternion/septernion: Added multi- quaternion/septernion averaging
Using method based on
http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/20070017872.pdf
but simplified for the case where the quaternions are similar.
2016-04-16 15:59:05 +01:00
d02e0aa05f src/Pstream/mpi/UPstream.C: Updated for Int64
Patch contributed by Bruno Santos
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=2055
2016-04-16 13:26:41 +01:00
81b13d0244 sixDoFRigidBodyMotion: Updated for change in definition of septernion::transform 2016-04-15 11:33:06 +01:00
860a82c0d4 vector::zero -> Zero 2016-04-15 11:32:42 +01:00
6a5d5e903e septernion: Changed definition of the forward transformation for consistency with spatialTransform
inline Foam::vector Foam::septernion::transformPoint(const vector& v) const
{
    return r().transform(v - t());
}

Now there is a 1:1 correspondence between septernion and
spatialTransform and a septernion constructor from spatialTransform
provided.

Additionally "septernion::transform" has been renamed
"septernion::transformPoint" to clarify that it transforms coordinate
points rather than displacements or other relative vectors.
2016-04-15 11:27:18 +01:00
980717ad36 rigidBodySolver: Updated comments 2016-04-12 22:23:04 +01:00
bc70e36915 rigidBodyDynamics: Removed quaternion counter and index: 'nw', 'wIndex'
Replaced with 'unitQuaterion()' virtual function to indicate if the
joint uses a unit quaternion to represent rotation.
2016-04-12 22:17:52 +01:00
df1cb90dc6 rigidBodyDynamics: Simplify handling of quaternions by maintaining a unit quaternion in the joint state field 'q'
'w' is now obtained from 'v' using the relation w = sqrt(1 - |sqr(v)|)
and 'v' is stored in the joint state field 'q' and integrated in the
usual manner but corrected using quaternion transformations.
2016-04-12 21:44:34 +01:00
4197cb075a quaternion: Added static member function to return a unit quaternion constructed from a vector
//- Return the unit quaternion (versor) from the given vector
    //  (w = sqrt(1 - |sqr(v)|))
    static inline quaternion unit(const vector& v);
2016-04-12 21:43:03 +01:00
591cb1d11e rigidBodyDynamics/rigidBodySolvers: Added support for the integration of quaternion joints 2016-04-12 16:16:57 +01:00
9e24a9b5e2 rigidBodyDynamics: Simplified the interface to the solvers 2016-04-12 12:57:31 +01:00
5cfd0fbd47 Updated header 2016-04-12 11:36:59 +01:00