xref: /libCEED/examples/fluids/qfunctions/advection_types.h (revision d4cc18453651bd0f94c1a2e078b2646a92dafdcc)
1 // Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors.
2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3 //
4 // SPDX-License-Identifier: BSD-2-Clause
5 //
6 // This file is part of CEED:  http://github.com/ceed
7 #pragma once
8 
9 #include <ceed/types.h>
10 #ifndef CEED_RUNNING_JIT_PASS
11 #include <stdbool.h>
12 #endif
13 
14 #include "stabilization_types.h"
15 
16 typedef enum {
17   WIND_ROTATION    = 0,
18   WIND_TRANSLATION = 1,
19 } WindType;
20 
21 // Advection - Initial Condition Types
22 typedef enum {
23   ADVECTIONIC_BUBBLE_SPHERE   = 0,  // dim=3
24   ADVECTIONIC_BUBBLE_CYLINDER = 1,  // dim=2
25   ADVECTIONIC_COSINE_HILL     = 2,  // dim=2
26   ADVECTIONIC_SKEW            = 3,
27 } AdvectionICType;
28 
29 // Advection - Bubble Continuity Types
30 typedef enum {
31   BUBBLE_CONTINUITY_SMOOTH     = 0,  // Original continuous, smooth shape
32   BUBBLE_CONTINUITY_BACK_SHARP = 1,  // Discontinuous, sharp back half shape
33   BUBBLE_CONTINUITY_THICK      = 2,  // Define a finite thickness
34   BUBBLE_CONTINUITY_COSINE     = 3,  // Use cosine wave for smoothing
35 } BubbleContinuityType;
36 
37 typedef struct AdvectionContext_ *AdvectionContext;
38 struct AdvectionContext_ {
39   CeedScalar           CtauS;
40   bool                 strong_form;
41   CeedScalar           E_wind;
42   bool                 implicit;
43   StabilizationType    stabilization;
44   StabilizationTauType stabilization_tau;
45   CeedScalar           Ctau_a;
46   CeedScalar           Ctau_t;
47   CeedScalar           dt;
48   CeedScalar           diffusion_coeff;
49 };
50 
51 typedef struct SetupContextAdv_ *SetupContextAdv;
52 struct SetupContextAdv_ {
53   CeedScalar           rc;
54   CeedScalar           lx;
55   CeedScalar           ly;
56   CeedScalar           lz;
57   CeedScalar           wind[3];
58   CeedScalar           time;
59   WindType             wind_type;
60   AdvectionICType      initial_condition_type;
61   BubbleContinuityType bubble_continuity_type;
62 };
63