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 { 21 CeedScalar lambda; 22 CeedScalar mu; 23 CeedScalar k; 24 CeedScalar cv; 25 CeedScalar cp; 26 } NewtonianIGProperties; 27 28 typedef struct NewtonianIdealGasContext_ *NewtonianIdealGasContext; 29 struct NewtonianIdealGasContext_ { 30 NewtonianIGProperties gas; 31 CeedScalar g[3]; 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 // Stabilization 44 TauDiagCoefficients tau_coeffs; 45 CeedScalar dt; 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_ newt_ctx; 65 CeedScalar lx; 66 CeedScalar ly; 67 CeedScalar lz; 68 CeedScalar time; 69 }; 70