xref: /honee/qfunctions/newtonian_types.h (revision da02a6e7947cab8e173fd83bf2b4eda896c06b14)
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.h>
6 
7 #include "stabilization_types.h"
8 
9 typedef enum {
10   STATEVAR_CONSERVATIVE = 0,
11   STATEVAR_PRIMITIVE    = 1,
12   STATEVAR_ENTROPY      = 2,
13 } StateVariable;
14 
15 typedef enum {
16   DIV_DIFF_FLUX_PROJ_NONE     = 0,
17   DIV_DIFF_FLUX_PROJ_DIRECT   = 1,
18   DIV_DIFF_FLUX_PROJ_INDIRECT = 2,
19 } DivDiffFluxProjectionMethod;
20 
21 typedef struct NewtonianIdealGasContext_ *NewtonianIdealGasContext;
22 struct NewtonianIdealGasContext_ {
23   CeedScalar        lambda;
24   CeedScalar        mu;
25   CeedScalar        k;
26   CeedScalar        cv;
27   CeedScalar        cp;
28   CeedScalar        g[3];
29   CeedScalar        c_tau;
30   CeedScalar        Ctau_t;
31   CeedScalar        Ctau_v;
32   CeedScalar        Ctau_C;
33   CeedScalar        Ctau_M;
34   CeedScalar        Ctau_E;
35   CeedScalar        dt;
36   CeedScalar        time;
37   CeedScalar        ijacobian_time_shift;
38   bool              is_implicit;
39   StateVariable     state_var;
40   StabilizationType stabilization;
41   bool              idl_enable;
42   CeedScalar        idl_pressure;
43   CeedScalar        idl_amplitude;
44   CeedScalar        idl_start;
45   CeedScalar        idl_length;
46 
47   DivDiffFluxProjectionMethod divFdiff_method;
48 };
49 
50 typedef struct {
51   CeedScalar pressure;
52   CeedScalar velocity[3];
53   CeedScalar temperature;
54 } StatePrimitive;
55 
56 typedef struct {
57   CeedScalar S_density;
58   CeedScalar S_momentum[3];
59   CeedScalar S_energy;
60 } StateEntropy;
61 
62 typedef struct SetupContext_ *SetupContext;
63 struct SetupContext_ {
64   StatePrimitive                   reference;
65   struct NewtonianIdealGasContext_ gas;
66   CeedScalar                       lx;
67   CeedScalar                       ly;
68   CeedScalar                       lz;
69   CeedScalar                       time;
70 };
71