Orchestrates a single time step of the Eulerian fluid solver.
This is the refactored, high-level entry point for advancing the fluid state from time t_n to t_{n+1}. It takes the master SimCtx as its primary argument.
This function is the refactored, high-level entry point for advancing the fluid state from time t_n to t_{n+1}. It is a direct adaptation of the legacy FlowSolver, but it now takes the master SimCtx as its primary argument to eliminate dependencies on global variables.
27{
28 PetscErrorCode ierr;
30 PetscInt level = usermg->
mglevels - 1;
32
33 PetscFunctionBeginUser;
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
74
81 }
82
84 }
85 }
86
87
88
89
90
91
92
93
95
97
99
100 ierr =
ImpRK(user, NULL, NULL); CHKERRQ(ierr);
101 } else {
102
104
105 ierr =
RungeKutta(user, NULL, NULL); CHKERRQ(ierr);
106 }
107
108
109
110
111
112
113
115
118 } else {
119
121 }
122
123
124
125
126
127
128
130 for (PetscInt bi = 0; bi < simCtx->
block_number; bi++) {
133
135
137
138
140 }
141
142
143
144
145
146
147
148 for (PetscInt bi = 0; bi < simCtx->
block_number; bi++) {
150
151
152
154
155
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177 }
178
181 PetscFunctionReturn(0);
182}
PetscErrorCode ImpRK(UserCtx *user, IBMNodes *ibm, FSInfo *fsi)
Advances the momentum equations using an iterative explicit Runge-Kutta scheme.
PetscErrorCode RungeKutta(UserCtx *user, IBMNodes *ibm, FSInfo *fsi)
Advances the momentum equations using an explicit 4th-order Runge-Kutta scheme.
PetscErrorCode ComputeEddyViscosityLES(UserCtx *user)
Computes the turbulent eddy viscosity (Nu_t) for the LES model.
PetscErrorCode ComputeSmagorinskyConstant(UserCtx *user)
Computes the dynamic Smagorinsky constant (Cs) for the LES model.
#define LOCAL
Logging scope definitions for controlling message output.
#define GLOBAL
Scope for global logging across all processes.
#define LOG_ALLOW(scope, level, fmt,...)
Logging macro that checks both the log level and whether the calling function is in the allowed-funct...
#define PROFILE_FUNCTION_END
Marks the end of a profiled code block.
PetscErrorCode LOG_CONTINUITY_METRICS(UserCtx *user)
Logs continuity metrics for a single block to a file.
@ LOG_INFO
Informational messages about program execution.
@ LOG_WARNING
Non-critical issues that warrant attention.
@ LOG_DEBUG
Detailed debugging information.
#define PROFILE_FUNCTION_BEGIN
Marks the beginning of a profiled code block (typically a function).
PetscErrorCode Projection(UserCtx *user)
Corrects the contravariant velocity field Ucont to be divergence-free using the gradient of the press...
PetscErrorCode UpdatePressure(UserCtx *user)
Updates the pressure field P with the pressure correction Phi computed by the Poisson solver.
PetscErrorCode PoissonSolver_MG(UserMG *usermg)
Solves the pressure-Poisson equation using a geometric multigrid method.
PetscErrorCode Contra2Cart(UserCtx *user)
Reconstructs Cartesian velocity (Ucat) at cell centers from contravariant velocity (Ucont) defined on...
PetscErrorCode ComputeDivergence(UserCtx *user)
PetscErrorCode UpdateLocalGhosts(UserCtx *user, const char *fieldName)
Updates the local vector (including ghost points) from its corresponding global vector.
User-defined context containing data specific to a single computational grid level.
User-level context for managing the entire multigrid hierarchy.