xref: /honee/qfunctions/advection_types.h (revision da02a6e7947cab8e173fd83bf2b4eda896c06b14)
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.h>
6 #include "stabilization_types.h"
7 
8 typedef enum {
9   WIND_ROTATION    = 0,
10   WIND_TRANSLATION = 1,
11 } WindType;
12 
13 // Advection - Initial Condition Types
14 typedef enum {
15   ADVECTIONIC_BUBBLE_SPHERE   = 0,  // dim=3
16   ADVECTIONIC_BUBBLE_CYLINDER = 1,  // dim=2
17   ADVECTIONIC_COSINE_HILL     = 2,  // dim=2
18   ADVECTIONIC_SKEW            = 3,
19   ADVECTIONIC_WAVE            = 4,
20 } AdvectionICType;
21 
22 // Advection-Diffusion wave types
23 typedef enum {
24   ADVDIF_WAVE_SINE   = 0,
25   ADVDIF_WAVE_SQUARE = 1,
26 } AdvDifWaveType;
27 
28 // Advection - Bubble Continuity Types
29 typedef enum {
30   BUBBLE_CONTINUITY_SMOOTH     = 0,  // Original continuous, smooth shape
31   BUBBLE_CONTINUITY_BACK_SHARP = 1,  // Discontinuous, sharp back half shape
32   BUBBLE_CONTINUITY_THICK      = 2,  // Define a finite thickness
33   BUBBLE_CONTINUITY_COSINE     = 3,  // Use cosine wave for smoothing
34 } BubbleContinuityType;
35 
36 typedef struct AdvectionContext_ *AdvectionContext;
37 struct AdvectionContext_ {
38   CeedScalar           CtauS;
39   bool                 strong_form;
40   CeedScalar           E_wind;
41   bool                 implicit;
42   StabilizationType    stabilization;
43   StabilizationTauType stabilization_tau;
44   CeedScalar           Ctau_a;
45   CeedScalar           Ctau_t;
46   CeedScalar           dt;
47   CeedScalar           diffusion_coeff;
48 };
49 
50 typedef struct SetupContextAdv_ *SetupContextAdv;
51 struct SetupContextAdv_ {
52   CeedScalar           rc;
53   CeedScalar           lx;
54   CeedScalar           ly;
55   CeedScalar           lz;
56   CeedScalar           wind[3];
57   CeedScalar           time;
58   CeedScalar           wave_frequency, wave_phase;
59   AdvDifWaveType       wave_type;
60   WindType             wind_type;
61   AdvectionICType      initial_condition_type;
62   BubbleContinuityType bubble_continuity_type;
63 };
64