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