OpenFOAM® v1912: New and improved numerics

23/12/2019

New adjoint shape optimisation

The adjoint library is enhanced with new functionality enabling automated shape optimisation loops.

This is a continuation of the adjoint optimisation tools that were released in OpenFOAM-v1906 under OpenFOAM’s Governance framework.

A parameterisation scheme based on volumetric B-Splines is introduced, the control points of which act as the design variables in the optimisation loop (see references below). The control points of the volumetric B-Splines boxes can be defined in either Cartesian or cylindrical coordinates.

The entire loop (solution of the flow and adjoint equations, computation of sensitivity derivatives, update of the design variables and mesh) is run within the adjointOptimisationFoam solver. A number of methods to update the design variables are implemented, including popular Quasi-Newton methods like BFGS and methods capable of handling constraints like SQP or constraint projection.

Source code
$FOAM_SOLVERS/incompressible/adjointOptimisationFoam
$FOAM_SRC/optimisation/adjointOptimisation/adjoint
Examples
$FOAM_TUTORIALS/incompressible/adjointOptimisationFoam
Attribution
The software was developed by PCOpt/NTUA and FOSS GP with contributions from
  • Dr Evangelos Papoutsis-Kiachagias,
  • Konstantinos Gkaragounis,
  • Professor Kyriakos Giannakoglou,
  • Dr Andrew Heather
References
  • E.M. Papoutsis-Kiachagias, N. Magoulas, J. Mueller, C. Othmer, K.C. Giannakoglou: ’Noise Reduction in Car Aerodynamics using a Surrogate Objective Function and the Continuous Adjoint Method with Wall Functions’, Computers & Fluids, 122:223-232, 2015
  • E. M. Papoutsis-Kiachagias, V. G. Asouti, K. C. Giannakoglou, K. Gkagkas, S. Shimokawa, E. Itakura: Multi-point aerodynamic shape optimization of cars based on continuous adjoint, Structural and Multidisciplinary Optimization, 59(2):675694, 2019
Integration
The code has been integrated jointly by OpenCFD and NTUA

New weighted flux interpolation scheme

The new weightedFlux interpolation scheme is a linear scheme that employs a weighted flux.

For any general flux of the following form:

pict\relax \special {t4ht=

the gradient is calculated using Gauss theorem which requires face values of ϕ  \relax \special {t4ht=. This is calculated as:

pict\relax \special {t4ht=

where:

  • ϕi  \relax \special {t4ht= is the cell value
  • ϕf  \relax \special {t4ht= is the face value
  • f = δ1σδ22σ+1δ2σ1   \relax \special {t4ht=
  • σi  \relax \special {t4ht= is the diffusivity coefficient

For the case where σ  \relax \special {t4ht= is discontinuous the linear interpolation produces an incorrect flux. The weightedFlux interpolation scheme is used as follows in conjunction with the harmonic interpolation for T.

laplacianSchemes
{
    laplacian(DT,T) Gauss harmonic corrected;
}

gradSchemes
{
    grad(T)     Gauss weightedFlux sigma;
}

The example above produces smooth temperature and heat flux profiles as seen below:

[Picture]

[Picture]

Source code
$FOAM_SRC/finiteVolume/interpolation/surfaceInterpolation/schemes/weightedFlux
Tutorial
$FOAM_TUTORIALS/verificationAndValidation/schemes/weigthedFluxExample
Attribution
This scheme was contributed by Norbert Weber
References
  • Weber, N.; Beckstein, P.; Galindo, V.; Starace, M.; Weier, T.: Electro-vortex flow simulation using coupled meshes, Computers and Fluids 168(2018) 101-109
  • For more details see the Issue tracker

Improved geometry handling in mixed precision mode

The mixed precision mode (SPDP) introduced in OpenFOAM-v1906 enables significant speed up and reduced memory requirement compared to running in double precision where applicable.

In mixed precision mode only the linear solver operates in double precision. All other functionality is still performed using single precision. This might report perfectly valid closed cells to be seen as open, e.g. using checkMesh. A single precision (SP) run may report:

***Boundary openness (3.77976e-07 3.97566e-06 -2.26237e-08) possible hole in boundary description.

In this version the double precision calculation has been extended to

  • face centres and areas and cell centres and volumes calculations. Note that the actual result is still stored in single precision.
  • most checkMesh summations, e.g. above open cells
  • all field based summations (sum).

Note that these changes only affect the SPDP mode. The previous example now reports:

Boundary openness (-6.31099e-11 -3.99859e-11 -3.747e-10) OK.

Source code
$FOAM_SRC/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellCentresAndVols.C
$FOAM_SRC/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshFaceCentresAndAreas.C