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