Peano
Loading...
Searching...
No Matches
PDE Namespace Reference

Variables

str compute_primitive_variables
 
str max_eigenvalue
 
str flux
 
str source_term
 

Variable Documentation

◆ compute_primitive_variables

str PDE.compute_primitive_variables
Initial value:
1= r"""
2 const auto irho = 1.0 / Q[Shortcuts::rho];
3 const auto u0 = Q[Shortcuts::rhoU + 0] * irho;
4 const auto u1 = Q[Shortcuts::rhoU + 1] * irho;
5#if DIMENSIONS == 3
6 const auto u2 = Q[Shortcuts::rhoU + 2] * irho;
7#endif
8
9#if DIMENSIONS == 3
10 const auto uSq = u0 * u0 + u1 * u1 + u2 * u2;
11 const auto u_n = (normal == 0) ? u0 : (normal == 1) ? u1 : u2;
12#else
13 const auto uSq = u0 * u0 + u1 * u1;
14 const auto u_n = (normal == 0) ? u0 : u1;
15#endif
16
17 const auto internalE = Q[Shortcuts::rhoE] - 0.5 * Q[Shortcuts::rho] * uSq;
18 const auto p = (GAMMA - 1.0) * internalE;
19"""

Definition at line 4 of file PDE.py.

◆ flux

str PDE.flux
Initial value:
1= r"""
2 {compute_primitive_variables}
3
4 F[Shortcuts::rho] = Q[Shortcuts::rhoU + normal];
5
6 F[Shortcuts::rhoU + 0] = Q[Shortcuts::rhoU + 0] * u_n;
7 F[Shortcuts::rhoU + 1] = Q[Shortcuts::rhoU + 1] * u_n;
8#if DIMENSIONS == 3
9 F[Shortcuts::rhoU + 2] = Q[Shortcuts::rhoU + 2] * u_n;
10#endif
11
12 F[Shortcuts::rhoU + normal] += p;
13
14 F[Shortcuts::rhoE] = (Q[Shortcuts::rhoE] + p) * u_n;
15""".format(
16 compute_primitive_variables=compute_primitive_variables
17)

Definition at line 34 of file PDE.py.

◆ max_eigenvalue

str PDE.max_eigenvalue
Initial value:
1= r"""
2 {compute_primitive_variables}
3 const auto speedOfSound = sqrt(GAMMA * p * irho);
4 auto result = fmax(0.0, fabs(u_n - speedOfSound));
5 result = fmax(result, fabs(u_n + speedOfSound));
6 return result;
7""".format(
8 compute_primitive_variables=compute_primitive_variables
9)

Definition at line 24 of file PDE.py.

◆ source_term

str PDE.source_term
Initial value:
1= r"""
2 S[Shortcuts::rho] = 0.0;
3 S[Shortcuts::rhoU + 0] = 0.0;
4 S[Shortcuts::rhoU + 1] = -Q[Shortcuts::rho] * GRAVITY;
5#if DIMENSIONS == 3
6 S[Shortcuts::rhoU + 2] = 0.0;
7#endif
8 S[Shortcuts::rhoE] = -Q[Shortcuts::rhoU + 1] * GRAVITY;
9"""

Definition at line 52 of file PDE.py.