Skip to content

Choice of parameters for a new case

mpentek edited this page Mar 30, 2020 · 17 revisions

Reminder

For compiling refer to notes on Compiling.

Explanation of input parameters

The demo setup file hdf5_demo_3d.wfs contains the following parameters:

  • the box size (positive real numbers without fractions or decimals)
    • lx: length of the box
    • ly: width of the box
    • lz: height of the box
  • and respective refinement settings (positive integer numbers; a rectangular structured grid will be generated)
    • rx: grid refinement for lx, such that grid size dx = lx/(2^rx)
    • ry: grid refinement for ly, such that grid size dx = ly/(2^ry)
    • rz: grid refinement for lz, such that grid size dx = lz/(2^rz)
  • spectra: a string input being one of
    • "kaimal"
    • "simiu"
    • "isotropic"
  • parameters defining the wind flow (usage during the generation best seen in wfs.c) of which some
    • are used for generation of the fluctuating velocity components
      • height: positive real number to specify the reference height and influence the turbulence length (is proportional/will correlate with turbulence length, so for higher turbulence length specify higher reference height)
      • roughness: positive real number to specify a roughness and influence the turbulence intensity (so the variance of the fluctuating components, could be chosen but not need to be the same as log roughness)
      • conv: positive integer number (has to be either 0 or 1) which serves as a switch to turn convolution on (based upon the convolution of spectral tensor component) or off (using a sheared spectrum approach based upon sheared tensor) during generation
      • umean: a positive real number representing the mean reference velocity (at the reference height) used for initializing parameters for the fluctuating component as well as generating the mean wind profile
    • is additionally needed and stored (but not explicitly used in the generation) for creating a mean logarithmic profile to map the fluctuating components onto
      • log roughness: a positive real number representing the ground roughness (could be chosen but not need be the same as roughness)

The wind generation process will result the fluctuating velocity components vi'(t) (for i= x, y, z) in time for each point on the inlet.

  • vx(t) = vx + vx'(t)
  • vy(t) = vy + vy'(t)
  • vz(t) = vz + vz'(t)

The mean velocity components vi (for i= x, y, z) are defined by assuming a mean profile, see discussion below. The coordinate x for the generator has a pseudo-space meaning and should be related to the advancing over time t in direction x in the CFD domain.

To achieve the desired turbulence intensity and length, the wind generation has to be done iteratively such that a proper choice of height and roughness can be established. This will result in multiple HDF5 generated files. Bear in mind, that this generated wind from the generator will probably modify as the flow develops in the (empty) channel, most probably due to the mesh, time step and scheme used for the CFD simulation. So further iterations of generation and (empty) channel runs might be needed to establish the optimal parameters such that target wind conditions can be achieved where needed in the CFD domain. The umean, log roughness and height values will be used for the generation of the mean wind profile, here assuming a log-law. A sample python process for the usage with the CFD module of Kratos Multiphysics is available to show how this is created and mapped.

In the kratos_inlet_process.py the inside the ImposeWindInletProcess class the CreateLogMeanProfile function is responsible to initialize the mean velocity over the height as a log-law distribution. For users who want a pow-law distribution, this script need to be adapted by defining a CreatePowMeanProfile inside the class and a class PowMeanProfile similar to the class LogMeanProfile. The bulk_wind_speed is responsible for sweeping through the generated wind along axis x and mapping data for each time step of the CFD simulation accordingly.

Recommended choice of input parameters

The recommended choice of input parameters is presented using a generated and simulated case (SI units where applicable).

Assuming the:

  • Reference coordinate system:
    • x: length (streamwise)
    • y: width (spanwise)
    • z: height
  • CFD domain size and respective settings (noted with capital letters)
    • lengths Lx =1800.0, Ly = 860.0, Lz = 580.0
    • (smallest) mesh sizing on the inlet Dy, Dz ≈ 4.0
    • total time T = 600.0
    • time step DT = 0.02
    • (resulting) total number of time steps NT = T/DT = 30000
    • the mean reference velocity V = 40.0

The recommended input parameters for the wind generator could be:

  • the box sizes width and height compared to the inlet size of the CFD domain
    • ly ≥ Ly taking ly = 900.0
    • lz ≥ Lz taking lz = 600.0
    • lx ≥ V * T taking lx = 24000.0 (note that lx is not the same or is not related to Lx as it has a different meaning)
  • the grid sizing related to width and height such that
    • ry such that dy = ly/(2^ry) ≈ Dy taking ry = 8 resulting dy = 3.5
    • rz such that dz = lz/(2^rz) ≈ Dz taking rz = 7 resulting dy = 4.7
    • rx such that
      • 2^rx ≤ NT so rx ≤ 14.9 because more pseudo-time steps in the generated wind will be filtered out by the time steps in the CFD
      • dx ≈ (dy, dz) ≈ 4.0 resulting rx ≈ (12-13) leading to dx ≈ (5.9-2.9) so that the elements in the rectangular grid of the generated wind have a very good (comparable) aspect ratio
      • dx < (4dy, 4dz) ≈ 16.0 resulting rx ≈ (11-12) leading to dx ≈ (11.7-5.9) so that the elements in the rectangular grid of the generated wind have an ok aspect ratio; the factor n=4 as a pre-multiplier is up to the user depending on how strict this criteria is aimed to be
      • dx ≤(1/1 or 1/2) * V/f, where V = 40.0 is the mean reference velocity (defined above) and f = 2.0 is a characteristic cutoff frequency (above which probably frequency content is not so relevant), where V/f = 20.0 will have the meaning of a minimum relevant characteristic length scale to be captured, here resulting dx = (10.0-20.0) leading to rx ≈ (11-10) ; the multiplying factor 1/n (here using either 1/1 or 1/2) is a choice up to the user depending on how strict this criteria is aimed to be
      • for this case taking rx = (11-12) leading to dx = (11.7-5.9)

Further notes on input parameters and the generated file

For this case a sample input *.wfs file is would be the following following:

{ 
Box { lx = 24000 ly = 900 lz = 600 rx = 11 ry = 8 rz = 7 }
umean = 29.5 height = 50.0 roughness = 0.75 conv = 1
log roughness = 0.75
spectra = kaimal 
}

The generated *.H5 file will store (2^11 * 2^8 * 2^7)*3 + 6 ≈ 2^26 * 3 doubles (and a string), resulting in a file size of 1.6 GB, the keys in the generated file being:

['log_z0', 'lx', 'ly', 'lz', 'spectra', 'u', 'umean', 'v', 'w', 'z', 'z0']

The keys and values will be used in an inlet process (such as the one for Kratos presented above) with the attributes ['lx', 'ly', 'lz', 'log_z0', 'z', 'umean'] being set in the constructor of the class ImposeWindInletProcess and the fluctuating values ['u', 'v', 'w'] being initialized in the function Create3DMappers thereafter being interpolated and superposed onto the mean profile in the function AssignVelocity.

A version with more resolution along x and better size ratio:

{ 
Box { lx = 24000 ly = 900 lz = 900 rx = 12 ry = 8 rz = 8 }
umean = 29.5 height = 50.0 roughness = 0.75 conv = 1
log roughness = 0.75
spectra = kaimal 
}

The generated *.H5 file will store (2^12 * 2^8 * 2^8) * 3 + 6 ≈ 2^28 * 3 doubles, so 4 times more than the one generated with previous settings. Also expect a file approximately 4 times larger.