Welcome to MIRGE-Com’s documentation!¶
Math, Intermediate Representation, Compressible Flow, For Scramjets. MIRGE-Com aims to be a library of parts from which scramjet simulations for the Center for Exascale-Enabled Scramjet Design (CEESD) at the University of Illinois can be built.
Here’s an example, to give you an impression:
import numpy as np
import pyopencl as cl
from pytools.obj_array import flat_obj_array
from grudge.discretization import DiscretizationCollection
from grudge.shortcuts import make_visualizer
from mirgecom.wave import wave_operator
from mirgecom.integrators import rk4_step
from meshmode.array_context import PyOpenCLArrayContext
cl_ctx = cl.create_some_context()
queue = cl.CommandQueue(cl_ctx)
actx = PyOpenCLArrayContext(queue)
dim = 2
nel_1d = 16
order = 3
dt = 0.75 / (nel_1d * order ** 2)
from meshmode.mesh.generation import generate_regular_rect_mesh
mesh = generate_regular_rect_mesh(a=(-0.5,)*dim, b=(0.5,)*dim, n=(nel_1d,)*dim)
print("%d elements" % mesh.nelements)
discr = DiscretizationCollection(actx, mesh, order=order)
fields = flat_obj_array(
[discr.zeros(actx)],
[discr.zeros(actx) for i in range(discr.dim)]
)
vis = make_visualizer(discr, order + 3)
def rhs(t, w):
return wave_operator(discr, c=1, w=w)
t = 0
t_final = 3
istep = 0
while t < t_final:
fields = rk4_step(fields, t, dt, rhs)
if istep % 10 == 0:
print(istep, t, discr.norm(fields[0], np.inf))
vis.write_vtk_file("wave-%04d.vtu" % istep,
[("u", fields[0]), ("v", fields[1:]), ])
t += dt
istep += 1
(This example is derived from
examples/wave.py
in the MIRGE-Com
source distribution.)
Table of Contents¶
- 1. Mathematical Model
- 2. Discretization Strategy
- 3. Wall Model
- 3.1. Solid materials
- 3.2. Porous materials
- 3.3. Material specification
- 3.3.1. Carbon fiber
- 3.3.2. TACOT
- 3.3.3. User-defined material
PrescribedMaterialEOS
PrescribedMaterialEOS.void_fraction()
PrescribedMaterialEOS.enthalpy()
PrescribedMaterialEOS.heat_capacity()
PrescribedMaterialEOS.thermal_conductivity()
PrescribedMaterialEOS.volume_fraction()
PrescribedMaterialEOS.permeability()
PrescribedMaterialEOS.emissivity()
PrescribedMaterialEOS.tortuosity()
PrescribedMaterialEOS.decomposition_progress()
- 3.4. Helper Functions
- 4. Operators
- 4.1. Linear Acoustic Wave Equation
- 4.2. Diffusion
- 4.3. Artificial Viscosity
- 4.4. Gas Dynamics
- 4.4.1. Conserved Quantities Handling
- 4.4.2. Helper Functions
- 4.4.3. Equations of State
GasDependentVars
MixtureDependentVars
GasEOS
MixtureEOS
IdealSingleGas
IdealSingleGas.__init__()
IdealSingleGas.gamma()
IdealSingleGas.heat_capacity_cp()
IdealSingleGas.heat_capacity_cv()
IdealSingleGas.gas_const()
IdealSingleGas.get_density()
IdealSingleGas.kinetic_energy()
IdealSingleGas.internal_energy()
IdealSingleGas.pressure()
IdealSingleGas.sound_speed()
IdealSingleGas.temperature()
IdealSingleGas.total_energy()
IdealSingleGas.get_internal_energy()
IdealSingleGas.dependent_vars()
PyrometheusMixture
PyrometheusMixture.__init__()
PyrometheusMixture.pressure()
PyrometheusMixture.temperature()
PyrometheusMixture.sound_speed()
PyrometheusMixture.internal_energy()
PyrometheusMixture.gas_const()
PyrometheusMixture.dependent_vars()
PyrometheusMixture.total_energy()
PyrometheusMixture.kinetic_energy()
PyrometheusMixture.heat_capacity_cv()
PyrometheusMixture.heat_capacity_cp()
PyrometheusMixture.gamma()
PyrometheusMixture.get_internal_energy()
PyrometheusMixture.get_density()
PyrometheusMixture.get_species_molecular_weights()
PyrometheusMixture.get_production_rates()
PyrometheusMixture.species_enthalpies()
PyrometheusMixture.get_species_source_terms()
PyrometheusMixture.get_temperature_seed()
- 4.4.4. Exceptions
- 4.4.5. Transport Models
GasTransportVars
TransportModel
SimpleTransport
PowerLawTransport
MixtureAveragedTransport
ArtificialViscosityTransportDiv
ArtificialViscosityTransportDiv2
ArtificialViscosityTransportDiv2.__init__()
ArtificialViscosityTransportDiv2.bulk_viscosity()
ArtificialViscosityTransportDiv2.viscosity()
ArtificialViscosityTransportDiv2.volume_viscosity()
ArtificialViscosityTransportDiv2.thermal_conductivity()
ArtificialViscosityTransportDiv2.species_diffusivity()
ArtificialViscosityTransportDiv3
ArtificialViscosityTransportDiv3.__init__()
ArtificialViscosityTransportDiv3.bulk_viscosity()
ArtificialViscosityTransportDiv3.viscosity()
ArtificialViscosityTransportDiv3.volume_viscosity()
ArtificialViscosityTransportDiv3.thermal_conductivity()
ArtificialViscosityTransportDiv3.species_diffusivity()
- 4.4.6. Exceptions
- 4.4.7. Physical Gas Model Encapsulation
- 4.4.8. Fluid State Encapsulation
FluidState
FluidState.cv
FluidState.dv
FluidState.array_context
FluidState.dim
FluidState.nspecies
FluidState.pressure
FluidState.temperature
FluidState.smoothness_mu
FluidState.smoothness_kappa
FluidState.smoothness_d
FluidState.smoothness_beta
FluidState.velocity
FluidState.speed
FluidState.wavespeed
FluidState.speed_of_sound
FluidState.mass_density
FluidState.momentum_density
FluidState.energy_density
FluidState.species_mass_density
FluidState.species_mass_fractions
FluidState.species_enthalpies
ViscousFluidState
PorousFlowFluidState
- 4.4.9. Fluid State Handling Utilities
- 4.4.10. Solution Initializers
- 4.4.11. State Initializers
- 4.4.12. Initialization Utilities
- 4.4.13. RHS Evaluation
- 4.4.14. Logging Helpers
- 4.4.15. Inviscid Flux Calculation
- 4.4.16. Inviscid Time Step Computation
- 4.4.17. Viscous Flux Calculation
- 4.4.18. Viscous Time Step Computation
- 4.4.19. RHS Evaluation
- 4.4.20. Boundary Treatment Interfaces
- 4.4.21. Boundary Conditions Base Classes
PrescribedFluidBoundary
MengaldoBoundaryCondition
MengaldoBoundaryCondition.inviscid_divergence_flux()
MengaldoBoundaryCondition.viscous_divergence_flux()
MengaldoBoundaryCondition.cv_gradient_flux()
MengaldoBoundaryCondition.temperature_gradient_flux()
MengaldoBoundaryCondition.state_bc()
MengaldoBoundaryCondition.grad_cv_bc()
MengaldoBoundaryCondition.temperature_bc()
MengaldoBoundaryCondition.grad_temperature_bc()
MengaldoBoundaryCondition.state_plus()
- 4.4.22. Boundary Conditions
- 4.4.23. Low-level interfaces
- 4.4.24. Field limiter functions
- 4.4.25. Symbolic fluxes
- 4.4.26. Symbolic fluid operators
- 4.5. Thermally Coupled Fluid-Wall
- 4.5.1. Boundary Setup Functions
- 4.5.2. Basic Coupled Operators
- 4.5.3. Boundary Conditions
InterfaceFluidBoundary
InterfaceFluidSlipBoundary
InterfaceFluidNoslipBoundary
InterfaceFluidNoslipBoundary.__init__()
InterfaceFluidNoslipBoundary.state_plus()
InterfaceFluidNoslipBoundary.state_bc()
InterfaceFluidNoslipBoundary.grad_cv_bc()
InterfaceFluidNoslipBoundary.temperature_plus()
InterfaceFluidNoslipBoundary.temperature_bc()
InterfaceFluidNoslipBoundary.grad_temperature_bc()
InterfaceWallBoundary
InterfaceWallRadiationBoundary
- 5. Simulation Support
- 5.1. Arrays and Array Containers in
mirgecom
- 5.2. Time Integrators
- 5.3. Time Integration Loops
- 5.4. Spectral filters
- 5.5. MPI
- 5.6. Input/Output
- 5.7. Random Pile’o’Tools
- 5.7.1. General utilities
- 5.7.2. Diagnostic utilities
- 5.7.3. Mesh and element utilities
- 5.7.4. Simulation support utilities
- 5.7.5. File comparison utilities
- 5.7.6. Exceptions
StatisticsAccumulator
asdict_shallow()
force_evaluation()
force_compile()
normalize_boundaries()
project_from_base()
mask_from_elements()
get_reasonable_array_context_class()
actx_class_is_lazy()
actx_class_is_eager()
actx_class_is_profiling()
actx_class_is_numpy()
initialize_actx()
- 5.8. Symbolic Computation for Analytic Solutions
- 5.9. Math
- 5.10. Primitive operators and wrappers
- 5.11. Thermochemistry mechanism management
- 5.1. Arrays and Array Containers in
- 6. Development How-To
- 6.1. What Packages are Involved?
- 6.2. Working with Pull Requests
- 6.3. Installation
- 6.4. Building this Documentation
- 7. Running MirgeCOM
- 7.1. Running with large numbers of ranks and nodes
- 7.2. OpenCL device selection
- 7.3. Profiling and logging
- 7.3.1. Profiling memory consumption with
memray
- 7.3.2. Profiling kernel execution
- 7.3.3. Time series logging
StateConsumer
DiscretizationBasedQuantity
KernelProfile
PythonMemoryUsage
DeviceMemoryUsage
initialize_logmgr()
logmgr_add_cl_device_info()
logmgr_add_device_memory_usage()
logmgr_add_many_discretization_quantities()
logmgr_add_mempool_usage()
add_package_versions()
set_sim_state()
logmgr_set_time()
- 7.3.1. Profiling memory consumption with
- 7.4. Scripting launches
- 7.5. Running on specific systems
- 7.6. OpenCL kernel caching
- 8. Frequently Asked Questions
- 8.1. Why on earth does the code…?
- 8.2. Installation questions
- 8.2.1. What is conda/anaconda/conda-forge/miniconda/miniforge?
- 8.2.2. Why are we installing (mostly) binary packages?
- 8.2.3. How can I install pocl from source?
- 8.2.4. How can I use system OpenCL implementations, such as Nvidia CL or Apple CL?
- 8.2.5. How can I build pyopencl from source?
- 8.2.6. How can I record the exact versions of Python packages that are currently installed and reinstall them at a later time?
- 8.2.7. How can I record the exact versions of Conda packages that are currently installed and reinstall them at a later time?
- 8.3. Common error messages
- 9. User-Visible Changes
- 10. License
- 11. Citing MIRGE-Com
- 12. Acknowledgment
- 13. Disclaimer
- 14. To-Do List for the Docs
- 15. References
- 🚀 Github
- 💾 Download Releases