xref: /honee/qfunctions/newtonian_types.h (revision ea2beb2d00ff99137ccb08857f9b9e2abb5f363f)
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 
17 typedef struct NewtonianIdealGasContext_ *NewtonianIdealGasContext;
18 struct NewtonianIdealGasContext_ {
19   CeedScalar        lambda;
20   CeedScalar        mu;
21   CeedScalar        k;
22   CeedScalar        cv;
23   CeedScalar        cp;
24   CeedScalar        g[3];
25   CeedScalar        c_tau;
26   CeedScalar        Ctau_t;
27   CeedScalar        Ctau_v;
28   CeedScalar        Ctau_C;
29   CeedScalar        Ctau_M;
30   CeedScalar        Ctau_E;
31   CeedScalar        dt;
32   CeedScalar        time;
33   CeedScalar        ijacobian_time_shift;
34   bool              is_implicit;
35   StateVariable     state_var;
36   StabilizationType stabilization;
37   bool              idl_enable;
38   CeedScalar        idl_pressure;
39   CeedScalar        idl_amplitude;
40   CeedScalar        idl_start;
41   CeedScalar        idl_length;
42 
43   DivDiffFluxProjectionMethod divFdiff_method;
44 };
45 
46 typedef struct {
47   CeedScalar pressure;
48   CeedScalar velocity[3];
49   CeedScalar temperature;
50 } StatePrimitive;
51 
52 typedef struct {
53   CeedScalar S_density;
54   CeedScalar S_momentum[3];
55   CeedScalar S_energy;
56 } StateEntropy;
57 
58 typedef struct SetupContext_ *SetupContext;
59 struct SetupContext_ {
60   StatePrimitive                   reference;
61   struct NewtonianIdealGasContext_ gas;
62   CeedScalar                       lx;
63   CeedScalar                       ly;
64   CeedScalar                       lz;
65   CeedScalar                       time;
66 };
67