Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielDoehring committed Mar 29, 2024
1 parent 7376dd4 commit c156876
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ u_inf(equations) = mach_inf() * c_inf(equations)
v1 = u_inf(equations) * cos(aoa())
v2 = u_inf(equations) * sin(aoa())

prim = SVector(rho_inf(), v1, v2, pre_inf())
prim = SVector(rho_inf(), v1, v2, p_inf())
return prim2cons(prim, equations)
end

Expand Down Expand Up @@ -107,7 +107,7 @@ save_solution = SaveSolutionCallback(interval = 500,
solution_variables = cons2prim)

# Small time step should be used to reach steady state
stepsize_callback = StepsizeCallback(cfl = 0.25)
stepsize_callback = StepsizeCallback(cfl = 1.0)

amr_indicator = IndicatorLöhner(semi, variable = Trixi.density)

Expand All @@ -127,7 +127,7 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback, sav

###############################################################################
# run the simulation
sol = solve(ode, SSPRK54(),
sol = solve(ode, SSPRK54(thread = OrdinaryDiffEq.True()),
dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback
save_everystep = false, callback = callbacks);
summary_callback() # print the timer summary
8 changes: 4 additions & 4 deletions src/callbacks_step/analysis_surface_integral_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ end
Compute the lift coefficient
```math
C_{L,p} \coloneqq \frac{\oint_{\partial \Omega} p \boldsymbol n \cdot \psi_L \, \mathrm{d} S}
{0.5 \cdot \rho_{\infty} \cdot U_{\infty}^2 \cdot L_{\infty}}
C_{L,p} \\coloneqq \\frac{\\oint_{\\partial \\Omega} p \\boldsymbol n \\cdot \\psi_L \\, \\mathrm{d} S}
{0.5 \\cdot \\rho_{\\infty} \\cdot U_{\\infty}^2 \\cdot L_{\\infty}}
```
based on the pressure distribution along a boundary.
Supposed to be used in conjunction with [`AnalysisSurfaceIntegral`](@ref)
Expand All @@ -93,8 +93,8 @@ end
Compute the drag coefficient
```math
C_{D,p} \coloneqq \frac{\oint_{\partial \Omega} p \boldsymbol n \cdot \psi_D \, \mathrm{d} S}
{0.5 \cdot \rho_{\infty} \cdot U_{\infty}^2 \cdot L_{\infty}}
C_{D,p} \\coloneqq \\frac{\\oint_{\\partial \\Omega} p \\boldsymbol n \\cdot \\psi_D \\, \\mathrm{d} S}
{0.5 \\cdot \\rho_{\\infty} \\cdot U_{\\infty}^2 \\cdot L_{\\infty}}
```
based on the pressure distribution along a boundary.
Supposed to be used in conjunction with [`AnalysisSurfaceIntegral`](@ref)
Expand Down
12 changes: 6 additions & 6 deletions test/test_p4est_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -574,12 +574,12 @@ end
@test_trixi_include(joinpath(EXAMPLES_DIR,
"elixir_euler_NACA0012airfoil_mach085.jl"),
l2=[
5.37640294704164e-7, 6.418954697992308e-6,
1.0332595763357066e-5, 0.0006353813399881882,
5.371568111383228e-7, 6.4158131303956445e-6,
1.0324346542348325e-5, 0.0006348064933187732,
],
linf=[
0.0016284523634016628, 0.028505821812697323,
0.029918806073518, 1.9505653217814127,
0.0016263400091978443, 0.028471072159724428,
0.02986133204785877, 1.9481060511014872,
],
base_level=0, med_level=1, max_level=1,
tspan=(0.0, 0.0001),
Expand Down Expand Up @@ -608,8 +608,8 @@ end
lift = Trixi.analyze(lift_coefficient, du, u, tspan[2], mesh, equations, solver,
semi.cache)

@test isapprox(lift, 0.026397498239816828, atol = 1e-13)
@test isapprox(drag, 0.10908833968266139, atol = 1e-13)
@test isapprox(lift, 0.0262382560809345, atol = 1e-13)
@test isapprox(drag, 0.10898248971932244, atol = 1e-13)
end
end

Expand Down

0 comments on commit c156876

Please sign in to comment.