ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_AdvanceFitch.cpp File Reference
#include <ERF_Fitch.H>
#include <ERF_IndexDefines.H>
#include <ERF_LengthScaleCellSize.H>
#include <cmath>
#include <ERF_NumericalConstants.H>
#include <ERF_Interpolation_1D.H>
Include dependency graph for ERF_AdvanceFitch.cpp:

Functions

AMREX_FORCE_INLINE AMREX_GPU_DEVICE Real compute_A (const Real z, const Real hub_height, const Real rotor_rad)
 
AMREX_FORCE_INLINE AMREX_GPU_DEVICE Real compute_Aijk (const Real z_k, const Real z_kp1, const Real hub_height, const Real rotor_rad)
 

Function Documentation

◆ compute_A()

AMREX_FORCE_INLINE AMREX_GPU_DEVICE Real compute_A ( const Real  z,
const Real  hub_height,
const Real  rotor_rad 
)
15 {
16 
17  Real d = std::min(std::fabs(z - hub_height), rotor_rad);
18  Real theta = std::acos(d/rotor_rad);
19  Real A_s = rotor_rad*rotor_rad*theta - d*std::pow(std::max(rotor_rad*rotor_rad - d*d,Real(0.)), Real(0.5));
20  Real A = PI*rotor_rad*rotor_rad/two - A_s;
21 
22  return A;
23 }
constexpr amrex::Real two
Definition: ERF_NumericalConstants.H:38
constexpr amrex::Real PI
Definition: ERF_NumericalConstants.H:46
@ theta
Definition: ERF_Kessler.H:26
constexpr int A
Definition: ERF_TwoStreamColumn.H:653

Referenced by compute_Aijk().

Here is the caller graph for this function:

◆ compute_Aijk()

AMREX_FORCE_INLINE AMREX_GPU_DEVICE Real compute_Aijk ( const Real  z_k,
const Real  z_kp1,
const Real  hub_height,
const Real  rotor_rad 
)
31 {
32 
33  Real A_k = compute_A(z_k, hub_height, rotor_rad);
34  Real A_kp1 = compute_A(z_kp1, hub_height, rotor_rad);
35 
36  Real check = (z_k - hub_height)*(z_kp1 - hub_height);
37  Real A_ijk;
38  if(check > 0){
39  A_ijk = std::fabs(A_k - A_kp1);
40  }
41  else{
42  A_ijk = A_k + A_kp1;
43  }
44 
45  return A_ijk;
46 }
AMREX_FORCE_INLINE AMREX_GPU_DEVICE Real compute_A(const Real z, const Real hub_height, const Real rotor_rad)
Definition: ERF_AdvanceFitch.cpp:12

Referenced by Fitch::source_terms_cellcentered().

Here is the call graph for this function:
Here is the caller graph for this function: