amr-wind/equation_systems/icns/source_terms/CoriolisForcing.cpp
/** Coriolis term for planetary rotation
 *
 *  Parameters are read from the `abl` namespace in the input file. The
 *  following parameters are available:
 *
 *  - `latitude`:  The latitude (in degrees) where the Coriolis term is
 * computed. This argument is mandatory.
 *
 *  - `east_vector`, `north_vector`
 *
 *    (Optional) Vectors specifying the east and north directions with respect
 *    to computational domain
 *
 * - `rotational_time_period` Time period for planetary rotation (default: 86400
 *    seconds)
 */
Coriolis term for planetary rotation
Parameters are read from the `abl` namespace in the input file. The
following parameters are available.

- `latitude`:  The latitude (in degrees) where the Coriolis term is
computed. This argument is mandatory.



(Optional) Vectors specifying the east and north directions with respect
to computational domain

- `rotational_time_period` Time period for planetary rotation (default: 86400
seconds)
Coriolis term for planetary rotation Parameters are read from the ` abl ` namespace in the input file . The following parameters are available . - ` latitude ` : The latitude ( in degrees ) where the Coriolis term is computed . This argument is mandatory . ( Optional ) Vectors specifying the east and north directions with respect to computational domain - ` rotational_time_period ` Time period for planetary rotation ( default : 86400 seconds )
CoriolisForcing::CoriolisForcing(const CFDSim& sim)
    : m_velocity(sim.repo().get_field("velocity"))
{
    static_assert(AMREX_SPACEDIM == 3, "ABL implementation requires 3D domain");
    amrex::ParmParse pp("CoriolisForcing");
    pp.get("latitude", m_latitude);
    m_latitude = utils::radians(m_latitude);
    m_sinphi = std::sin(m_latitude);
    m_cosphi = std::cos(m_latitude);
    amrex::Real rot_time_period = 86400.0;
    pp.query("rotational_time_period", rot_time_period);
    m_coriolis_factor = 2.0 * utils::two_pi() / rot_time_period;
    pp.queryarr("east_vector", m_east, 0, AMREX_SPACEDIM);
    pp.queryarr("north_vector", m_north, 0, AMREX_SPACEDIM);
    utils::vec_normalize(m_east.data());
    utils::vec_normalize(m_north.data());
    utils::cross_prod(m_east.data(), m_north.data(), m_up.data());
}
CoriolisForcing :: CoriolisForcing ( const CFDSim & sim ) : m_velocity ( sim . repo ( ) . get_field ( " " ) ) { static_assert ( AMREX_SPACEDIM == 3 , " " ) ; amrex :: ParmParse pp ( " " ) ; pp . get ( " " , m_latitude ) ; m_latitude = utils :: radians ( m_latitude ) ; m_sinphi = std :: sin ( m_latitude ) ; m_cosphi = std :: cos ( m_latitude ) ; amrex :: Real rot_time_period = 86400.0 ; pp . query ( " " , rot_time_period ) ; m_coriolis_factor = 2.0 * utils :: two_pi ( ) / rot_time_period ; pp . queryarr ( " " , m_east , 0 , AMREX_SPACEDIM ) ; pp . queryarr ( " " , m_north , 0 , AMREX_SPACEDIM ) ; utils :: vec_normalize ( m_east . data ( ) ) ; utils :: vec_normalize ( m_north . data ( ) ) ; utils :: cross_prod ( m_east . data ( ) , m_north . data ( ) , m_up . data ( ) ) ; }
Coriolis term for planetary rotation
  Parameters are read from the `abl` namespace in the input file.
Coriolis term for planetary rotation Parameters are read from the ` abl ` namespace in the input file .
// Latitude is mandatory, everything else is optional // Latitude is read in degrees // Read the rotational time period (in seconds)