Commit Graph

1010 Commits

Author SHA1 Message Date
sergio
5daa38d5b4 ENH:
Update of overRhoPimpleDyMFoam and overInterDyMFoam solvers.
Adding corresponding tutorials with best possible settings
The main effort was put on reducing pressure spikes as the
stencil change with hole cells on the background mesh.
2018-10-17 10:10:06 -07:00
Mark Olesen
13778f7647 ENH: use dictionary::readEntry for detection of input errors (#762, #1033)
- instead of   dict.lookup(name) >> val;
  can use      dict.readEntry(name, val);

  for checking of input token sizes.
  This helps catch certain types of input errors:

  {

      key1 ;                // <- Missing value
      key2 1234             // <- Missing ';' terminator
      key3 val;
  }

STYLE: readIfPresent() instead of 'if found ...' in a few more places.
2018-10-05 10:15:13 +02:00
Andrew Heather
54457c68b6 Merge remote-tracking branch 'origin/master' into develop 2018-09-21 16:01:16 +01:00
Andrew Heather
5f3f101b4e BUG: Doxygen corrections 2018-09-11 12:13:19 +01:00
Mark Olesen
d82deea8e5 COMP: resolve compilation issues for single-precision (closes #932) 2018-07-11 19:24:16 +02:00
Will Bainbridge
2ae4bf73d9 fileHandler: Added flush method
This method waits until all the threads have completed IO operations and
then clears any cached information about the files on disk. This
replaces the deactivation of threading by means of zeroing the buffer
size when writing and reading of a file happen in sequence. It also
allows paraFoam to update the list of available times.

Patch contributed by Mattijs Janssens
Resolves bug report https://bugs.openfoam.org/view.php?id=2962
2018-06-27 11:45:58 +01:00
sergio
edcb649212 STY: Changing folder name for icoReactingMultiphaseInterFoam 2018-06-25 10:35:53 -07:00
Will Bainbridge
70bc72c2df twoPhaseMixtureThermo: Fix for collated file operation
twoPhaseMixtureThermo writes the temperatures during construction only
for them to be read again immediately after by construction of the
individual phases' thermo models. When running with collated file
handling this behaviour is not thread safe. This change deactivates
threading for the duration of this behaviour.

Patch contributed by Mattijs Janssens
2018-06-14 10:55:27 +01:00
Mark Olesen
4d6f0498d6 ENH: use vector::normalise and VectorSpace::normalised for clarity 2018-08-10 15:18:29 +02:00
Mark Olesen
dd9ecd4988 ENH: add missing Hash function for List/UList (issue #966)
- there were previously no hashing mechanisms for lists so they
  would fall back to the definition for primitives and hash the
  memory location of the allocated List object.

- provide a UList::Hash<> sub-class for inheritance, and also a global
  specialization for UList<T>, List<T> such that the hash value for
  List<List<T>> cascades properly.

- provide similar function in triFace to ensure that it remains
  similar in behaviour to face.

- added SymmHash to Pair, for use when order is unimportant.

STYLE: use string::hash() more consistently

- no particular reason to use Hash<word>() which forwards to
  string::hash() anyhow
2018-08-08 23:54:27 +02:00
Mark Olesen
f00c7a655c COMP: rename dictionary::read<T> to dictionary::readEntry<T>
- avoids compiler ambiguity when virtual methods such as
  IOdictionary::read() exist.

- the method was introduced in 1806, and was thus not yet widely used
2018-07-30 15:52:40 +02:00
Mark Olesen
27bbb516a3 STYLE: return nullptr instead of tmp<...>() for NotImplemented methods
- as per 018124e3bf
2018-07-27 14:20:01 +02:00
Mark Olesen
b1996f348c COMP: avoid compiler warnings about phasePairKey friend functions
- improve alignment of various phasePairKey implementations
2018-07-24 10:51:12 +02:00
Henry Weller
4fe6ed3c6a BUG: compressibleInterFoam: Corrected handling of thermal diffusivity with mixture turbulence model
Resolves bug-report https://bugs.openfoam.org/view.php?id=2958
2018-05-25 23:43:41 +01:00
Mark Olesen
d56744a66a STYLE: Renamed source files to reflect solver names (issue #890) 2018-06-21 16:14:16 +02:00
Mark Olesen
736d358782 STYLE: code tidying for icoReactingMultiPhaseInterFoam
- use Enum instead of NamedEnum
- shorter form for dimensionedScalar

- reduce verbosity about missed seeding for DTRM cloud.
  Re-enable old warnings in debug mode.
2018-06-21 13:35:22 +02:00
sergio
2790f2da4e ENH: Editing tutorials, and Make/files 2018-06-20 12:27:12 -07:00
Andrew Heather
c103331a6a INT: integration updates 2018-06-20 16:28:48 +01:00
mattijs
636328fc1c ENH: icoReactingMultiPhaseInterFoam: thermo sharing T 2018-06-15 14:05:37 +01:00
sergio
4cb073e150 ENH: Up to date icoReactingMultiphaseInterFoam solver and libs
Adding tutorials and other minor changes
2018-06-04 11:25:59 -07:00
Mark Olesen
96b65a781d STYLE: remove spacing around forAll macros and template '> >' closing 2018-07-06 11:03:28 +02:00
Mark Olesen
84784c5061 Merge remote-tracking branch 'origin/master' into develop 2018-07-13 13:25:11 +02:00
Mark Olesen
0304911921 STYLE: more consistent use of dimensioned Zero, scalar decimal points
- use scalar(0) instead of scalar(0.0) etc
2018-07-13 10:28:48 +02:00
Mark Olesen
2662042d49 ENH: improve controls for Time (issue #910)
- relocate some standard functionality to TimePaths to allow a lighter
  means of managing time directories without using the entire Time
  mechanism.

- optional enableLibs for Time construction (default is on)
  and a corresponding argList::noLibs() and "-no-libs" option

STYLE:

- mark Time::outputTime() as deprecated MAY-2016

- use pre-increment for runTime, although there is no difference in
  behaviour or performance.
2018-07-02 10:20:01 +02:00
sergio
d68adc4d31 ENH: Final stage for laserDTRM model and new icoReactingMultiphaseFoam 2017-08-10 09:17:55 -07:00
Andrew Heather
12e2142db8 COMP: refactoring to resolve compiler warnings - see #886 2018-06-20 10:56:04 +01:00
Johan Roenby
e6fd82f173 ENH: interIsoFoam updates
- Reimplemented treatment of alpha1, phi and U in case of
  nOuterCorrectors > 1 based on storePrevIter() to avoid cluttering the
  solver with unnecessary fields in case of nOuterCorrectors = 1.
2018-06-13 11:46:21 +02:00
Johan Roenby
bab72d5139 ENH: multiple updates to interIsoFoam related code
- Updated tutorial headers
- Added copyright note to isoAdvector src
- Removed outcommented code lines in interIsoFoam solver
- Removed all LTS from interIsoFoam since this is not currently supported
- Confirmed that discInConstantFlow gives identical results with N subCylces and time step N*dt
- Confirmed that this also holds when nOuterCorrectors > 1.
2018-06-12 23:14:10 +02:00
Johan Roenby
25a7e4da7b INT: Initial update of isoAdvector and interIsoFoam to work with AMR. 2018-06-11 17:51:54 +02:00
Andrew Heather
c909a5df25 GIT: resolved merge conflict 2018-06-13 14:20:18 +01:00
Mark Olesen
84b109219a STYLE: reduced usage of Switch
- Since 'bool' and 'Switch' use the _identical_ input mechanism
  (ie, both accept true/false, on/off, yes/no, none, 1/0), the main
  reason to prefer one or the other is the output.

  The output for Switch is as text (eg, "true"), whereas for bool
  it is label (0 or 1). If the output is required for a dictionary,
  Switch may be appropriate. If the output is not required, or is only
  used for Pstream exchange, bool can be more appropriate.
2018-06-01 20:51:48 +02:00
Mark Olesen
1c030f441d STYLE: missing newline in correctPhi.H 2018-05-30 16:18:20 +02:00
Mark Olesen
dc521b95df STYLE: consistent use of '= delete' 2018-05-30 12:03:17 +02:00
Mark Olesen
f9fe71815a STYLE: consistent use of '= delete' for removed constructors/assignments
- make the purpose more explicit, and reduces some work for the
  compiler as well.
2018-05-30 12:03:17 +02:00
Andrew Heather
b50bbc7ef2 ENH: Added new dry-run options to solvers 2018-01-11 14:23:17 +00:00
mattijs
f51ee9a0e2 Merge remote-tracking branch 'origin/develop' into develop-pre-release 2018-05-31 17:34:16 +01:00
Andrew Heather
ad25e18c7f Merge remote-tracking branch 'origin/develop' into develop-pre-release 2018-05-18 12:18:13 +01:00
Mark Olesen
48d654cf19 ENH: avoid memory leaks for HashPtrTable, PtrMap insertion (issue #749)
- disallow insert() of raw pointers, since a failed insertion
  (ie, entry already existed) results in an unmanaged pointer.

  Either insert using an autoPtr, or set() with raw pointers or autoPtr.

- IOobjectList::add() now takes an autoPtr instead of an object reference

- IOobjectList::remove() now returns an autoPtr instead of a raw pointer
2018-05-17 09:56:36 +01:00
sergio
b78d37e93c Merge branch 'develop-pre-release' of develop.openfoam.com:Development/OpenFOAM-plus into develop-pre-release 2018-05-18 01:31:17 -07:00
sergio
e0912a058c ENH: Adding pressure work terms for compressibleInterFoam
Removing temporary fix from compressibleInterDyFOAM to re-calculte Uf with morphing mesh
2018-05-18 01:27:13 -07:00
mattijs
d469bbae4b COMP: Allwmake: feed through 'objects' targer for wmakeCollect 2018-05-17 08:39:57 +01:00
Mark Olesen
4fe8ed8245 STYLE: use direct iteration for HashSet
- The iterator for a HashSet dereferences directly to its key.

- Eg,

      for (const label patchi : patchSet)
      {
          ...
      }
  vs.
      forAllConstIter(labelHashSet, patchSet, iter)
      {
          const label patchi = iter.key();
          ...
      }
2018-03-06 00:29:03 +01:00
Mark Olesen
dd8341f659 ENH: make format of ExecutionTime = ... output configurable (issue #788)
- controlled by the the 'printExecutionFormat' InfoSwitch in
  etc/controlDict

      // Style for "ExecutionTime = " output
      // - 0 = seconds (with trailing 's')
      // - 1 = day-hh:mm:ss

   ExecutionTime = 112135.2 s  ClockTime = 113017 s

   ExecutionTime = 1-07:08:55.20  ClockTime = 1-07:23:37

- Callable via the new Time::printExecutionTime() method,
  which also helps to reduce clutter in the applications.
  Eg,

     runTime.printExecutionTime(Info);

  vs

     Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
         << "  ClockTime = " << runTime.elapsedClockTime() << " s"
         << nl << endl;

--

ENH: return elapsedClockTime() and clockTimeIncrement as double

- previously returned as time_t, which is less portable.
2018-04-27 15:00:34 +02:00
Mark Olesen
b4d38ab468 ENH: improve handling of ThirdParty packages
- generalize some of the library extensions (.so vs .dylib).
  Provide as wmake 'sysFunctions'

- added note about unsupported/incomplete system support

- centralize detection of ThirdParty packages into wmake/ subdirectory
  by providing a series of scripts in the spirit of GNU autoconfig.
  For example,

      have_boost, have_readline, have_scotch, ...

  Each of the `have_<package>` scripts will generally provide the
  following type of functions:

      have_<package>          # detection
      no_<package>            # reset
      echo_<package>          # echoing

  and the following type of variables:

      HAVE_<package>          # unset or 'true'
      <package>_ARCH_PATH     # root for <package>
      <package>_INC_DIR       # include directory for <package>
      <package>_LIB_DIR       # library directory for <package>

  This simplifies the calling scripts:

      if have_metis
      then
          wmake metisDecomp
      fi

  As well as reducing clutter in the corresponding Make/options:

      EXE_INC = \
          -I$(METIS_INC_DIR) \
          -I../decompositionMethods/lnInclude

      LIB_LIBS = \
          -L$(METIS_LIB_DIR) -lmetis

  Any additional modifications (platform-specific or for an external build
  system) can now be made centrally.
2018-04-24 14:51:19 +02:00
Andrew Heather
a230e8d408 STYLE: Correcting typos 2018-03-28 17:14:16 +01:00
Mark Olesen
018124e3bf STYLE: use 'return nullptr' for empty autoPtr/tmp returns
- both autoPtr and tmp are defined with an implicit construct from
  nullptr (but with explicit construct from a pointer to null).
  Thus is it safe to use 'nullptr' when returning an empty autoPtr or tmp.
2018-03-21 09:31:09 +01:00
Mark Olesen
2f86cdc712 STYLE: more consistent use of dimensioned Zero
- when constructing dimensioned fields that are to be zero-initialized,
  it is preferrable to use a form such as

      dimensionedScalar(dims, Zero)
      dimensionedVector(dims, Zero)

  rather than

      dimensionedScalar("0", dims, 0)
      dimensionedVector("zero", dims, vector::zero)

  This reduces clutter and also avoids any suggestion that the name of
  the dimensioned quantity has any influence on the field's name.

  An even shorter version is possible. Eg,

      dimensionedScalar(dims)

  but reduces the clarity of meaning.

- NB: UniformDimensionedField is an exception to these style changes
  since it does use the name of the dimensioned type (instead of the
  regIOobject).
2018-03-16 10:24:03 +01:00
Mark Olesen
36719bf55b STYLE: consistent lookupOrDefault template parameters
- in many cases can just use lookupOrDefault("key", bool) instead of
  lookupOrDefault<bool> or lookupOrDefault<Switch> since reading a
  bool from an Istream uses the Switch(Istream&) anyhow

STYLE: relocated Switch string names into file-local scope
2018-03-26 09:09:09 +02:00
Mark Olesen
57291e8692 STYLE: use autoPtr::New and tmp::New for simple return types 2018-02-26 14:00:30 +01:00
Mark Olesen
660f3e5492 ENH: cleanup autoPtr class (issue #639)
Improve alignment of its behaviour with std::unique_ptr

  - element_type typedef
  - release() method - identical to ptr() method
  - get() method to get the pointer without checking and without releasing it.
  - operator*() for dereferencing

Method name changes

  - renamed rawPtr() to get()
  - renamed rawRef() to ref(), removed unused const version.

Removed methods/operators

  - assignment from a raw pointer was deleted (was rarely used).
    Can be convenient, but uncontrolled and potentially unsafe.
    Do allow assignment from a literal nullptr though, since this
    can never leak (and also corresponds to the unique_ptr API).

Additional methods

  - clone() method: forwards to the clone() method of the underlying
    data object with argument forwarding.

  - reset(autoPtr&&) as an alternative to operator=(autoPtr&&)

STYLE: avoid implicit conversion from autoPtr to object type in many places

- existing implementation has the following:

     operator const T&() const { return operator*(); }

  which means that the following code works:

       autoPtr<mapPolyMesh> map = ...;
       updateMesh(*map);    // OK: explicit dereferencing
       updateMesh(map());   // OK: explicit dereferencing
       updateMesh(map);     // OK: implicit dereferencing

  for clarity it may preferable to avoid the implicit dereferencing

- prefer operator* to operator() when deferenced a return value
  so it is clearer that a pointer is involve and not a function call
  etc    Eg,   return *meshPtr_;  vs.  return meshPtr_();
2018-02-26 12:00:00 +01:00