ABLFieldInit Class Reference

AMR-Wind API: amr_wind::ABLFieldInit Class Reference
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
amr_wind::ABLFieldInit Class Reference

#include <ABLFieldInit.H>

Collaboration diagram for amr_wind::ABLFieldInit:
[legend]

Public Member Functions

 ABLFieldInit ()
 
void initialize_from_inputfile ()
 
void initialize_from_netcdf ()
 
void operator() (const amrex::Box &vbx, const amrex::Geometry &geom, const amrex::Array4< amrex::Real > &velocity, const amrex::Array4< amrex::Real > &density, const amrex::Array4< amrex::Real > &temperature) const
 
void perturb_temperature (const int lev, const amrex::Geometry &geom, Field &temperature) const
 
bool add_temperature_perturbations () const
 Flag indicating whether temperature field needs perturbations.
 
void init_tke (const amrex::Geometry &geom, amrex::MultiFab &tke) const
 Initialize TKE field.
 

Private Attributes

amrex::Vector< amrex::Real > m_vel
 Initial velocity components.
 
std::string m_vel_timetable
 File name for velocity forcing time table.
 
amrex::Real m_vel_speed
 Initial wind speed.
 
amrex::Real m_vel_dir
 Initial wind direction (rad)
 
amrex::Gpu::DeviceVector< amrex::Real > m_thht_d
 
amrex::Gpu::DeviceVector< amrex::Real > m_thvv_d
 
amrex::Gpu::DeviceVector< amrex::Real > m_windht_d
 
amrex::Gpu::DeviceVector< amrex::Real > m_prof_u_d
 
amrex::Gpu::DeviceVector< amrex::Real > m_prof_v_d
 
amrex::Gpu::DeviceVector< amrex::Real > m_prof_tke_d
 
amrex::Real m_rho
 Initial density field.
 
amrex::Real m_deltaU {1.0}
 Amplitude of fluctuations in x-direction.
 
amrex::Real m_deltaV {1.0}
 Amplitude of fluctuations in y-direction.
 
amrex::Real m_Uperiods {4.0}
 Number of sinusoidal waves in x-direction.
 
amrex::Real m_Vperiods {4.0}
 Number of sinusoidal waves in y-direction.
 
amrex::Real m_ref_height {50.0}
 Reference height for velocity perturbations.
 
amrex::Real m_delta_t {0.8}
 Amplitude of temperature perturbations.
 
amrex::Real m_theta_gauss_mean {0.0}
 Mean for Gaussian number generator.
 
amrex::Real m_theta_gauss_var {1.0}
 Variance for Gaussian number generator.
 
amrex::Real m_theta_cutoff_height {1.0e16}
 Cutoff height for temperature fluctuations.
 
amrex::Real m_tke_init {0.1}
 Initial value for tke field.
 
amrex::Real m_tke_init_factor {0.4}
 Multiplicative factor for init tke profile.
 
amrex::Real m_tke_cutoff_height {250.}
 Cutoff height for init tke profile.
 
amrex::RealArray m_top_vel {20.0}
 Top velocity.
 
amrex::RealArray m_bottom_vel {4.0}
 Bottom velocity.
 
bool m_linear_profile {false}
 Initial linear velocity profile boolean.
 
bool m_perturb_vel {true}
 Perturb initial velocity field with sinusoidal fluctuations.
 
bool m_perturb_theta {false}
 Perturb temperature field with random fluctuations.
 
bool m_tke_init_profile {false}
 Initialize tke profile non-constant.
 
bool m_init_uvtheta_profile {false}
 Profiles of u, v, and theta are read in from a NetCDF File.
 
amrex::Vector< amrex::Real > m_theta_heights
 
amrex::Vector< amrex::Real > m_theta_values
 
bool m_initial_wind_profile {false}
 
std::string m_1d_rans
 File name for 1-D data file.
 
amrex::Vector< amrex::Real > m_wind_heights
 
amrex::Vector< amrex::Real > m_u_values
 
amrex::Vector< amrex::Real > m_v_values
 
amrex::Vector< amrex::Real > m_tke_values
 

Detailed Description

Initialize ABL fields

Constructor & Destructor Documentation

◆ ABLFieldInit()

amr_wind::ABLFieldInit::ABLFieldInit ( )

Member Function Documentation

◆ add_temperature_perturbations()

bool amr_wind::ABLFieldInit::add_temperature_perturbations ( ) const
inline

Flag indicating whether temperature field needs perturbations.

◆ init_tke()

void amr_wind::ABLFieldInit::init_tke ( const amrex::Geometry & geom,
amrex::MultiFab & tke ) const

Initialize TKE field.

Initialize sfs tke field at the beginning of the simulation.

◆ initialize_from_inputfile()

void amr_wind::ABLFieldInit::initialize_from_inputfile ( )

◆ initialize_from_netcdf()

void amr_wind::ABLFieldInit::initialize_from_netcdf ( )

◆ operator()()

void amr_wind::ABLFieldInit::operator() ( const amrex::Box & vbx,
const amrex::Geometry & geom,
const amrex::Array4< amrex::Real > & velocity,
const amrex::Array4< amrex::Real > & density,
const amrex::Array4< amrex::Real > & temperature ) const

◆ perturb_temperature()

void amr_wind::ABLFieldInit::perturb_temperature ( const int lev,
const amrex::Geometry & geom,
Field & temperature ) const

Add temperature perturbations

This uses amrex::Random and, therefore, executes the loop on CPU and pushes the field to device.

Member Data Documentation

◆ m_1d_rans

std::string amr_wind::ABLFieldInit::m_1d_rans
private

File name for 1-D data file.

