Skip to content
Snippets Groups Projects
  1. Nov 22, 2017
  2. Sep 22, 2017
  3. Jul 10, 2017
  4. May 24, 2017
  5. May 19, 2017
  6. Apr 27, 2017
  7. Apr 20, 2017
    • Henry Weller's avatar
      The "<type>Coeffs" sub-dictionary is now optional for most model parameters · 9801c257
      Henry Weller authored
      except turbulence and lagrangian which will also be updated shortly.
      
      For example in the nonNewtonianIcoFoam offsetCylinder tutorial the viscosity
      model coefficients may be specified in the corresponding "<type>Coeffs"
      sub-dictionary:
      
      transportModel  CrossPowerLaw;
      
      CrossPowerLawCoeffs
      {
          nu0         [0 2 -1 0 0 0 0]  0.01;
          nuInf       [0 2 -1 0 0 0 0]  10;
          m           [0 0 1 0 0 0 0]   0.4;
          n           [0 0 0 0 0 0 0]   3;
      }
      
      BirdCarreauCoeffs
      {
          nu0         [0 2 -1 0 0 0 0]  1e-06;
          nuInf       [0 2 -1 0 0 0 0]  1e-06;
          k           [0 0 1 0 0 0 0]   0;
          n           [0 0 0 0 0 0 0]   1;
      }
      
      which allows a quick change between models, or using the simpler
      
      transportModel  CrossPowerLaw;
      
      nu0         [0 2 -1 0 0 0 0]  0.01;
      nuInf       [0 2 -1 0 0 0 0]  10;
      m           [0 0 1 0 0 0 0]   0.4;
      n           [0 0 0 0 0 0 0]   3;
      
      if quick switching between models is not required.
      
      To support this more convenient parameter specification the inconsistent
      specification of seedSampleSet in the streamLine and wallBoundedStreamLine
      functionObjects had to be corrected from
      
          // Seeding method.
          seedSampleSet   uniform;  //cloud; //triSurfaceMeshPointSet;
      
          uniformCoeffs
          {
              type        uniform;
              axis        x;  //distance;
      
              // Note: tracks slightly offset so as not to be on a face
              start       (-1.001 -0.05 0.0011);
              end         (-1.001 -0.05 1.0011);
              nPoints     20;
          }
      
      to the simpler
      
          // Seeding method.
          seedSampleSet
          {
              type        uniform;
              axis        x;  //distance;
      
              // Note: tracks slightly offset so as not to be on a face
              start       (-1.001 -0.05 0.0011);
              end         (-1.001 -0.05 1.0011);
              nPoints     20;
          }
      
      which also support the "<type>Coeffs" form
      
          // Seeding method.
          seedSampleSet
          {
              type        uniform;
      
              uniformCoeffs
              {
                  axis        x;  //distance;
      
                  // Note: tracks slightly offset so as not to be on a face
                  start       (-1.001 -0.05 0.0011);
                  end         (-1.001 -0.05 1.0011);
                  nPoints     20;
              }
          }
      9801c257
  8. Apr 11, 2017
  9. Mar 17, 2017
  10. Jan 30, 2017
  11. Jan 26, 2017
  12. Jan 17, 2017
    • Henry Weller's avatar
      Multi-phase solvers: Improved handling of inflow/outflow BCs in MULES · ad92287a
      Henry Weller authored
      Avoids slight phase-fraction unboundedness at entertainment BCs and improved
      robustness.
      
      Additionally the phase-fractions in the multi-phase (rather than two-phase)
      solvers are adjusted to avoid the slow growth of inconsistency ("drift") caused
      by solving for all of the phase-fractions rather than deriving one from the
      others.
      ad92287a
  13. Dec 15, 2016
    • Henry Weller's avatar
      Rationalized heat release rate functions · 1a2c77ab
      Henry Weller authored
      Combined 'dQ()' and 'Sh()' into 'Qdot()' which returns the heat-release rate in
      the normal units [kg/m/s3] and used as the heat release rate source term in
      the energy equations, to set the field 'Qdot' in several combustion solvers
      and for the evaluation of the local time-step when running LTS.
      1a2c77ab
  14. Dec 01, 2016
  15. Nov 09, 2016
    • Henry Weller's avatar
      reactingEulerFoam, twoPhaseEulerFoam: Reinstated interfacial pressure-work · 0b2e584f
      Henry Weller authored
      Added the interfacial pressure-work terms according to:
      
      Ishii, M., Hibiki, T.,
      Thermo-fluid dynamics of two-phase flow,
      ISBN-10: 0-387-28321-8, 2006
      
      While this is the most common approach to handling the interfacial
      pressure-work it introduces numerical stability issues in regions of low
      phase-fraction and rapid flow deformation.  To alleviate this problem an
      optional limiter may be applied to the pressure-work term in either of
      the energy forms.  This may specified in the
      "thermophysicalProperties.<phase>" file, e.g.
      
      pressureWorkAlphaLimit 1e-3;
      
      which sets the pressure work term to 0 for phase-fractions below 1e-3.
      
      For particularly unstable cases a limit of 1e-2 may be necessary.
      0b2e584f
  16. Nov 04, 2016
    • Henry Weller's avatar
      reactingEulerFoam: Corrected and rationalized pressure-work · 527e1c87
      Henry Weller authored
      In many publications and Euler-Euler codes the pressure-work term in the
      total enthalpy is stated and implemented as -alpha*dp/dt rather than the
      conservative form derived from the total internal energy equation
      -d(alpha*p)/dt.  In order for the enthalpy and internal energy equations
      to be consistent this error/simplification propagates to the total
      internal energy equation as a spurious additional term p*d(alpha)/dt
      which is included in the OpenFOAM Euler-Euler solvers and causes
      stability and conservation issues.
      
      I have now re-derived the energy equations for multiphase flow from
      first-principles and implemented in the reactingEulerFoam solvers the
      correct conservative form of pressure-work in both the internal energy
      and enthalpy equations.
      
      Additionally an optional limiter may be applied to the pressure-work
      term in either of the energy forms to avoid spurious fluctuations in the
      phase temperature in regions where the phase-fraction -> 0.  This may
      specified in the "thermophysicalProperties.<phase>" file, e.g.
      
      pressureWorkAlphaLimit 1e-3;
      
      which sets the pressure work term to 0 for phase-fractions below 1e-3.
      527e1c87
  17. Oct 07, 2016
  18. Aug 05, 2016
  19. Jul 29, 2016
  20. Jul 17, 2016
    • Henry Weller's avatar
      TDACChemistryModel: New chemistry model providing Tabulation of Dynamic Adaptive Chemistry · f2c263b9
      Henry Weller authored
      Provides efficient integration of complex laminar reaction chemistry,
      combining the advantages of automatic dynamic specie and reaction
      reduction with ISAT (in situ adaptive tabulation).  The advantages grow
      as the complexity of the chemistry increases.
      
      References:
          Contino, F., Jeanmart, H., Lucchini, T., & D’Errico, G. (2011).
          Coupling of in situ adaptive tabulation and dynamic adaptive chemistry:
          An effective method for solving combustion in engine simulations.
          Proceedings of the Combustion Institute, 33(2), 3057-3064.
      
          Contino, F., Lucchini, T., D'Errico, G., Duynslaegher, C.,
          Dias, V., & Jeanmart, H. (2012).
          Simulations of advanced combustion modes using detailed chemistry
          combined with tabulation and mechanism reduction techniques.
          SAE International Journal of Engines,
          5(2012-01-0145), 185-196.
      
          Contino, F., Foucher, F., Dagaut, P., Lucchini, T., D’Errico, G., &
          Mounaïm-Rousselle, C. (2013).
          Experimental and numerical analysis of nitric oxide effect on the
          ignition of iso-octane in a single cylinder HCCI engine.
          Combustion and Flame, 160(8), 1476-1483.
      
          Contino, F., Masurier, J. B., Foucher, F., Lucchini, T., D’Errico, G., &
          Dagaut, P. (2014).
          CFD simulations using the TDAC method to model iso-octane combustion
          for a large range of ozone seeding and temperature conditions
          in a single cylinder HCCI engine.
          Fuel, 137, 179-184.
      
      Two tutorial cases are currently provided:
          + tutorials/combustion/chemFoam/ic8h18_TDAC
          + tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D_GRI_TDAC
      
      the first of which clearly demonstrates the advantage of dynamic
      adaptive chemistry providing ~10x speedup,
      
      the second demonstrates ISAT on the modest complex GRI mechanisms for
      methane combustion, providing a speedup of ~4x.
      
      More tutorials demonstrating TDAC on more complex mechanisms and cases
      will be provided soon in addition to documentation for the operation and
      settings of TDAC.  Also further updates to the TDAC code to improve
      consistency and integration with the rest of OpenFOAM and further
      optimize operation can be expected.
      
      Original code providing all algorithms for chemistry reduction and
      tabulation contributed by Francesco Contino, Tommaso Lucchini, Gianluca
      D’Errico, Hervé Jeanmart, Nicolas Bourgeois and Stéphane Backaert.
      
      Implementation updated, optimized and integrated into OpenFOAM-dev by
      Henry G. Weller, CFD Direct Ltd with the help of Francesco Contino.
      f2c263b9
  21. May 30, 2016
  22. Apr 30, 2016
    • Henry Weller's avatar
      Updated headers · 4da46e7c
      Henry Weller authored
      4da46e7c
    • Henry Weller's avatar
      GeometricField: Renamed internalField() -> primitiveField() and... · fe43b805
      Henry Weller authored
      GeometricField: Renamed internalField() -> primitiveField() and dimensionedInternalField() -> internalField()
      
      These new names are more consistent and logical because:
      
      primitiveField():
      primitiveFieldRef():
          Provides low-level access to the Field<Type> (primitive field)
          without dimension or mesh-consistency checking.  This should only be
          used in the low-level functions where dimensional consistency is
          ensured by careful programming and computational efficiency is
          paramount.
      
      internalField():
      internalFieldRef():
          Provides access to the DimensionedField<Type, GeoMesh> of values on
          the internal mesh-type for which the GeometricField is defined and
          supports dimension and checking and mesh-consistency checking.
      fe43b805
  23. Apr 28, 2016
    • Henry Weller's avatar
      GeometricField::GeometricBoundaryField -> GeometricField::Boundary · 75ea7618
      Henry Weller authored
      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 a25a449c
      
      This is a very simple text substitution change which can be applied to
      any code which compiles with the OpenFOAM-dev libraries.
      75ea7618
  24. Apr 25, 2016
    • Henry Weller's avatar
      Completed boundaryField() -> boundaryFieldRef() · a4e2afa4
      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()".
      a4e2afa4
  25. Apr 24, 2016
  26. Apr 22, 2016
  27. Apr 16, 2016
  28. Apr 06, 2016
  29. Mar 22, 2016
  30. Feb 29, 2016
  31. Feb 26, 2016
    • Henry Weller's avatar
      OpenFOAM: Updated all libraries, solvers and utilities to use the new const-safe tmp · 78590832
      Henry Weller authored
      The deprecated non-const tmp functionality is now on the compiler switch
      NON_CONST_TMP which can be enabled by adding -DNON_CONST_TMP to EXE_INC
      in the Make/options file.  However, it is recommended to upgrade all
      code to the new safer tmp by using the '.ref()' member function rather
      than the non-const '()' dereference operator when non-const access to
      the temporary object is required.
      
      Please report any problems on Mantis.
      
      Henry G. Weller
      CFD Direct.
      78590832
  32. Feb 24, 2016
    • Henry Weller's avatar
      tmp: Improved reference count checks to provide better error diagnostics · 3a56ebf3
      Henry Weller authored
      in case of tmp misuse.
      
      Simplified tmp reuse pattern in field algebra to use tmp copy and
      assignment rather than the complex delayed call to 'ptr()'.
      
      Removed support for unused non-const 'REF' storage of non-tmp objects due to C++
      limitation in constructor overloading: if both tmp(T&) and tmp(const T&)
      constructors are provided resolution is ambiguous.
      
      The turbulence libraries have been upgraded and '-DCONST_TMP' option
      specified in the 'options' file to switch to the new 'tmp' behavior.
      3a56ebf3
  33. Feb 22, 2016
    • Henry Weller's avatar
      tmp: Updated to store and preserve the const-ness of the reference to a constant object · 4758c2ac
      Henry Weller authored
      This change requires that the de-reference operator '()' returns a
      const-reference to the object stored irrespective of the const-ness of
      object stored and the new member function 'ref()' is provided to return
      an non-const reference to stored object which throws a fatal error if the
      stored object is const.
      
      In order to smooth the transition to this new safer 'tmp' the now
      deprecated and unsafe non-const de-reference operator '()' is still
      provided by default but may be switched-off with the compilation switch
      'CONST_TMP'.
      
      The main OpenFOAM library has already been upgraded and '-DCONST_TMP'
      option specified in the 'options' file to switch to the new 'tmp'
      behavior.  The rest of OpenFOAM-dev will be upgraded over the following
      few weeks.
      
      Henry G. Weller
      CFD Direct
      4758c2ac
  34. Feb 20, 2016
    • Henry Weller's avatar
      Boundary conditions: Added extrapolatedCalculatedFvPatchField · 7d192447
      Henry Weller authored
      To be used instead of zeroGradientFvPatchField for temporary fields for
      which zero-gradient extrapolation is use to evaluate the boundary field
      but avoiding fields derived from temporary field using field algebra
      inheriting the zeroGradient boundary condition by the reuse of the
      temporary field storage.
      
      zeroGradientFvPatchField should not be used as the default patch field
      for any temporary fields and should be avoided for non-temporary fields
      except where it is clearly appropriate;
      extrapolatedCalculatedFvPatchField and calculatedFvPatchField are
      generally more suitable defaults depending on the manner in which the
      boundary values are specified or evaluated.
      
      The entire OpenFOAM-dev code-base has been updated following the above
      recommendations.
      
      Henry G. Weller
      CFD Direct
      7d192447
  35. Jan 25, 2016
    • mattijs's avatar
      ENH: glboal file handling: initial commit · c7848a72
      mattijs authored
      Moved file path handling to regIOobject and made it type specific so
      now every object can have its own rules. Examples:
      - faceZones are now processor local (and don't search up anymore)
      - timeStampMaster is now no longer hardcoded inside IOdictionary
        (e.g. uniformDimensionedFields support it as well)
      - the distributedTriSurfaceMesh is properly processor-local; no need
        for fileModificationChecking manipulation.
      c7848a72
  36. Jan 10, 2016