Commit Graph

6659 Commits

Author SHA1 Message Date
Mark Olesen
f94be1bebb ENH: use FatalIOErrorInLookup instead of FatalErrorInLookup 2019-07-16 10:26:51 +02:00
Mark Olesen
fb09f56aba ENH: use FatalErrorInLookup macros (#1362) 2019-07-12 18:00:00 +02:00
Mark Olesen
1d86fc4f6b ENH: add single-parameter sortedOrder() function 2019-07-17 11:08:40 +02:00
Mark Olesen
5788fe056c STYLE: missing -postProcess option on basic solvers (#1375) 2019-07-16 12:09:00 +02:00
Mark Olesen
ba3f0734c0 ENH: added FatalErrorInLookup, FatalIOErrorInLookup macros (#1362)
- to simplify/unify error handling

STYLE: use NotImplemented instead of longer notImplemented(...)
2019-07-12 18:00:00 +02:00
Mark Olesen
bbc2d4a8b0 ENH: HashTable and HashSet improvements
- unfriend HashSet, HashTable IO operators

- global min(), max(), minMax() functions taking a labelHashSet and an
  optional limit. For example,

      labelHashSet set = ...;

      Info<< "min is " << min(set) << nl;
      Info<< "max (non-negative) " << max(set, 0) << nl;

- make HashTable iterator '->' dereferencing more consistent by also
  supporting non-pointer types as well.

- read HashTable values in-situ to avoid copying
2019-07-12 18:00:00 +02:00
Mark Olesen
488f8938b2 ENH: add invert (inverse mappings) for bitSet 2019-07-12 12:00:00 +02:00
Mark Olesen
f1a48a3c2f ENH: accept bitSet for MeshedSurface::subsetMesh
- add triSurface::subsetMesh single-parameter variant
2019-07-12 08:54:34 +02:00
Mark Olesen
10a03ceba2 STYLE: relocate Allwmake-scan to src/
- reduced clutter. Mostly only need to scan source tree.

- 00-dummy: use wmake/src/Allmake to get native (not cross-compiled)
  wmake toolchain binaries
2019-06-28 09:55:25 +02:00
Andrew Heather
96e7dd8da6 Merge branch 'develop' 2019-06-27 13:27:57 +01:00
Andrew Heather
15a763b931 COMP: Resolved some name clashes for #ifdef statements 2019-06-26 11:52:15 +01:00
Andrew Heather
be44dcaf1f RELEASE: Version clean-up for release 2019-06-25 11:51:19 +01:00
OpenFOAM bot
51bb4e0037 STYLE: remove trailing spaces 2019-06-26 11:36:49 +02:00
sergio
d286951008 BUG: Fix thermos templates for Lee model 2019-06-25 08:50:07 -07:00
sergio
016526baee Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2019-06-24 08:13:47 -07:00
sergio
1bd2ef7c21 ENH: Adding Lee thermos for icoReactingMultiphaseInterFoam 2019-06-24 08:12:58 -07:00
Mark Olesen
fa8ab2d5b4 STYLE: add Test-copyFile 2019-06-24 14:46:38 +02:00
mattijs
8e3df10069 STYLE: overBuoyantPimpleDyMFoam: consistent directory naming 2019-06-20 10:26:24 +01:00
Vaggelis Papoutsis
ecc1fb5efb CONTRIB: New adjoint optimisation and tools
A set of libraries and executables creating a workflow for performing
gradient-based optimisation loops. The main executable (adjointOptimisationFoam)
solves the flow (primal) equations, followed by the adjoint equations and,
eventually, the computation of sensitivity derivatives.

Current functionality supports the solution of the adjoint equations for
incompressible turbulent flows, including the adjoint to the Spalart-Allmaras
turbulence model and the adjoint to the nutUSpaldingWallFunction, [1], [2].

Sensitivity derivatives are computed with respect to the normal displacement of
boundary wall nodes/faces (the so-called sensitivity maps) following the
Enhanced Surface Integrals (E-SI) formulation, [3].

The software was developed by PCOpt/NTUA and FOSS GP, with contributions from

Dr. Evangelos Papoutsis-Kiachagias,
Konstantinos Gkaragounis,
Professor Kyriakos Giannakoglou,
Andy Heather

and contributions in earlier version from

Dr. Ioannis Kavvadias,
Dr. Alexandros Zymaris,
Dr. Dimitrios Papadimitriou

[1] A.S. Zymaris, D.I. Papadimitriou, K.C. Giannakoglou, and C. Othmer.
Continuous adjoint approach to the Spalart-Allmaras turbulence model for
incompressible flows. Computers & Fluids, 38(8):1528–1538, 2009.

[2] E.M. Papoutsis-Kiachagias and K.C. Giannakoglou. Continuous adjoint methods
for turbulent flows, applied to shape and topology optimization: Industrial
applications. 23(2):255–299, 2016.

[3] I.S. Kavvadias, E.M. Papoutsis-Kiachagias, and K.C. Giannakoglou. On the
proper treatment of grid sensitivities in continuous adjoint methods for shape
optimization. Journal of Computational Physics, 301:1–18, 2015.

Integration into the official OpenFOAM release by OpenCFD
2019-06-17 12:59:11 +01:00
Mark Olesen
f0a4f8ee48 COMP: skip reactingEulerFoam compilation on mingw (#1238)
- pending resolution of cyclic dependencies
2019-06-14 13:58:37 +02:00
mattijs
64ed81b78f BUG: gmsh: skip empty lines. See #1155.
Fix provided by Gavin Ridley.
2019-04-11 11:07:28 +01:00
Mark Olesen
8ab09daad0 BUG: foamToVTK writes to undecomposed case (closes #1271)
- when running in serial but within a processor directory,
  argList::globalPath() is to be used instead of Time.globalPath()
  For other cases there is no difference.
2019-04-08 11:53:50 +02:00
Mark Olesen
44d7dc8545 BUG: dereference invalid autoPtr in XiEngineFoam (fixes #1250) 2019-03-26 09:42:27 +01:00
Andrew Heather
7322f73a31 Merge branch 'feature-isoAdvectorWithMorphingMeshes' into 'develop'
Introduced changes required to make isoAdvector and interIsoFoam work with...

See merge request Development/OpenFOAM-plus!257
2019-06-13 21:35:20 +01:00
sergio
da07aa9ac0 Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2019-06-13 12:13:04 -07:00
sergio
50cdddf46a ENH: New solidThermo to ReactingMultiphaseInterFoam 2019-06-13 12:11:09 -07:00
Mark Olesen
f863925112 STYLE: use uintptr_t instead of long 2019-06-13 19:37:27 +02:00
mattijs
e716d1c073 ENH: surfactantFoam: run cleanly. See #1328
- do not write 0/ directory
- clean case in ./Allclean
2019-06-13 14:24:58 +01:00
sergio
b1563dc03e ENH: Handling of phaseProperties in temperatureCoupledBase.
Adding poly solid thermo to InterfaceCompositionModel for use
on icoReactingMultiphaseInterFoam
2019-06-12 10:35:49 -07:00
sergio
3a1178ff12 BUG: Fixing problem with parallel DTRMParticle 2019-06-11 16:12:36 -07:00
Sergio Ferraris
8170f2ad92 INT: Org integration of VOF, Euler phase solvers and models.
Integration of VOF MULES new interfaces. Update of VOF solvers and all instances
of MULES in the code.
Integration of reactingTwoPhaseEuler and reactingMultiphaseEuler solvers and sub-models
Updating reactingEuler tutorials accordingly (most of them tested)

New eRefConst thermo used in tutorials. Some modifications at thermo specie level
affecting mostly eThermo. hThermo mostly unaffected

New chtMultiRegionTwoPhaseEulerFoam solver for quenching and tutorial.

Phases sub-models for reactingTwoPhaseEuler and reactingMultiphaseEuler were moved
to src/phaseSystemModels/reactingEulerFoam in order to be used by BC for
chtMultiRegionTwoPhaseEulerFoam.

Update of interCondensatingEvaporatingFoam solver.
2019-06-07 09:38:35 +01:00
Andrew Heather
24371a1d84 BUG: set the oriented flag - see #1324 2019-06-05 14:12:51 +01:00
Andrew Heather
289a7acf76 ENH: p field for potentialFoam now registsered 2019-06-05 14:11:50 +01:00
Johan Roenby
61c87b5552 Introduced changes required to make isoAdvector and interIsoFoam work with morphing meshes: 1) In the alphaEqn.H U is made relative to mesh motion before the interface advection step, 2) in isoAdvection::advect() alpha must be multiplied by Vsc0()/Vsc(). Implementation tested and verified with 1) a spherical interface in a cubic domain with no flow, where the domain walls are squeezed together and 2) a spherical interfacee inside the sloshingCylinder, again with no flow, so the sphere should stay spherical, which it does. 2019-04-30 16:07:48 +02:00
Mark Olesen
03de501310 STYLE: fix file permissions, inconsistent Test files 2019-06-04 17:50:18 +02:00
sergio
5c58b07f5a ENH: Adding overBuoyantPimpleFoam and tutorial 2019-06-04 12:18:13 -07:00
kuti
e42cc287de BUG: incorrect scalar/complex division (#1331)
ENH: define addition/subtraction operations for scalar and complex

- required since construct complex from scalar is explicit
- additional tests in Test-complex
2019-06-04 09:08:42 +01:00
Mark Olesen
fc11c40841 ENH: add wmake -debug option
- forces c++DBUG='-DFULLDEBUG -g -O0' for the compilation, to allow
  localized debugging during development without file editing and
  while retaining the WM_COMPILE_OPTION (eg, Opt)

  Note that switching between 'wmake' and 'wmake -debug' will not
  cause existing targets to be rebuilt. As before, these are driven by
  the dependencies. An intermediate wclean may thus be required.
2019-06-03 10:16:31 +02:00
kuti
745624c024 ENH: partial overhaul of Matrix type (#1220)
- additional operators:
  + compound assignment
  + inner product: operator&
  + outer product: operator^

- additional functions:
   - MatrixBlock methods: subColumn, subRow, subMatrix
   - L2 norms for matrix or column
   - trace, diag, round, transpose

- MatrixBlock methods: col(), block() are deprecated since their
  access patterns with (size, offset) are unnatural/unwieldy.

- verifications by test/Matrix/Test-Matrix
2019-05-23 11:32:45 +01:00
Mark Olesen
db0678bf0e TUT: incorrect regex escaping in fvSchemes
- error trapped by C++11 regex
2019-05-30 14:26:15 +02:00
Mark Olesen
96d0a8f2af ENH: harmonize matrix constructors (#1220)
- generalize identity matrix constructors for non-scalar types

- add constructors using labelPair for the row/column sizing information.
  For a SquareMatrix, this provides an unambiguous parameter resolution.

- reuse assignment operators

STYLE: adjust matrix comments
2019-05-29 09:50:46 +02:00
mattijs
7945ca739c ENH: correct sumProd return type (#1086)
- previously returned scalar, but now return pTraits cmptType
  which is the same as scalarProduct / outerProduct type.
2019-02-10 14:31:35 +00:00
Mark Olesen
aab644a3fc STYLE: eliminate complex constants that are duplications of pTraits
- eg pTraits<complex>::zero, pTraits<complex>::one instead.
  This is consistent with other primitives such as scalar, label etc.
2019-05-27 18:09:43 +02:00
Mark Olesen
66a100997f COMP: force dlOpen for windows application binaries (#1238)
- when windows portable executables (.exe or .dll) files are loaded,
  their dependent libraries not fully loaded. For OpenFOAM this means
  that the static constructors which are responsible for populating
  run-time selection tables are not triggered, and most of the run-time
  selectable models will simply not be available.

Possible Solution
=================

  Avoid this problem by defining an additional library symbol such as
  the following:

      extern "C" void libName_Load() {}

  in the respective library, and tag this symbol as 'unresolved' for
  the linker so that it will attempt to resolve it at run-time by
  loading the known libraries until it finds it. The link line would
  resemble the following:

      -L/some/path -llibName -ulibName_Load

  Pros:
    - Allows precise control of forced library loading

  Cons:
    - Moderately verbose adjustment of some source files (even with macro
      wrapping for the declaration).
    - Adjustment of numerous Make/options files and somewhat ad hoc
      in nature.
    - Requires additional care when implementing future libraries and/or
      applications.

  - This is the solution taken by the symscape patches (Richard Smith)

Possible Solution
=================

  Avoid this problem by simply force loading all linked libraries.
  This is done by "scraping" the information out of the respective
  Make/options file (after pre-processing) and using that to define
  the library list that will be passed to Foam::dlOpen() at run-time.

  Pros:
    - One-time (very) minimal adjustment of the sources and wmake toolchain
    - Automatically applies to future applications

  Cons:
    - Possibly larger memory footprint of application (since all dependent
      libraries are loaded).
    - Possible impact on startup time (while loading libraries)
    - More sensitive to build failures. Since the options files are
      read and modified based on the existence of the dependent
      libraries as a preprocessor step, if the libraries are initially
      unavailable for the first attempt at building the application,
      the dependencies will be inaccurate for later (successful) builds.

  - This is solution taken by the bluecape patches (Bruno Santos)

Adopted Solution
================

  The approach taken by Bruno was adopted in a modified form since
  this appears to be the most easily maintained.

Additional Notes
================

  It is always possible to solve this problem by defining a corresponding
  'libs (...)' entry in the case system/controlDict, which forces a dlOpen
  of the listed libraries. This is obviously less than ideal for large-scale
  changes, but can work to resolve an individual problem.

  The peldd utility (https://github.com/gsauthof/pe-util), which is
  also packaged as part of MXE could provide yet another alternative.
  Like ldd it can be used to determine the library dependencies of
  binaries or libraries. This information could be used to define an
  additional load layer for Windows.
2019-05-25 19:10:14 +02:00
Mark Olesen
b8dc024444 BUG: incorrect IOobject instance for absolute windows path (#1238)
STYLE: remove unused local variables in edgeMeshFormat
2019-05-23 10:27:06 +01:00
Mark Olesen
b5d775a691 STYLE: avoid deprecated lookup methods 2019-05-22 15:06:12 +01:00
Mark Olesen
061eb53fb5 ENH: improvements, modernization of matrix containers (#1220)
- add iterators, begin/end, empty() methods for STL behaviour.
  Use standard algorithms where possible
     * std::fill, std::copy
     * std::min_element, std::max_element

- access methods consistent with other OpenFOAM containers:
     * data(), cdata(), uniform()

- Use ListPolicy to impose output line breaks

- Can recover matrix storage for re-use elsewhere.
  For example, to populate values with 2D i-j addressing and later
  release it as flat linear storage.

- construct/assign moveable

- added minMax() function for Matrix

- additional inplace +=, -=, *=, /= operations

- add named methods at() and rowData() to Matrix.
  Allows a better distinction between linear and row-based addressing

- low-level matrix solve on List/UList instead of Field
2019-05-22 12:18:31 +01:00
kuti
f8a70115fd ENH: add sign(), csign() methods for complex
- use std::hypot for complex mag() instead of long-hand version

- Detail::conj() function for complex or non-complex
2019-05-21 11:18:12 +01:00
Mark Olesen
32916fa845 ENH: dictionary checking methods with predicates on the input values
- can be used to check the validity of input values.

Example:

    dict.getCheck<label>("nIters", greaterOp1<label>(0));
    dict.getCheck<scalar>("relax", scalarMinMax::zero_one());

- use 'get' prefix for more regular dictionary methods.
  Eg, getOrDefault() as alternative to lookupOrDefault()

- additional ops for convenient construction of predicates

ENH: make dictionary writeOptionalEntries integer

- allow triggering of Fatal if default values are used

ENH: additional scalarRange static methods: ge0, gt0, zero_one

- use GREAT instead of VGREAT for internal placeholders

- additional MinMax static methods: gt, le
2019-05-21 19:10:14 +01:00
Mark Olesen
b043be3063 STYLE: add notices for deprecated dictionary methods 2019-05-17 09:02:51 +01:00