xref: /honee/qfunctions/advection_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   ADVDIF_WIND_ROTATION       = 0,
13   ADVDIF_WIND_TRANSLATION    = 1,
14   ADVDIF_WIND_BOUNDARY_LAYER = 2,
15 } AdvDifWindType;
16 
17 // Advection - Initial Condition Types
18 typedef enum {
19   ADVDIF_IC_BUBBLE_SPHERE   = 0,  // dim=3
20   ADVDIF_IC_BUBBLE_CYLINDER = 1,  // dim=2
21   ADVDIF_IC_COSINE_HILL     = 2,  // dim=2
22   ADVDIF_IC_SKEW            = 3,
23   ADVDIF_IC_WAVE            = 4,
24   ADVDIF_IC_BOUNDARY_LAYER  = 5,
25 } AdvDifICType;
26 
27 // Advection-Diffusion wave types
28 typedef enum {
29   ADVDIF_WAVE_SINE   = 0,
30   ADVDIF_WAVE_SQUARE = 1,
31 } AdvDifWaveType;
32 
33 // Advection - Bubble Continuity Types
34 typedef enum {
35   ADVDIF_BUBBLE_CONTINUITY_SMOOTH     = 0,  // Original continuous, smooth shape
36   ADVDIF_BUBBLE_CONTINUITY_BACK_SHARP = 1,  // Discontinuous, sharp back half shape
37   ADVDIF_BUBBLE_CONTINUITY_THICK      = 2,  // Define a finite thickness
38   ADVDIF_BUBBLE_CONTINUITY_COSINE     = 3,  // Use cosine wave for smoothing
39 } AdvDifBubbleContinuityType;
40 
41 typedef struct AdvectionContext_ *AdvectionContext;
42 struct AdvectionContext_ {
43   bool       strong_form;
44   CeedScalar E_wind;
45   bool       implicit;
46   CeedScalar dt;
47   CeedScalar diffusion_coeff;
48 
49   StabilizationType           stabilization;
50   StabilizationTauType        stabilization_tau;
51   CeedScalar                  CtauS;
52   CeedScalar                  Ctau_a, Ctau_d, Ctau_t;
53   DivDiffFluxProjectionMethod divFdiff_method;
54 };
55 
56 typedef struct SetupContextAdv_ *SetupContextAdv;
57 struct SetupContextAdv_ {
58   CeedScalar rc;
59   CeedScalar lx;
60   CeedScalar ly;
61   CeedScalar lz;
62   CeedScalar wind[3];
63   CeedScalar time;
64   CeedScalar wave_frequency, wave_phase;
65   CeedScalar bl_height_factor;  // !< height of boundary layer IC relative to domain height
66 
67   AdvDifWaveType             wave_type;
68   AdvDifWindType             wind_type;
69   AdvDifICType               initial_condition_type;
70   AdvDifBubbleContinuityType bubble_continuity_type;
71 };
72