dragonfly_sim.core.RANS_model ============================= .. py:module:: dragonfly_sim.core.RANS_model .. autoapi-nested-parse:: Compressible RANS (and laminar Navier-Stokes) at p = 0, built on the Euler model by composition. CompressibleRANSModel owns a CompressibleEulerModel (`self.flow`) whose state carries the turbulence model's transported scalars after the mean flow (rho*nu_tilde for Spalart-Allmaras), and plugs the viscous physics into it. Everything else -- spaces, boundary conditions, the Newton solver and positivity limiter, pseudo-transient continuation, time stepping, adjoint and shape-derivative assembly -- is the Euler model's own code. Attributes and methods the RANS model does not define itself are forwarded to `self.flow` (reads and writes), so DG_windtunnel_model and DG_postprocessor use it exactly like the Euler model. Discretization (cell-centred finite volume, as DG0) --------------------------------------------------- Inviscid: NS_utils.extended_hll_flux (HLL on the mean flow, the same fan upwinding the scalars), with MUSCL-reconstructed interior-facet traces. Without MUSCL the first-order HLL flux puts acoustic-speed dissipation on the tangential momentum at wall-parallel facets, a numerical viscosity that exceeds the turbulent one through the boundary layer (SA NACA0012 at M 0.7: friction drag ~10x too high). Viscous: through each facet, F_v(U_f, grad U_f) . n with the reconstructed facet gradient of core/reconstruction.py; no penalty term. Turbulence sources use the Green-Gauss gradient G. G is condensed out of Newton exactly, and is a derived field for adjoints and shape derivatives, as are the cell centres and the wall distance. Nondimensionalization: rho_inf = p_inf = 1, chord 1, U_inf = M sqrt(gamma), mu_inf = rho_inf U_inf / Re (Re held fixed under set_mach). Boundary conditions (kind: extra-variable values) ------------------------------------------------- farfield the characteristic state; scalars from the free stream where it flows in, from the interior where it flows out wall adiabatic no-slip (define_wall_bc): u = 0, interior density and internal energy, the turbulence model's wall values; zero heat flux slip (symmetry) the Euler slip state, interior scalars, no viscous flux Solver defaults --------------- Pseudo-transient continuation from the free stream (use_ptc, CFL0 5), one Newton step per pseudo step; FGMRES on the exact condensed Jacobian, preconditioned with ASM(1)/ILU(2) of the compact gradient-frozen part (jacobian_mode "compact_pc", utils/gradient_condensation.py). Set direct_linear_solver for MUMPS on the exact Jacobian instead. .. !! processed by numpydoc !! Classes ------- .. autoapisummary:: dragonfly_sim.core.RANS_model.CompressibleRANSModel Module Contents --------------- .. py:class:: CompressibleRANSModel(mesh, Re, turbulence_model=None, gamma=1.4, Pr=0.72, Pr_t=0.9, viscosity_law='sutherland', T_inf_dim=300.0, sutherland_S_dim=110.4, muscl=True, limiter=None, limiter_eps=0.01, jacobian_mode='compact_pc') .. py:method:: __getattr__(name) .. py:method:: __setattr__(name, value) .. py:method:: _boundary_scalars(kind, U, inflow) .. py:method:: _extra_scales() .. py:method:: _freestream_extras() .. py:method:: _interior_terms() .. py:method:: _limiter_scales() .. py:method:: _viscous_boundary_terms(U_b, meshtag, kind) .. py:method:: _viscous_time_scale(U) .. py:method:: _wall_stress_arguments(U) (state, gradient) the wall shear is evaluated with: the wall state and the reconstructed facet gradient, exactly what the residual's wall flux uses. .. !! processed by numpydoc !! .. py:method:: _wall_traction(U, n) .. py:method:: define_elements_functionspaces() .. py:method:: define_farfield_conditions(bc_dict) .. py:method:: define_noslip_wall_bc(meshtag) Adiabatic no-slip wall. The inviscid flux is the exact flux of the wall state, (0, p n, 0, 0): no mass, energy or scalar flux through the wall, the interior pressure on it. Conduction is dropped from the viscous flux, which is the q.n = 0 condition. .. !! processed by numpydoc !! .. py:method:: define_wall_bc(meshtag) .. py:method:: eddy_viscosity(U) .. py:method:: eddy_viscosity_ratio() mu_t / mu of the current state, as a UFL expression. .. !! processed by numpydoc !! .. py:method:: freestream() The free-stream dict TurbulenceModel methods take. .. !! processed by numpydoc !! .. py:method:: laminar_viscosity(U) .. py:method:: noslip_wall_state(U) .. py:method:: set_mach(M) .. py:method:: set_up_solver() .. py:method:: skin_friction_vector(U, n, q_inf) tau_w / q_inf: the wall shear (tangential traction) coefficient vector. Call update_derived_fields() before assembling it. .. !! processed by numpydoc !! .. py:method:: viscous_flux(U, G, heat_flux=True) .. py:attribute:: Pr .. py:attribute:: Pr_t .. py:attribute:: Re .. py:attribute:: _OWN .. py:attribute:: jacobian_mode :value: 'compact_pc' .. py:attribute:: limiter :value: None .. py:attribute:: limiter_eps :value: 0.01 .. py:attribute:: mu_inf_const :value: None .. py:attribute:: muscl :value: True .. py:attribute:: reconstruction :value: None .. py:attribute:: sutherland_S_ratio .. py:attribute:: turbulence_model .. py:attribute:: viscosity_law :value: 'sutherland' .. py:attribute:: wall_distance :value: None .. py:attribute:: wall_tags :value: []