xref: /honee/qfunctions/advection_types.h (revision 8a8cb6e06ce4728cc6d80ca92f8de31da49852e5)
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 } AdvectionICType;
20 
21 // Advection - Bubble Continuity Types
22 typedef enum {
23   BUBBLE_CONTINUITY_SMOOTH     = 0,  // Original continuous, smooth shape
24   BUBBLE_CONTINUITY_BACK_SHARP = 1,  // Discontinuous, sharp back half shape
25   BUBBLE_CONTINUITY_THICK      = 2,  // Define a finite thickness
26   BUBBLE_CONTINUITY_COSINE     = 3,  // Use cosine wave for smoothing
27 } BubbleContinuityType;
28 
29 typedef struct AdvectionContext_ *AdvectionContext;
30 struct AdvectionContext_ {
31   CeedScalar           CtauS;
32   bool                 strong_form;
33   CeedScalar           E_wind;
34   bool                 implicit;
35   StabilizationType    stabilization;
36   StabilizationTauType stabilization_tau;
37   CeedScalar           Ctau_a;
38   CeedScalar           Ctau_t;
39   CeedScalar           dt;
40   CeedScalar           diffusion_coeff;
41 };
42 
43 typedef struct SetupContextAdv_ *SetupContextAdv;
44 struct SetupContextAdv_ {
45   CeedScalar           rc;
46   CeedScalar           lx;
47   CeedScalar           ly;
48   CeedScalar           lz;
49   CeedScalar           wind[3];
50   CeedScalar           time;
51   WindType             wind_type;
52   AdvectionICType      initial_condition_type;
53   BubbleContinuityType bubble_continuity_type;
54 };
55