Skip to content
Snippets Groups Projects
  1. Apr 30, 2016
  2. Apr 29, 2016
  3. Apr 28, 2016
  4. Apr 27, 2016
  5. Apr 26, 2016
  6. Apr 25, 2016
    • Henry Weller's avatar
      Completed boundaryField() -> boundaryFieldRef() · 22f4ad32
      Henry Weller authored
      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()".
      22f4ad32
    • Henry Weller's avatar
    • Henry Weller's avatar
      43beb060
  7. Apr 24, 2016
  8. Apr 23, 2016
    • Henry Weller's avatar
      boundaryField() -> boundaryFieldRef() · d8f8498c
      Henry Weller authored
      d8f8498c
    • Henry Weller's avatar
      boundaryField() -> boundaryFieldRef() · 7c12f774
      Henry Weller authored
      7c12f774
    • Henry Weller's avatar
      GeometricField: New non-const access function boundaryFieldRef() · 45f73bf6
      Henry Weller authored
      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.
      45f73bf6
    • Henry Weller's avatar
      plenumPressureFvPatchScalarField: New plenum pressure boundary condition · 88561eea
      Henry Weller authored
      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
      88561eea
    • Henry Weller's avatar
      fireFoam: Added optional hydrostatic initialization of the pressure and density · 673e0d17
      Henry Weller authored
      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.
      673e0d17
    • Henry Weller's avatar
  9. Apr 22, 2016
  10. Apr 21, 2016
  11. Apr 19, 2016
  12. Apr 18, 2016