nalu-wind icon indicating copy to clipboard operation
nalu-wind copied to clipboard

NGP conversion of field update algorithms

Open sayerhs opened this issue 5 years ago • 1 comments

This issue tracks the non-solver field updates that needs to be converted to run on device for wind-energy relevant simulations.

For a template of edge loop conversion, see conversion of AssembleNodalGradEdgeAlgorithm in

https://github.com/Exawind/nalu-wind/blob/d2d9b58929b9b201b04089dc5a296e8ccb3950ec/include/ngp_algorithms/NodalGradEdgeAlg.h#L20

Similarly the NodalGradElemAlg and NodalGradBndryElemAlg shows examples of element conversion. We will need all the boundary elem algorithms converted as they are common for both edge and elem solver options.

https://github.com/Exawind/nalu-wind/blob/d2d9b58929b9b201b04089dc5a296e8ccb3950ec/include/ngp_algorithms/NodalGradElemAlg.h#L23 https://github.com/Exawind/nalu-wind/blob/d2d9b58929b9b201b04089dc5a296e8ccb3950ec/include/ngp_algorithms/NodalGradBndryElemAlg.h#L23

Note, that the template arguments are not necessary for most Edge kernels. It was done for NodalGrad to collapse multiple classes into single class that deals with both vector and scalar fields whose projected nodal gradients are computed.

For node loops, an example is available in #335 and is pending merge. Unit tests for these examples are in the unit_tests/ngp_algorithms directory.

ABL Neutral simulation

Periodic BCs, with wall functions for terrain.

  • [x] AssembleNodalGradEdgeAlgorithm
  • [x] AssembleNodalGradElemAlgorithm
  • [x] AssembleNodalGradUEdgeAlgorithm
  • [x] AssembleNodalGradUElemAlgorithm
  • [x] AssembleNodalGradBoundaryAlgorithm
  • [x] AssembleNodalGradUBoundaryAlgorithm
  • [x] ComputeMdotEdgeAlgorithm
  • [x] EffectiveDiffFluxCoeffAlgorithm
  • [x] EnthalpyEffectiveDiffFluxCoeffAlgorithm
  • [x] TurbViscKsgsAlgorithm
  • [x] ComputeABLWallFrictionVelocityAlgorithm
  • [x] ComputeTurbKineticEnergyWallFunctionAlgorithm
  • [x] FixPressureAtNodeAlgorithm

Static mesh airfoil/wing simulations

  • [x] AssembleNodalGradPOpenBoundaryAlgorithm (#488)
  • [x] ComputeMdotEdgeOpenAlgorithm (#463)
  • [x] ComputeMdotInflowAlgorithm (#463)
  • [x] ComputeSSTMaxLengthScaleElemAlgorithm (jro)
  • [x] EffectiveSSTDiffFluxCoeffAlgorithm (#380)
  • [x] TurbViscSSTAlgorithm (#346)
  • [x] AssembleCourantReynoldsElemAlgorithm (#517)

Moving mesh turbine simulations

  • [x] ComputeGeometryBoundaryAlgorithm
  • [x] ComputeGeometryInteriorAlgorithm
  • [x] ComputeTurbKineticEnergyWallFunctionAlgorithm (#368)
  • [x] ComputeWallFrictionVelocityAlgorithm (#398)
  • [x] ComputeWallModelSDRWallAlgorithm (#415)
  • [x] CopyFieldAlgorithm
  • [ ] SurfaceForceAndMomentAlgorithm
  • [ ] SurfaceForceAndMomentWallFunctionAlgorithm
  • [ ] AuxFunctionAlgorithm
  • [ ] ComputeMetricTensorElemAlgorithm

Element algorithms

  • [ ] ComputeMdotElemAlgorithm
  • [ ] ComputeMdotElemOpenAlgorithm
  • [ ] ComputeMdotElemOpenPenaltyAlgorithm

Misc.

  • [ ] TurbViscSmagorinskyAlgorithm
  • [ ] AssembleWallDistNonConformalAlgorithm
  • [ ] AssembleNodalGradNonConformalAlgorithm
  • [ ] AssembleNodalGradUNonConformalAlgorithm
  • [ ] ComputeMdotNonConformalAlgorithm
  • [ ] ComputeHeatTransferEdgeWallAlgorithm
  • [ ] ComputeHeatTransferElemWallAlgorithm
  • [ ] ComputeLowReynoldsSDRWallAlgorithm
  • [ ] LimiterErrorIndicatorElemAlgorithm
  • [ ] PstabErrorIndicatorEdgeAlgorithm
  • [ ] PstabErrorIndicatorElemAlgorithm
  • [ ] SimpleErrorIndicatorElemAlgorithm
  • [ ] SimpleErrorIndicatorScalarElemAlgorithm

sayerhs avatar Sep 05 '19 17:09 sayerhs

@overfelt @alanw0 For the conversion of AssembleCourantReynoldsElemAlgorithm, here is what I had in mind:

  • Use MdotAlgDriver and its interior algorithm as template for conversion.

  • An example of an element reduction with MasterElement

https://github.com/Exawind/nalu-wind/blob/4c430563cd3b2c9443d871874b174132cd51fe4c/src/ngp_algorithms/MdotDensityAccumAlg.C#L84-L86

  • To process both Courant and Reynolds you can use the reduction array utilities

https://github.com/Exawind/nalu-wind/blob/4c430563cd3b2c9443d871874b174132cd51fe4c/include/ngp_utils/NgpReduceUtils.h#L115-L120

  • Example of using ArrayDbl2

https://github.com/Exawind/nalu-wind/blob/4c430563cd3b2c9443d871874b174132cd51fe4c/unit_tests/ngp_kernels/UnitTestNgpLoops.C#L236-L245

  • Since this is not a sum accumulation but a max we might need a custom reducer for Array types. I am not sure of this.

sayerhs avatar Jan 28 '20 16:01 sayerhs