◆ m_bottom_vel

amrex::RealArray amr_wind::ABLFieldInit::m_bottom_vel {4.0}
private

Bottom velocity.

◆ m_delta_t

amrex::Real amr_wind::ABLFieldInit::m_delta_t {0.8}
private

Amplitude of temperature perturbations.

◆ m_deltaU

amrex::Real amr_wind::ABLFieldInit::m_deltaU {1.0}
private

Amplitude of fluctuations in x-direction.

◆ m_deltaV

amrex::Real amr_wind::ABLFieldInit::m_deltaV {1.0}
private

Amplitude of fluctuations in y-direction.

◆ m_init_uvtheta_profile

bool amr_wind::ABLFieldInit::m_init_uvtheta_profile {false}
private

Profiles of u, v, and theta are read in from a NetCDF File.

◆ m_initial_wind_profile

bool amr_wind::ABLFieldInit::m_initial_wind_profile {false}
private

Adding option for wind heights similar to temperature heights Speed-up RANS calculation using 1-D profile for flat surface

◆ m_linear_profile

bool amr_wind::ABLFieldInit::m_linear_profile {false}
private

Initial linear velocity profile boolean.

◆ m_perturb_theta

bool amr_wind::ABLFieldInit::m_perturb_theta {false}
private

Perturb temperature field with random fluctuations.

◆ m_perturb_vel

bool amr_wind::ABLFieldInit::m_perturb_vel {true}
private

Perturb initial velocity field with sinusoidal fluctuations.

◆ m_prof_tke_d

amrex::Gpu::DeviceVector<amrex::Real> amr_wind::ABLFieldInit::m_prof_tke_d
private

◆ m_prof_u_d

amrex::Gpu::DeviceVector<amrex::Real> amr_wind::ABLFieldInit::m_prof_u_d
private

◆ m_prof_v_d

amrex::Gpu::DeviceVector<amrex::Real> amr_wind::ABLFieldInit::m_prof_v_d
private

◆ m_ref_height

amrex::Real amr_wind::ABLFieldInit::m_ref_height {50.0}
private

Reference height for velocity perturbations.

◆ m_rho

amrex::Real amr_wind::ABLFieldInit::m_rho
private

Initial density field.

◆ m_theta_cutoff_height

amrex::Real amr_wind::ABLFieldInit::m_theta_cutoff_height {1.0e16}
private

Cutoff height for temperature fluctuations.

◆ m_theta_gauss_mean

amrex::Real amr_wind::ABLFieldInit::m_theta_gauss_mean {0.0}
private

Mean for Gaussian number generator.

◆ m_theta_gauss_var

amrex::Real amr_wind::ABLFieldInit::m_theta_gauss_var {1.0}
private

Variance for Gaussian number generator.

◆ m_theta_heights

amrex::Vector<amrex::Real> amr_wind::ABLFieldInit::m_theta_heights
private

Lookup table containing temperature variation w.r.t. height above terrain

◆ m_theta_values

amrex::Vector<amrex::Real> amr_wind::ABLFieldInit::m_theta_values
private

◆ m_thht_d

amrex::Gpu::DeviceVector<amrex::Real> amr_wind::ABLFieldInit::m_thht_d
private

◆ m_thvv_d

amrex::Gpu::DeviceVector<amrex::Real> amr_wind::ABLFieldInit::m_thvv_d
private

◆ m_tke_cutoff_height

amrex::Real amr_wind::ABLFieldInit::m_tke_cutoff_height {250.}
private

Cutoff height for init tke profile.

◆ m_tke_init

amrex::Real amr_wind::ABLFieldInit::m_tke_init {0.1}
private

Initial value for tke field.

◆ m_tke_init_factor

amrex::Real amr_wind::ABLFieldInit::m_tke_init_factor {0.4}
private

Multiplicative factor for init tke profile.

◆ m_tke_init_profile

bool amr_wind::ABLFieldInit::m_tke_init_profile {false}
private

Initialize tke profile non-constant.

◆ m_tke_values

amrex::Vector<amrex::Real> amr_wind::ABLFieldInit::m_tke_values
private

◆ m_top_vel

amrex::RealArray amr_wind::ABLFieldInit::m_top_vel {20.0}
private

Top velocity.

◆ m_u_values

amrex::Vector<amrex::Real> amr_wind::ABLFieldInit::m_u_values
private

◆ m_Uperiods

amrex::Real amr_wind::ABLFieldInit::m_Uperiods {4.0}
private

Number of sinusoidal waves in x-direction.

◆ m_v_values

amrex::Vector<amrex::Real> amr_wind::ABLFieldInit::m_v_values
private

◆ m_vel

amrex::Vector<amrex::Real> amr_wind::ABLFieldInit::m_vel
private

Initial velocity components.

◆ m_vel_dir

amrex::Real amr_wind::ABLFieldInit::m_vel_dir
private

Initial wind direction (rad)

◆ m_vel_speed

amrex::Real amr_wind::ABLFieldInit::m_vel_speed
private

Initial wind speed.

◆ m_vel_timetable

std::string amr_wind::ABLFieldInit::m_vel_timetable
private

File name for velocity forcing time table.

◆ m_Vperiods

amrex::Real amr_wind::ABLFieldInit::m_Vperiods {4.0}
private

Number of sinusoidal waves in y-direction.

◆ m_wind_heights

amrex::Vector<amrex::Real> amr_wind::ABLFieldInit::m_wind_heights
private

◆ m_windht_d

amrex::Gpu::DeviceVector<amrex::Real> amr_wind::ABLFieldInit::m_windht_d
private

The documentation for this class was generated from the following files: