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 static const char *const StateVariables[] = {"CONSERVATIVE", "PRIMITIVE", "ENTROPY", "StateVariable", "STATEVAR_", NULL}; 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 c_tau; 29 CeedScalar Ctau_t; 30 CeedScalar Ctau_v; 31 CeedScalar Ctau_C; 32 CeedScalar Ctau_M; 33 CeedScalar Ctau_E; 34 CeedScalar dt; 35 CeedScalar time; 36 CeedScalar ijacobian_time_shift; 37 bool is_implicit; 38 StateVariable state_var; 39 StabilizationType stabilization; 40 bool idl_enable; 41 CeedScalar idl_pressure; 42 CeedScalar idl_amplitude; 43 CeedScalar idl_start; 44 CeedScalar idl_length; 45 46 DivDiffFluxProjectionMethod divFdiff_method; 47 }; 48 49 typedef struct { 50 CeedScalar pressure; 51 CeedScalar velocity[3]; 52 CeedScalar temperature; 53 } StatePrimitive; 54 55 typedef struct { 56 CeedScalar S_density; 57 CeedScalar S_momentum[3]; 58 CeedScalar S_energy; 59 } StateEntropy; 60 61 typedef struct SetupContext_ *SetupContext; 62 struct SetupContext_ { 63 StatePrimitive reference; 64 struct NewtonianIdealGasContext_ gas; 65 CeedScalar lx; 66 CeedScalar ly; 67 CeedScalar lz; 68 CeedScalar time; 69 }; 70