/home/runner/work/amr-wind/amr-wind/amr-wind/physics/udfs/BurggrafLid.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/physics/udfs/BurggrafLid.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
BurggrafLid.H
Go to the documentation of this file.
1#ifndef BURGGRAF_LID_H
2#define BURGGRAF_LID_H
3
4#include "AMReX_Geometry.H"
5#include "AMReX_Gpu.H"
6
7namespace amr_wind {
8
9class Field;
10
11namespace udf {
12
14{
15 struct DeviceOp
16 {
17 int idir{0};
18
19 AMREX_GPU_DEVICE
20 inline void operator()(
21 const amrex::IntVect& iv,
22 amrex::Array4<amrex::Real> const& field,
23 amrex::GeometryData const& geom,
24 const amrex::Real /*unused*/,
25 amrex::Orientation /*unused*/,
26 const int comp,
27 const int dcomp,
28 const int orig_comp) const
29 {
30 const auto* problo = geom.ProbLo();
31 const auto* dx = geom.CellSize();
32 const auto x = problo[idir] + (iv[idir] + 0.5) * dx[idir];
33 amrex::Real val =
34 16 * (std::pow(x, 4) - 2 * std::pow(x, 3) + std::pow(x, 2));
35 amrex::RealArray uvec = {val};
36
37 field(iv[0], iv[1], iv[2], dcomp + comp) = uvec[orig_comp + comp];
38 }
39 };
41
42 static std::string identifier() { return "BurggrafLid"; }
43
44 explicit BurggrafLid(const Field& fld);
45
46 DeviceType device_instance() const { return m_op; }
47
49};
50
51} // namespace udf
52} // namespace amr_wind
53
54#endif /* BURGGRAF_LID_H */
Definition Field.H:116
Definition BCInterface.cpp:7
Definition BurggrafLid.H:16
AMREX_GPU_DEVICE void operator()(const amrex::IntVect &iv, amrex::Array4< amrex::Real > const &field, amrex::GeometryData const &geom, const amrex::Real, amrex::Orientation, const int comp, const int dcomp, const int orig_comp) const
Definition BurggrafLid.H:20
int idir
Definition BurggrafLid.H:17
Definition BurggrafLid.H:14
DeviceType device_instance() const
Definition BurggrafLid.H:46
BurggrafLid(const Field &fld)
Definition BurggrafLid.cpp:11
DeviceOp m_op
Definition BurggrafLid.H:48
static std::string identifier()
Definition BurggrafLid.H:42