NREL / SOWFA-6

32 stars 35 forks source link

F/inflow perturbation #42

Closed mchurchf closed 2 years ago

mchurchf commented 2 years ago

This pull requests add the basic cell-perturbation capability. The class is a template class, so it could support perturbations of any field, but I currently have it set up for velocity and/or temperature perturbations. The user defines perturbation zones, which may be associated with a boundary and adjacent to that boundary or arbitrarily located in the domain. The code supports terrain-following perturbation zones. Perturbation cells are defined, and the code finds all mesh cells contained within each perturbation cell. Each perturbation cell gets a random number from OpenFOAM's random number generator of some magnitude specified by the user. The random numbers get updated at a specified frequency. These perturbations can then be applied to the field directly by adding their value to the field at the end of a time step, or indirectly through source terms that create the desired perturbation. The source term is applied during a single time step at the beginning of each cell perturbation update to create the desired perturbation on the field.

This pull request will be followed up later with enhancements to this capability to automate perturbation magnitude and update frequency based on the flow itself following the implementation in WRF.