Skip to content
Snippets Groups Projects
  1. Jun 08, 2017
  2. May 19, 2017
  3. May 17, 2017
  4. May 18, 2017
  5. Apr 20, 2017
    • Henry Weller's avatar
      The "<type>Coeffs" sub-dictionary is now optional for most model parameters · 5c518365
      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;
              }
          }
      5c518365
  6. Apr 13, 2017
  7. Feb 18, 2017
    • Henry Weller's avatar
      thermophysicalProperties: New base-class for liquidProperties and in the future gasProperties · d2be6454
      Henry Weller authored
      Description
          Base-class for thermophysical properties of solids, liquids and gases
          providing an interface compatible with the templated thermodynamics
          packages.
      
      liquidProperties, solidProperties and thermophysicalFunction libraries have been
      combined with the new thermophysicalProperties class into a single
      thermophysicalProperties library to simplify compilation and linkage of models,
      libraries and applications dependent on these classes.
      d2be6454
  8. Feb 17, 2017
    • Henry Weller's avatar
      thermophysicalModels: Changed specie thermodynamics from mole to mass basis · c52e4b58
      Henry Weller authored
      The fundamental properties provided by the specie class hierarchy were
      mole-based, i.e. provide the properties per mole whereas the fundamental
      properties provided by the liquidProperties and solidProperties classes are
      mass-based, i.e. per unit mass.  This inconsistency made it impossible to
      instantiate the thermodynamics packages (rhoThermo, psiThermo) used by the FV
      transport solvers on liquidProperties.  In order to combine VoF with film and/or
      Lagrangian models it is essential that the physical propertied of the three
      representations of the liquid are consistent which means that it is necessary to
      instantiate the thermodynamics packages on liquidProperties.  This requires
      either liquidProperties to be rewritten mole-based or the specie classes to be
      rewritten mass-based.  Given that most of OpenFOAM solvers operate
      mass-based (solve for mass-fractions and provide mass-fractions to sub-models it
      is more consistent and efficient if the low-level thermodynamics is also
      mass-based.
      
      This commit includes all of the changes necessary for all of the thermodynamics
      in OpenFOAM to operate mass-based and supports the instantiation of
      thermodynamics packages on liquidProperties.
      
      Note that most users, developers and contributors to OpenFOAM will not notice
      any difference in the operation of the code except that the confusing
      
          nMoles     1;
      
      entries in the thermophysicalProperties files are no longer needed or used and
      have been removed in this commet.  The only substantial change to the internals
      is that species thermodynamics are now "mixed" with mass rather than mole
      fractions.  This is more convenient except for defining reaction equilibrium
      thermodynamics for which the molar rather than mass composition is usually know.
      The consequence of this can be seen in the adiabaticFlameT, equilibriumCO and
      equilibriumFlameT utilities in which the species thermodynamics are
      pre-multiplied by their molecular mass to effectively convert them to mole-basis
      to simplify the definition of the reaction equilibrium thermodynamics, e.g. in
      equilibriumCO
      
          // Reactants (mole-based)
          thermo FUEL(thermoData.subDict(fuelName)); FUEL *= FUEL.W();
      
          // Oxidant (mole-based)
          thermo O2(thermoData.subDict("O2")); O2 *= O2.W();
          thermo N2(thermoData.subDict("N2")); N2 *= N2.W();
      
          // Intermediates (mole-based)
          thermo H2(thermoData.subDict("H2")); H2 *= H2.W();
      
          // Products (mole-based)
          thermo CO2(thermoData.subDict("CO2")); CO2 *= CO2.W();
          thermo H2O(thermoData.subDict("H2O")); H2O *= H2O.W();
          thermo CO(thermoData.subDict("CO")); CO *= CO.W();
      
          // Product dissociation reactions
      
          thermo CO2BreakUp
          (
              CO2 == CO + 0.5*O2
          );
      
          thermo H2OBreakUp
          (
              H2O == H2 + 0.5*O2
          );
      
      Please report any problems with this substantial but necessary rewrite of the
      thermodynamic at https://bugs.openfoam.org
      
      Henry G. Weller
      CFD Direct Ltd.
      c52e4b58
  9. Jan 19, 2017
  10. Dec 19, 2016
    • Henry Weller's avatar
      reactingFoam::setRDeltaT: Add support for limiting the local time-step by the reaction rates · 6cae0fda
      Henry Weller authored
      e.g. in the reactingFoam/laminar/counterFlowFlame2DLTS tutorial:
      
      PIMPLE
      {
          momentumPredictor no;
          nOuterCorrectors  1;
          nCorrectors     1;
          nNonOrthogonalCorrectors 0;
      
          maxDeltaT       1e-2;
          maxCo           1;
          alphaTemp       0.05;
          alphaY          0.05;
          Yref
          {
              O2          0.1;
              ".*"        1;
          }
          rDeltaTSmoothingCoeff 1;
          rDeltaTDampingCoeff 1;
      }
      
      will limit the LTS time-step according to the rate of consumption of 'O2'
      normalized by the reference mass-fraction of 0.1 and all other species
      normalized by the reference mass-fraction of 1.  Additionally the time-step
      factor of 'alphaY' is applied to all species.  Only the species specified in the
      'Yref' sub-dictionary are included in the LTS limiter and if 'alphaY' is omitted
      or set to 1 the reaction rates are not included in the LTS limiter.
      6cae0fda
  11. Dec 15, 2016
    • Henry Weller's avatar
      Rationalized heat release rate functions · b99817d9
      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.
      b99817d9
  12. Oct 31, 2016
  13. Oct 27, 2016
  14. Oct 26, 2016
  15. Sep 23, 2016
  16. Sep 19, 2016
  17. Aug 01, 2016
  18. Jul 17, 2016
    • Henry Weller's avatar
      TDACChemistryModel: New chemistry model providing Tabulation of Dynamic Adaptive Chemistry · 1d572696
      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.
      1d572696
  19. Jul 06, 2016
  20. Jun 09, 2016
  21. May 09, 2016
  22. May 01, 2016
  23. Apr 30, 2016
    • Henry Weller's avatar
      Updated headers · 81f31acb
      Henry Weller authored
      81f31acb
    • Henry Weller's avatar
      GeometricField: Renamed internalField() -> primitiveField() and... · 3c053c2f
      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.
      3c053c2f
    • Henry Weller's avatar
      GeometricField::dimensionedInteralFieldRef() -> GeometricField::ref() · ccd958a8
      Henry Weller authored
      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()".
      ccd958a8
    • Henry Weller's avatar
      GeometricField::internalField() -> GeometricField::internalFieldRef() · 5df2b964
      Henry Weller authored
      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 22f4ad32
      5df2b964
  24. Apr 28, 2016
    • Henry Weller's avatar
      fireFoam: New additional controls switch "solvePyrolysisRegion" · 62c62abd
      Henry Weller authored
      provides optional control for solving the pyrolysis region.
      
      Patch contributed by Karl Meredith, FMGlobal.
      62c62abd
    • Henry Weller's avatar
      GeometricField::GeometricBoundaryField -> GeometricField::Boundary · ea5401c7
      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 4a57b9be
      
      This is a very simple text substitution change which can be applied to
      any code which compiles with the OpenFOAM-dev libraries.
      ea5401c7
  25. Apr 27, 2016
    • Henry Weller's avatar
      GeometricField: Rationalized and simplified access to the dimensioned internal field · 4a57b9be
      Henry Weller authored
      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.
      4a57b9be
  26. Apr 26, 2016
  27. Apr 25, 2016
    • Andrew Heather's avatar
    • 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
      43beb060
  28. Apr 23, 2016
    • 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
  29. Apr 16, 2016
  30. Apr 06, 2016
  31. Mar 22, 2016
  32. Feb 26, 2016
    • Henry Weller's avatar
      OpenFOAM: Updated all libraries, solvers and utilities to use the new const-safe tmp · cd852be3
      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.
      cd852be3