xref: /honee/qfunctions/stg_shur14_type.h (revision 475f0cac5d40259768f4556cf888e8f2448554cb)
1 // SPDX-FileCopyrightText: Copyright (c) 2017-2024, HONEE contributors.
2 // SPDX-License-Identifier: Apache-2.0 OR BSD-2-Clause
3 #pragma once
4 
5 #include <ceed/types.h>
6 
7 #include "newtonian_types.h"
8 
9 /* Access data arrays via:
10  *  CeedScalar (*sigma)[ctx->nmodes] = (CeedScalar (*)[ctx->nmodes])&ctx->data[ctx->offsets.sigma];
11  *  CeedScalar *eps = &ctx->data[ctx->offsets.eps]; */
12 typedef struct STGShur14Context_ *StgShur14Context;
13 struct STGShur14Context_ {
14   CeedInt                          nmodes;              // !< Number of wavemodes
15   CeedInt                          nprofs;              // !< Number of profile points in STGInflow.dat
16   CeedScalar                       alpha;               // !< Geometric growth rate of kappa
17   CeedScalar                       u0;                  // !< Convective velocity
18   CeedScalar                       time;                // !< Solution time
19   CeedScalar                       P0;                  // !< Inlet pressure
20   CeedScalar                       theta0;              // !< Inlet temperature
21   bool                             is_implicit;         // !< Whether using implicit time integration
22   bool                             mean_only;           // !< Only apply the mean profile
23   CeedScalar                       dx;                  // !< dx used for h calculation
24   CeedScalar                       h_scale_factor;      // !< Scales the element size
25   bool                             prescribe_T;         // !< Prescribe temperature weakly
26   bool                             use_fluctuating_IC;  // !< set fluctuations through the domain as an initial condition
27   struct NewtonianIdealGasContext_ newt_ctx;
28 
29   struct {
30     size_t sigma, d, phi;  // !< Random number set, [nmodes,3], [nmodes,3], [nmodes]
31     size_t kappa;          // !< Wavemode frequencies in increasing order, [nmodes]
32     size_t wall_dist;      // !< Distance to wall for Inflow Profie, [nprof]
33     size_t ubar;           // !< Mean velocity, [nprof, 3]
34     size_t cij;            // !< Cholesky decomposition [nprof, 6]
35     size_t eps;            // !< Turbulent Disspation [nprof, 6]
36     size_t lt;             // !< Tubulent Length Scale [nprof, 6]
37   } offsets;               // !< Holds offsets for each array in data
38   size_t     total_bytes;  // !< Total size of struct plus array
39   CeedScalar data[1];      // !< Holds concatenated scalar array data
40 };
41