lowmach_react_hex Program

Uses

  • program~~lowmach_react_hex~~UsesGraph program~lowmach_react_hex lowmach_react_hex module~mod_bc mod_bc program~lowmach_react_hex->module~mod_bc module~mod_energy mod_energy program~lowmach_react_hex->module~mod_energy module~mod_fields mod_fields program~lowmach_react_hex->module~mod_fields module~mod_flow_projection mod_flow_projection program~lowmach_react_hex->module~mod_flow_projection module~mod_input mod_input program~lowmach_react_hex->module~mod_input module~mod_kinds mod_kinds program~lowmach_react_hex->module~mod_kinds module~mod_mesh_io mod_mesh_io program~lowmach_react_hex->module~mod_mesh_io module~mod_mesh_types mod_mesh_types program~lowmach_react_hex->module~mod_mesh_types module~mod_mpi_flow mod_mpi_flow program~lowmach_react_hex->module~mod_mpi_flow module~mod_mpi_radiation mod_mpi_radiation program~lowmach_react_hex->module~mod_mpi_radiation module~mod_output mod_output program~lowmach_react_hex->module~mod_output module~mod_profiler mod_profiler program~lowmach_react_hex->module~mod_profiler module~mod_species mod_species program~lowmach_react_hex->module~mod_species module~mod_transport_properties mod_transport_properties program~lowmach_react_hex->module~mod_transport_properties mpi_f08 mpi_f08 program~lowmach_react_hex->mpi_f08 module~mod_bc->module~mod_input module~mod_bc->module~mod_kinds module~mod_bc->module~mod_mesh_types module~mod_energy->module~mod_bc module~mod_energy->module~mod_fields module~mod_energy->module~mod_input module~mod_energy->module~mod_kinds module~mod_energy->module~mod_mesh_types module~mod_energy->module~mod_mpi_flow module~mod_energy->module~mod_profiler module~mod_energy->mpi_f08 iso_c_binding iso_c_binding module~mod_energy->iso_c_binding module~mod_fields->module~mod_bc module~mod_fields->module~mod_input module~mod_fields->module~mod_kinds module~mod_fields->module~mod_mesh_types module~mod_flow_projection->module~mod_bc module~mod_flow_projection->module~mod_fields module~mod_flow_projection->module~mod_input module~mod_flow_projection->module~mod_kinds module~mod_flow_projection->module~mod_mesh_types module~mod_flow_projection->module~mod_mpi_flow module~mod_flow_projection->module~mod_profiler module~mod_flow_projection->module~mod_transport_properties module~mod_flow_projection->mpi_f08 module~mod_input->module~mod_kinds iso_fortran_env iso_fortran_env module~mod_kinds->iso_fortran_env module~mod_mesh_io->module~mod_kinds module~mod_mesh_io->module~mod_mesh_types module~mod_mesh_types->module~mod_kinds module~mod_mpi_flow->module~mod_kinds module~mod_mpi_flow->module~mod_mesh_types module~mod_mpi_flow->mpi_f08 module~mod_mpi_radiation->module~mod_kinds module~mod_mpi_radiation->mpi_f08 module~mod_output->module~mod_energy module~mod_output->module~mod_fields module~mod_output->module~mod_flow_projection module~mod_output->module~mod_input module~mod_output->module~mod_kinds module~mod_output->module~mod_mesh_types module~mod_output->module~mod_mpi_flow module~mod_output->module~mod_species module~mod_output->module~mod_transport_properties module~mod_profiler->module~mod_kinds module~mod_profiler->mpi_f08 module~mod_profiler->iso_fortran_env module~mod_species->module~mod_bc module~mod_species->module~mod_fields module~mod_species->module~mod_flow_projection module~mod_species->module~mod_input module~mod_species->module~mod_kinds module~mod_species->module~mod_mesh_types module~mod_species->module~mod_mpi_flow module~mod_species->module~mod_transport_properties module~mod_transport_properties->module~mod_input module~mod_transport_properties->module~mod_kinds module~mod_transport_properties->module~mod_mesh_types module~mod_transport_properties->module~mod_mpi_flow

Main entry point for the LowMachReact-Hex constant-density FV solver.

This program orchestrates the entire simulation lifecycle: 1. Initialization: Starts MPI, parses the case.nml namelist, and reads the mesh. 2. Domain Decomposition: Sets up the replicated mesh MPI ranks for flow and radiation. 3. Field Setup: Allocates and initializes velocity, pressure, species, and energy fields. 4. Time Integration Loop: Executes projection, species transport, and sensible-enthalpy transport. 5. Diagnostics & Output: Computes global observables and writes VTU/CSV files. 6. Finalization: Safely releases all allocated memory and shuts down MPI.


Calls

program~~lowmach_react_hex~~CallsGraph program~lowmach_react_hex lowmach_react_hex mpi_comm_rank mpi_comm_rank program~lowmach_react_hex->mpi_comm_rank mpi_wtime mpi_wtime program~lowmach_react_hex->mpi_wtime proc~advance_energy_transport mod_energy::advance_energy_transport program~lowmach_react_hex->proc~advance_energy_transport proc~advance_projection_step mod_flow_projection::advance_projection_step program~lowmach_react_hex->proc~advance_projection_step proc~advance_species_transport mod_species::advance_species_transport program~lowmach_react_hex->proc~advance_species_transport proc~build_bc_set mod_bc::build_bc_set program~lowmach_react_hex->proc~build_bc_set proc~compute_and_update_cfl mod_flow_projection::compute_and_update_cfl program~lowmach_react_hex->proc~compute_and_update_cfl proc~compute_flow_diagnostics mod_flow_projection::compute_flow_diagnostics program~lowmach_react_hex->proc~compute_flow_diagnostics proc~compute_global_observables lowmach_react_hex::compute_global_observables program~lowmach_react_hex->proc~compute_global_observables proc~fatal_error mod_kinds::fatal_error program~lowmach_react_hex->proc~fatal_error proc~finalize_bc_set mod_bc::finalize_bc_set program~lowmach_react_hex->proc~finalize_bc_set proc~finalize_energy mod_energy::finalize_energy program~lowmach_react_hex->proc~finalize_energy proc~finalize_fields mod_fields::finalize_fields program~lowmach_react_hex->proc~finalize_fields proc~finalize_species mod_species::finalize_species program~lowmach_react_hex->proc~finalize_species proc~finalize_transport mod_transport_properties::finalize_transport program~lowmach_react_hex->proc~finalize_transport proc~flow_mpi_finalize mod_mpi_flow::flow_mpi_finalize program~lowmach_react_hex->proc~flow_mpi_finalize proc~flow_mpi_initialize mod_mpi_flow::flow_mpi_initialize program~lowmach_react_hex->proc~flow_mpi_initialize proc~get_case_filename lowmach_react_hex::get_case_filename program~lowmach_react_hex->proc~get_case_filename proc~initialize_energy mod_energy::initialize_energy program~lowmach_react_hex->proc~initialize_energy proc~initialize_fields mod_fields::initialize_fields program~lowmach_react_hex->proc~initialize_fields proc~initialize_species mod_species::initialize_species program~lowmach_react_hex->proc~initialize_species proc~initialize_transport mod_transport_properties::initialize_transport program~lowmach_react_hex->proc~initialize_transport proc~mesh_finalize mod_mesh_types::mesh_finalize program~lowmach_react_hex->proc~mesh_finalize proc~mpi_flow_shutdown mod_mpi_flow::mpi_flow_shutdown program~lowmach_react_hex->proc~mpi_flow_shutdown proc~mpi_flow_startup mod_mpi_flow::mpi_flow_startup program~lowmach_react_hex->proc~mpi_flow_startup proc~prepare_output mod_output::prepare_output program~lowmach_react_hex->proc~prepare_output proc~profiler_configure mod_profiler::profiler_configure program~lowmach_react_hex->proc~profiler_configure proc~profiler_report mod_profiler::profiler_report program~lowmach_react_hex->proc~profiler_report proc~profiler_start mod_profiler::profiler_start program~lowmach_react_hex->proc~profiler_start proc~profiler_stop mod_profiler::profiler_stop program~lowmach_react_hex->proc~profiler_stop proc~radiation_mpi_finalize mod_mpi_radiation::radiation_mpi_finalize program~lowmach_react_hex->proc~radiation_mpi_finalize proc~radiation_mpi_initialize mod_mpi_radiation::radiation_mpi_initialize program~lowmach_react_hex->proc~radiation_mpi_initialize proc~read_case_params mod_input::read_case_params program~lowmach_react_hex->proc~read_case_params proc~read_native_mesh mod_mesh_io::read_native_mesh program~lowmach_react_hex->proc~read_native_mesh proc~update_transport_properties mod_transport_properties::update_transport_properties program~lowmach_react_hex->proc~update_transport_properties proc~write_diagnostics_header mod_output::write_diagnostics_header program~lowmach_react_hex->proc~write_diagnostics_header proc~write_diagnostics_row mod_output::write_diagnostics_row program~lowmach_react_hex->proc~write_diagnostics_row proc~write_energy_diagnostics_header mod_energy::write_energy_diagnostics_header program~lowmach_react_hex->proc~write_energy_diagnostics_header proc~write_energy_diagnostics_row mod_energy::write_energy_diagnostics_row program~lowmach_react_hex->proc~write_energy_diagnostics_row proc~write_mesh_summary mod_output::write_mesh_summary program~lowmach_react_hex->proc~write_mesh_summary proc~write_pvd_collection mod_output::write_pvd_collection program~lowmach_react_hex->proc~write_pvd_collection proc~write_vtu_unstructured mod_output::write_vtu_unstructured program~lowmach_react_hex->proc~write_vtu_unstructured proc~advance_energy_transport->proc~fatal_error proc~advance_energy_transport->proc~profiler_start proc~advance_energy_transport->proc~profiler_stop proc~boundary_enthalpy_from_temperature mod_energy::boundary_enthalpy_from_temperature proc~advance_energy_transport->proc~boundary_enthalpy_from_temperature proc~boundary_temperature mod_bc::boundary_temperature proc~advance_energy_transport->proc~boundary_temperature proc~build_boundary_thermo_y mod_energy::build_boundary_thermo_Y proc~advance_energy_transport->proc~build_boundary_thermo_y proc~energy_face_normal_distance mod_energy::energy_face_normal_distance proc~advance_energy_transport->proc~energy_face_normal_distance proc~face_effective_neighbor mod_bc::face_effective_neighbor proc~advance_energy_transport->proc~face_effective_neighbor proc~flow_exchange_cell_scalar mod_mpi_flow::flow_exchange_cell_scalar proc~advance_energy_transport->proc~flow_exchange_cell_scalar proc~recover_temperature_and_update_thermo_cantera mod_energy::recover_temperature_and_update_thermo_cantera proc~advance_energy_transport->proc~recover_temperature_and_update_thermo_cantera proc~recover_temperature_constant_cp mod_energy::recover_temperature_constant_cp proc~advance_energy_transport->proc~recover_temperature_constant_cp proc~advance_projection_step->proc~compute_flow_diagnostics proc~advance_projection_step->proc~profiler_start proc~advance_projection_step->proc~profiler_stop proc~advance_ab2 mod_flow_projection::advance_ab2 proc~advance_projection_step->proc~advance_ab2 proc~balance_neumann_outlet_flux mod_flow_projection::balance_neumann_outlet_flux proc~advance_projection_step->proc~balance_neumann_outlet_flux proc~compute_flux_divergence mod_flow_projection::compute_flux_divergence proc~advance_projection_step->proc~compute_flux_divergence proc~compute_momentum_rhs mod_flow_projection::compute_momentum_rhs proc~advance_projection_step->proc~compute_momentum_rhs proc~compute_predicted_face_flux mod_flow_projection::compute_predicted_face_flux proc~advance_projection_step->proc~compute_predicted_face_flux proc~correct_cell_velocity mod_flow_projection::correct_cell_velocity proc~advance_projection_step->proc~correct_cell_velocity proc~correct_face_flux mod_flow_projection::correct_face_flux proc~advance_projection_step->proc~correct_face_flux proc~ensure_pressure_operator_cache mod_flow_projection::ensure_pressure_operator_cache proc~advance_projection_step->proc~ensure_pressure_operator_cache proc~ensure_projection_workspace mod_flow_projection::ensure_projection_workspace proc~advance_projection_step->proc~ensure_projection_workspace proc~flow_exchange_cell_matrix mod_mpi_flow::flow_exchange_cell_matrix proc~advance_projection_step->proc~flow_exchange_cell_matrix proc~advance_projection_step->proc~flow_exchange_cell_scalar proc~flow_exchange_face_scalar mod_mpi_flow::flow_exchange_face_scalar proc~advance_projection_step->proc~flow_exchange_face_scalar proc~solve_pressure_correction mod_flow_projection::solve_pressure_correction proc~advance_projection_step->proc~solve_pressure_correction proc~boundary_species mod_bc::boundary_species proc~advance_species_transport->proc~boundary_species proc~advance_species_transport->proc~face_effective_neighbor proc~face_normal_distance mod_flow_projection::face_normal_distance proc~advance_species_transport->proc~face_normal_distance proc~advance_species_transport->proc~flow_exchange_cell_matrix proc~build_bc_set->proc~fatal_error proc~build_bc_set->proc~finalize_bc_set proc~ensure_periodic_links mod_bc::ensure_periodic_links proc~build_bc_set->proc~ensure_periodic_links proc~lowercase mod_kinds::lowercase proc~build_bc_set->proc~lowercase proc~parse_bc_type mod_bc::parse_bc_type proc~build_bc_set->proc~parse_bc_type mpi_allreduce mpi_allreduce proc~compute_and_update_cfl->mpi_allreduce proc~check_mpi mod_flow_projection::check_mpi proc~compute_and_update_cfl->proc~check_mpi proc~compute_flow_diagnostics->mpi_allreduce proc~compute_flow_diagnostics->proc~check_mpi proc~compute_boundary_flux mod_flow_projection::compute_boundary_flux proc~compute_flow_diagnostics->proc~compute_boundary_flux proc~flow_global_max_owned mod_mpi_flow::flow_global_max_owned proc~compute_flow_diagnostics->proc~flow_global_max_owned proc~compute_global_observables->mpi_allreduce mpi_comm_free mpi_comm_free proc~flow_mpi_finalize->mpi_comm_free proc~check_mpi~2 mod_mpi_flow::check_mpi proc~flow_mpi_finalize->proc~check_mpi~2 proc~flow_mpi_initialize->mpi_comm_rank proc~flow_mpi_initialize->proc~flow_mpi_finalize mpi_comm_dup mpi_comm_dup proc~flow_mpi_initialize->mpi_comm_dup mpi_comm_size mpi_comm_size proc~flow_mpi_initialize->mpi_comm_size proc~flow_mpi_initialize->proc~check_mpi~2 proc~setup_cell_halo mod_mpi_flow::setup_cell_halo proc~flow_mpi_initialize->proc~setup_cell_halo proc~setup_cell_owners mod_mpi_flow::setup_cell_owners proc~flow_mpi_initialize->proc~setup_cell_owners proc~setup_face_halo mod_mpi_flow::setup_face_halo proc~flow_mpi_initialize->proc~setup_face_halo proc~setup_owned_faces mod_mpi_flow::setup_owned_faces proc~flow_mpi_initialize->proc~setup_owned_faces proc~setup_owned_gather mod_mpi_flow::setup_owned_gather proc~flow_mpi_initialize->proc~setup_owned_gather proc~get_case_filename->proc~fatal_error proc~allocate_energy mod_energy::allocate_energy proc~initialize_energy->proc~allocate_energy proc~update_enthalpy_from_temperature_constant_cp mod_energy::update_enthalpy_from_temperature_constant_cp proc~initialize_energy->proc~update_enthalpy_from_temperature_constant_cp proc~update_thermo_from_temperature_cantera mod_energy::update_thermo_from_temperature_cantera proc~initialize_energy->proc~update_thermo_from_temperature_cantera proc~zero_radiation_source mod_energy::zero_radiation_source proc~initialize_energy->proc~zero_radiation_source proc~allocate_fields mod_fields::allocate_fields proc~initialize_fields->proc~allocate_fields proc~initialize_species->proc~finalize_species proc~initialize_species->proc~lowercase proc~initialize_cantera_wrapper mod_transport_properties::initialize_cantera_wrapper proc~initialize_transport->proc~initialize_cantera_wrapper mpi_finalize mpi_finalize proc~mpi_flow_shutdown->mpi_finalize mpi_finalized mpi_finalized proc~mpi_flow_shutdown->mpi_finalized mpi_init mpi_init proc~mpi_flow_startup->mpi_init mpi_initialized mpi_initialized proc~mpi_flow_startup->mpi_initialized proc~mpi_flow_startup->proc~check_mpi~2 proc~prepare_output->proc~fatal_error proc~profiler_reset mod_profiler::profiler_reset proc~profiler_configure->proc~profiler_reset proc~profiler_report->mpi_allreduce proc~check_mpi~3 mod_profiler::check_mpi proc~profiler_report->proc~check_mpi~3 proc~profiler_start->mpi_wtime proc~find_or_create_timer mod_profiler::find_or_create_timer proc~profiler_start->proc~find_or_create_timer proc~profiler_stop->mpi_wtime proc~profiler_stop->proc~find_or_create_timer proc~record_edge mod_profiler::record_edge proc~profiler_stop->proc~record_edge proc~radiation_mpi_finalize->mpi_comm_free proc~check_mpi~4 mod_mpi_radiation::check_mpi proc~radiation_mpi_finalize->proc~check_mpi~4 proc~radiation_mpi_initialize->mpi_comm_rank proc~radiation_mpi_initialize->proc~radiation_mpi_finalize proc~radiation_mpi_initialize->mpi_comm_dup proc~radiation_mpi_initialize->mpi_comm_size proc~radiation_mpi_initialize->proc~check_mpi~4 proc~radiation_task_bounds mod_mpi_radiation::radiation_task_bounds proc~radiation_mpi_initialize->proc~radiation_task_bounds proc~read_boundary_input mod_input::read_boundary_input proc~read_case_params->proc~read_boundary_input proc~read_energy_input mod_input::read_energy_input proc~read_case_params->proc~read_energy_input proc~read_fluid_input mod_input::read_fluid_input proc~read_case_params->proc~read_fluid_input proc~read_mesh_input mod_input::read_mesh_input proc~read_case_params->proc~read_mesh_input proc~read_output_input mod_input::read_output_input proc~read_case_params->proc~read_output_input proc~read_profiling_input mod_input::read_profiling_input proc~read_case_params->proc~read_profiling_input proc~read_solver_input mod_input::read_solver_input proc~read_case_params->proc~read_solver_input proc~read_species_input mod_input::read_species_input proc~read_case_params->proc~read_species_input proc~read_time_input mod_input::read_time_input proc~read_case_params->proc~read_time_input proc~validate_params mod_input::validate_params proc~read_case_params->proc~validate_params proc~read_native_mesh->proc~mesh_finalize proc~build_cell_faces mod_mesh_io::build_cell_faces proc~read_native_mesh->proc~build_cell_faces proc~read_cells mod_mesh_io::read_cells proc~read_native_mesh->proc~read_cells proc~read_faces mod_mesh_io::read_faces proc~read_native_mesh->proc~read_faces proc~read_patches mod_mesh_io::read_patches proc~read_native_mesh->proc~read_patches proc~read_periodic_optional mod_mesh_io::read_periodic_optional proc~read_native_mesh->proc~read_periodic_optional proc~read_points mod_mesh_io::read_points proc~read_native_mesh->proc~read_points proc~update_transport_properties->proc~fatal_error proc~update_transport_properties->proc~profiler_start proc~update_transport_properties->proc~profiler_stop interface~cantera_update_transport_c mod_transport_properties::cantera_update_transport_c proc~update_transport_properties->interface~cantera_update_transport_c proc~update_transport_properties->proc~flow_exchange_cell_matrix proc~update_transport_properties->proc~flow_exchange_cell_scalar proc~write_energy_diagnostics_row->proc~fatal_error proc~write_energy_diagnostics_row->mpi_allreduce proc~write_vtu_unstructured->proc~fatal_error proc~write_pvtu_master mod_output::write_pvtu_master proc~write_vtu_unstructured->proc~write_pvtu_master proc~allocate_energy->proc~finalize_energy proc~allocate_fields->proc~finalize_fields proc~balance_neumann_outlet_flux->proc~fatal_error proc~balance_neumann_outlet_flux->proc~profiler_start proc~balance_neumann_outlet_flux->proc~profiler_stop proc~balance_neumann_outlet_flux->mpi_allreduce proc~balance_neumann_outlet_flux->proc~check_mpi proc~patch_type_for_face mod_bc::patch_type_for_face proc~balance_neumann_outlet_flux->proc~patch_type_for_face proc~enthalpy_from_temperature_cantera_point mod_energy::enthalpy_from_temperature_cantera_point proc~boundary_enthalpy_from_temperature->proc~enthalpy_from_temperature_cantera_point proc~enthalpy_from_temperature_value mod_energy::enthalpy_from_temperature_value proc~boundary_enthalpy_from_temperature->proc~enthalpy_from_temperature_value proc~build_boundary_thermo_y->proc~fatal_error proc~build_boundary_thermo_y->proc~boundary_species proc~build_cell_faces->proc~fatal_error proc~append_cell_face mod_mesh_io::append_cell_face proc~build_cell_faces->proc~append_cell_face proc~check_mpi->proc~fatal_error proc~check_mpi~2->proc~fatal_error proc~check_mpi~4->proc~fatal_error proc~compute_boundary_flux->proc~patch_type_for_face proc~compute_momentum_rhs->proc~fatal_error proc~compute_momentum_rhs->proc~face_effective_neighbor proc~compute_momentum_rhs->proc~face_normal_distance proc~boundary_velocity mod_bc::boundary_velocity proc~compute_momentum_rhs->proc~boundary_velocity proc~face_linear_vector mod_flow_projection::face_linear_vector proc~compute_momentum_rhs->proc~face_linear_vector proc~outward_normal mod_flow_projection::outward_normal proc~compute_momentum_rhs->proc~outward_normal proc~pressure_gradient_cell mod_flow_projection::pressure_gradient_cell proc~compute_momentum_rhs->proc~pressure_gradient_cell proc~compute_predicted_face_flux->proc~face_effective_neighbor proc~compute_predicted_face_flux->proc~boundary_velocity proc~compute_predicted_face_flux->proc~face_linear_vector proc~correct_cell_velocity->proc~face_effective_neighbor proc~boundary_pressure_type mod_bc::boundary_pressure_type proc~correct_cell_velocity->proc~boundary_pressure_type proc~face_linear_scalar mod_flow_projection::face_linear_scalar proc~correct_cell_velocity->proc~face_linear_scalar proc~correct_cell_velocity->proc~outward_normal proc~correct_face_flux->proc~face_effective_neighbor proc~correct_face_flux->proc~face_normal_distance proc~correct_face_flux->proc~boundary_pressure_type proc~energy_face_normal_distance->proc~fatal_error proc~energy_outward_normal mod_energy::energy_outward_normal proc~energy_face_normal_distance->proc~energy_outward_normal proc~energy_face_normal_distance->proc~patch_type_for_face proc~ensure_periodic_links->proc~fatal_error proc~ensure_pressure_operator_cache->proc~fatal_error proc~ensure_pressure_operator_cache->mpi_allreduce proc~ensure_pressure_operator_cache->proc~face_effective_neighbor proc~ensure_pressure_operator_cache->proc~face_normal_distance proc~ensure_pressure_operator_cache->proc~boundary_pressure_type proc~finalize_flow_projection_workspace mod_flow_projection::finalize_flow_projection_workspace proc~ensure_pressure_operator_cache->proc~finalize_flow_projection_workspace proc~ensure_pressure_operator_cache->proc~patch_type_for_face proc~ensure_projection_workspace->proc~finalize_flow_projection_workspace proc~is_periodic_face mod_bc::is_periodic_face proc~face_effective_neighbor->proc~is_periodic_face proc~face_normal_distance->proc~fatal_error proc~face_normal_distance->proc~outward_normal proc~face_normal_distance->proc~patch_type_for_face proc~flow_exchange_cell_matrix->proc~fatal_error proc~flow_exchange_cell_matrix->proc~profiler_start proc~flow_exchange_cell_matrix->proc~profiler_stop proc~flow_exchange_cell_matrix->proc~check_mpi~2 mpi_irecv mpi_irecv proc~flow_exchange_cell_matrix->mpi_irecv mpi_isend mpi_isend proc~flow_exchange_cell_matrix->mpi_isend mpi_waitall mpi_waitall proc~flow_exchange_cell_matrix->mpi_waitall proc~flow_exchange_cell_scalar->proc~profiler_start proc~flow_exchange_cell_scalar->proc~profiler_stop proc~flow_exchange_cell_scalar->proc~check_mpi~2 proc~flow_exchange_cell_scalar->mpi_irecv proc~flow_exchange_cell_scalar->mpi_isend proc~flow_exchange_cell_scalar->mpi_waitall proc~flow_exchange_face_scalar->proc~profiler_start proc~flow_exchange_face_scalar->proc~profiler_stop proc~flow_exchange_face_scalar->proc~check_mpi~2 proc~flow_exchange_face_scalar->mpi_irecv proc~flow_exchange_face_scalar->mpi_isend proc~flow_exchange_face_scalar->mpi_waitall proc~flow_global_max_owned->proc~profiler_start proc~flow_global_max_owned->proc~profiler_stop proc~flow_global_max_owned->mpi_allreduce proc~flow_global_max_owned->proc~check_mpi~2 interface~cantera_get_species_count_c mod_transport_properties::cantera_get_species_count_c proc~initialize_cantera_wrapper->interface~cantera_get_species_count_c interface~cantera_get_species_name_c mod_transport_properties::cantera_get_species_name_c proc~initialize_cantera_wrapper->interface~cantera_get_species_name_c interface~cantera_init_c mod_transport_properties::cantera_init_c proc~initialize_cantera_wrapper->interface~cantera_init_c proc~parse_bc_type->proc~fatal_error proc~parse_bc_type->proc~lowercase proc~radiation_task_bounds->proc~fatal_error proc~read_boundary_input->proc~fatal_error proc~read_boundary_input->proc~lowercase proc~open_namelist_file mod_input::open_namelist_file proc~read_boundary_input->proc~open_namelist_file proc~read_cells->proc~fatal_error proc~read_energy_input->proc~fatal_error proc~read_energy_input->proc~open_namelist_file proc~read_faces->proc~fatal_error proc~read_fluid_input->proc~fatal_error proc~read_fluid_input->proc~open_namelist_file proc~read_mesh_input->proc~fatal_error proc~read_mesh_input->proc~open_namelist_file proc~read_output_input->proc~fatal_error proc~read_output_input->proc~open_namelist_file proc~read_patches->proc~fatal_error proc~read_periodic_optional->proc~fatal_error proc~read_points->proc~fatal_error proc~read_profiling_input->proc~fatal_error proc~read_profiling_input->proc~lowercase proc~read_solver_input->proc~fatal_error proc~read_solver_input->proc~lowercase proc~read_solver_input->proc~open_namelist_file proc~read_species_input->proc~fatal_error proc~read_species_input->proc~open_namelist_file proc~read_time_input->proc~fatal_error proc~read_time_input->proc~open_namelist_file proc~recover_temperature_and_update_thermo_cantera->proc~fatal_error interface~cantera_recover_temperature_and_update_thermo_c mod_energy::cantera_recover_temperature_and_update_thermo_c proc~recover_temperature_and_update_thermo_cantera->interface~cantera_recover_temperature_and_update_thermo_c proc~build_c_species_names mod_energy::build_c_species_names proc~recover_temperature_and_update_thermo_cantera->proc~build_c_species_names proc~build_thermo_y mod_energy::build_thermo_Y proc~recover_temperature_and_update_thermo_cantera->proc~build_thermo_y proc~recover_temperature_constant_cp->proc~fatal_error proc~mesh_neighbor_for_cell mod_mpi_flow::mesh_neighbor_for_cell proc~setup_cell_halo->proc~mesh_neighbor_for_cell proc~pack_rank_metadata mod_mpi_flow::pack_rank_metadata proc~setup_cell_halo->proc~pack_rank_metadata proc~prefix_counts mod_mpi_flow::prefix_counts proc~setup_cell_halo->proc~prefix_counts proc~setup_face_halo->proc~pack_rank_metadata proc~setup_face_halo->proc~prefix_counts proc~setup_owned_gather->proc~fatal_error proc~setup_owned_gather->proc~check_mpi~2 mpi_allgather mpi_allgather proc~setup_owned_gather->mpi_allgather proc~solve_pressure_correction->proc~ensure_pressure_operator_cache proc~solve_pressure_correction->proc~ensure_projection_workspace proc~solve_pressure_correction->proc~flow_exchange_cell_scalar proc~flow_global_dot_owned mod_mpi_flow::flow_global_dot_owned proc~solve_pressure_correction->proc~flow_global_dot_owned proc~flow_global_two_dots_owned mod_mpi_flow::flow_global_two_dots_owned proc~solve_pressure_correction->proc~flow_global_two_dots_owned proc~pressure_matvec mod_flow_projection::pressure_matvec proc~solve_pressure_correction->proc~pressure_matvec res res proc~solve_pressure_correction->res proc~update_enthalpy_from_temperature_constant_cp->proc~fatal_error proc~update_thermo_from_temperature_cantera->proc~fatal_error interface~cantera_update_thermo_c mod_energy::cantera_update_thermo_c proc~update_thermo_from_temperature_cantera->interface~cantera_update_thermo_c proc~update_thermo_from_temperature_cantera->proc~build_c_species_names proc~update_thermo_from_temperature_cantera->proc~build_thermo_y proc~validate_params->proc~fatal_error proc~validate_boundary_arrays mod_input::validate_boundary_arrays proc~validate_params->proc~validate_boundary_arrays proc~append_cell_face->proc~fatal_error proc~build_thermo_y->proc~fatal_error proc~enthalpy_from_temperature_cantera_point->proc~fatal_error proc~enthalpy_from_temperature_cantera_point->interface~cantera_update_thermo_c proc~enthalpy_from_temperature_cantera_point->proc~build_c_species_names proc~face_neighbor_weight mod_flow_projection::face_neighbor_weight proc~face_linear_scalar->proc~face_neighbor_weight proc~face_linear_vector->proc~face_neighbor_weight proc~flow_global_dot_owned->proc~profiler_start proc~flow_global_dot_owned->proc~profiler_stop proc~flow_global_dot_owned->mpi_allreduce proc~flow_global_dot_owned->proc~check_mpi~2 proc~flow_global_two_dots_owned->proc~profiler_start proc~flow_global_two_dots_owned->proc~profiler_stop proc~flow_global_two_dots_owned->mpi_allreduce proc~flow_global_two_dots_owned->proc~check_mpi~2 proc~is_periodic_face->proc~patch_type_for_face proc~pressure_gradient_cell->proc~face_effective_neighbor proc~pressure_gradient_cell->proc~boundary_pressure_type proc~pressure_gradient_cell->proc~face_linear_scalar proc~pressure_gradient_cell->proc~outward_normal proc~boundary_pressure mod_bc::boundary_pressure proc~pressure_gradient_cell->proc~boundary_pressure proc~pressure_matvec->proc~profiler_start proc~pressure_matvec->proc~profiler_stop proc~pressure_matvec->proc~ensure_pressure_operator_cache proc~validate_boundary_arrays->proc~fatal_error proc~face_neighbor_weight->proc~fatal_error proc~face_neighbor_weight->proc~outward_normal proc~face_neighbor_weight->proc~patch_type_for_face

Variables

Type Attributes Name Initial
type(bc_set_t) :: bc
character(len=256) :: case_file
logical :: do_output_step
type(energy_fields_t) :: energy
type(flow_fields_t) :: fields
type(flow_mpi_t) :: flow_mpi
integer :: ierr
type(mesh_t) :: mesh
type(case_params_t) :: params
type(radiation_mpi_t) :: rad_mpi
type(species_fields_t) :: species
type(solver_stats_t) :: stats
integer :: step
real(kind=rk) :: t0
real(kind=rk) :: time
type(transport_properties_t) :: transport
integer :: world_rank

Subroutines

subroutine compute_global_observables(mesh, flow, fields, species, transport, stats)

Computes global integral quantities for diagnostic reporting.

Read more…

Arguments

Type IntentOptional Attributes Name
type(mesh_t), intent(in) :: mesh
type(flow_mpi_t), intent(in) :: flow
type(flow_fields_t), intent(in) :: fields
type(species_fields_t), intent(in) :: species
type(transport_properties_t), intent(in) :: transport
type(solver_stats_t), intent(inout) :: stats

subroutine get_case_filename(filename)

Parses command line arguments to find the case configuration file.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(out) :: filename

Source Code

program lowmach_react_hex
   use mpi_f08
   use mod_kinds, only : rk, zero, one, output_unit, fatal_error
   use mod_input, only : case_params_t, read_case_params
   use mod_mesh_types, only : mesh_t, mesh_finalize
   use mod_mesh_io, only : read_native_mesh
   use mod_mpi_flow, only : flow_mpi_t, mpi_flow_startup, mpi_flow_shutdown, &
                            flow_mpi_initialize, flow_mpi_finalize
   use mod_mpi_radiation, only : radiation_mpi_t, radiation_mpi_initialize, &
                                 radiation_mpi_finalize
   use mod_bc, only : bc_set_t, build_bc_set, finalize_bc_set
   use mod_fields, only : flow_fields_t, initialize_fields, finalize_fields
   use mod_flow_projection, only : solver_stats_t, advance_projection_step, compute_flow_diagnostics, compute_and_update_cfl
   use mod_output, only : prepare_output, write_diagnostics_header, write_diagnostics_row, &
                          write_vtu_unstructured, write_mesh_summary, write_pvd_collection
   use mod_species, only : species_fields_t, initialize_species, finalize_species, &
                           advance_species_transport
   use mod_energy, only : energy_fields_t, initialize_energy, finalize_energy, &
                           advance_energy_transport, &
                           write_energy_diagnostics_header, write_energy_diagnostics_row
   use mod_transport_properties, only : transport_properties_t, initialize_transport, &
                                        finalize_transport, update_transport_properties
   use mod_profiler, only : profiler_start, profiler_stop, profiler_report, profiler_configure
   implicit none

   type(case_params_t) :: params    !< Parsed simulation parameters.
   type(mesh_t) :: mesh             !< Global computational mesh.
   type(flow_mpi_t) :: flow_mpi     !< MPI context for flow solver.
   type(radiation_mpi_t) :: rad_mpi !< MPI context for radiation solver.
   type(bc_set_t) :: bc             !< Boundary condition definitions.
   type(flow_fields_t) :: fields    !< Hydrodynamic fields (U, P).
   type(solver_stats_t) :: stats    !< Runtime diagnostics and solver performance metrics.
   type(species_fields_t) :: species !< Species mass fractions.
   type(energy_fields_t) :: energy   !< Enthalpy/temperature/radiation-source fields.
   type(transport_properties_t) :: transport !< Physical properties (rho, mu, Dk).

   character(len=256) :: case_file
   integer :: step, ierr, world_rank
   logical :: do_output_step
   real(rk) :: time, t0

   ! 1. Initialize MPI and read runtime configuration.
   call mpi_flow_startup()
   call MPI_Comm_rank(MPI_COMM_WORLD, world_rank, ierr)
   if (ierr /= MPI_SUCCESS) call fatal_error('main', 'MPI_Comm_rank failed')

   t0 = real(mpi_wtime(), rk)

   call get_case_filename(case_file)
   call read_case_params(trim(case_file), params)
   call profiler_configure(params%enable_profiling, params%nested_profiling)

   if (world_rank == 0) then
      write(output_unit,'(a,l1,a,l1)') 'profiling config: enable=', &
         params%enable_profiling, ' nested=', params%nested_profiling
   end if

   call profiler_start('Total_Simulation')

   ! 2. Setup simulation environment and read input data.
   call read_native_mesh(trim(params%mesh_dir), mesh)
   
   ! 3. Initialize parallel contexts.
   call initialize_transport(mesh, params, transport)
   call flow_mpi_initialize(mesh, flow_mpi, MPI_COMM_WORLD, max(4, params%nspecies))
   call radiation_mpi_initialize(rad_mpi, MPI_COMM_WORLD)
   
   ! 4. Prepare physical fields and BCs.
   call build_bc_set(mesh, params, bc)
   call initialize_fields(mesh, fields)
   if (params%enable_species) then
      call initialize_species(mesh, params, species)
   end if
   if (params%enable_energy) then
      if (params%enable_species) then
         call initialize_energy(mesh, params, energy, species%Y)
      else
         call initialize_energy(mesh, params, energy)
      end if
   end if

   if (flow_mpi%rank == 0 .and. params%enable_species) then
      print *, "species: ", species%nspecies
   end if

   ! 5. Setup output files.
   call prepare_output(params, flow_mpi)
   call write_mesh_summary(params, flow_mpi, mesh)
   call write_diagnostics_header(params, flow_mpi)
   call write_energy_diagnostics_header(params, flow_mpi)
   call write_pvd_collection(params, flow_mpi, params%nsteps, params%output_interval, params%dt)

   ! 6. Initial diagnostics and visualization snapshot.
   time = zero
   call compute_flow_diagnostics(mesh, flow_mpi, bc, params, fields, stats)
   call write_diagnostics_row(params, flow_mpi, 0, time, stats)
   call write_energy_diagnostics_row(mesh, flow_mpi, params, energy, 0, time)
   call write_vtu_unstructured(params, flow_mpi, mesh, fields, species, energy, transport, 0)

   if (flow_mpi%rank == 0) then
      write(output_unit,'(a)') 'LowMachReact-Hex hexahedral low-Mach FV solver'
      write(output_unit,'(a,a)') 'case: ', trim(case_file)
      write(output_unit,'(a,i0)') 'cells: ', mesh%ncells
      write(output_unit,'(a,i0)') 'flow/chemistry MPI ranks: ', flow_mpi%nprocs
      write(output_unit,'(a,i0)') 'radiation MPI ranks: ', rad_mpi%nprocs
      write(output_unit,'(a,es12.5,a)') 'Flow density mode: constant rho = ', params%rho, ' kg/m^3'
      if (params%enable_variable_nu) then
         write(output_unit,'(a)') 'Flow viscosity mode: variable Cantera mu/nu enabled'
      else
         write(output_unit,'(a,es12.5,a)') 'Flow viscosity mode: constant nu = ', params%nu, ' m^2/s'
      end if
      if (params%enable_energy .and. params%enable_cantera_thermo) then
         write(output_unit,'(a)') 'Cantera rho_thermo: diagnostic only, not used by projection'
      end if
      if (params%enable_cantera_fluid .or. params%enable_cantera_species) then
         write(output_unit,'(a,i0,a)') 'Cantera transport update interval: ', &
            params%transport_update_interval, ' step(s) [mu/D_k only]'
         if (params%enable_energy) then
            write(output_unit,'(a)') 'Cantera transport temperature source: energy%T'
         else
            write(output_unit,'(a,es12.5,a)') 'Cantera transport temperature source: background_temp = ', &
               params%background_temp, ' K'
         end if
      end if
      if (params%enable_energy .and. params%enable_cantera_thermo) then
         write(output_unit,'(a)') 'Cantera thermo update interval: every energy step'
         write(output_unit,'(a,es12.5,a)') 'Cantera thermodynamic pressure p0: ', &
            params%background_press, ' Pa'
      end if
   end if

   ! 7. Main Time-Stepping Loop
   do step = 1, params%nsteps
      do_output_step = (mod(step, params%output_interval) == 0) .or. step == params%nsteps

      ! A. Adaptive time-stepping / CFL diagnostics.
      ! Dynamic dt requires CFL every step. For fixed-dt runs, compute CFL only
      ! when diagnostics are written.
      if (params%use_dynamic_dt .or. do_output_step) then
         call profiler_start('CFL_Update')
         call compute_and_update_cfl(mesh, flow_mpi, params, fields, stats)
         call profiler_stop('CFL_Update')
      end if

      ! B. Dynamic transport-property update via Cantera.
      ! transport_update_interval gates Cantera mu/D_k refresh; enable_variable_nu controls whether mu affects flow; flow density remains params%rho.
      ! Cantera h/T thermo recovery remains inside the energy update path.
      if (mod(step-1, params%transport_update_interval) == 0 .or. step == 1) then
         call profiler_start('Transport_Update')
         if (params%enable_species) then
            if (params%enable_energy) then
               call update_transport_properties(mesh, flow_mpi, params, species%Y, transport, T_state=energy%T)
            else
               call update_transport_properties(mesh, flow_mpi, params, species%Y, transport)
            end if
         else
            if (params%enable_energy) then
               call update_transport_properties(mesh, flow_mpi, params, transport=transport, T_state=energy%T)
            else
               call update_transport_properties(mesh, flow_mpi, params, transport=transport)
            end if
         end if
         call profiler_stop('Transport_Update')
      end if
      
      ! C. Advance Momentum & Pressure (Projection Method).
      call profiler_start('Projection_Step')
      call advance_projection_step(mesh, flow_mpi, bc, params, transport, fields, stats)
      call profiler_stop('Projection_Step')
      
      ! D. Advance Species Transport.
      if (params%enable_species) then
         call profiler_start('Species_Transport')
         call advance_species_transport(mesh, flow_mpi, bc, params, fields, species, transport)
         call profiler_stop('Species_Transport')
      end if
      
      ! E. Advance passive sensible-enthalpy transport.
      if (params%enable_energy) then
         call profiler_start('Energy_Transport')
         if (params%enable_species) then
            call advance_energy_transport(mesh, flow_mpi, bc, params, fields, energy, species%Y)
         else
            call advance_energy_transport(mesh, flow_mpi, bc, params, fields, energy)
         end if
         call profiler_stop('Energy_Transport')
      end if
      
      time = time + params%dt

      ! E. Periodic Output and Diagnostics.
      if (do_output_step) then
         stats%wall_time = real(mpi_wtime(), rk) - t0
         call profiler_start('Flow_Diagnostics')
         call compute_global_observables(mesh, flow_mpi, fields, species, transport, stats)
         call profiler_stop('Flow_Diagnostics')

         call profiler_start('Diagnostics_Write_Flow')
         call write_diagnostics_row(params, flow_mpi, step, time, stats)
         call profiler_stop('Diagnostics_Write_Flow')

         if (params%enable_energy) then
            call profiler_start('Diagnostics_Write_Energy')
            call write_energy_diagnostics_row(mesh, flow_mpi, params, energy, step, time)
            call profiler_stop('Diagnostics_Write_Energy')
         end if

         call profiler_start('Output_Write_VTU')
         call write_vtu_unstructured(params, flow_mpi, mesh, fields, species, energy, transport, step)
         call profiler_stop('Output_Write_VTU')

         if (flow_mpi%rank == 0) then
            write(output_unit,'(a,i0,2x,a,es12.5,2x,a,f8.2,2x,a,es12.5,2x,a,es12.5,2x,a,es12.5,2x,a,es12.5,2x,a,i0,2x,a,es12.5)') &
               'step=', step, 'time=', time, 'clock=', stats%wall_time, 'dt=', params%dt, 'max_div=', stats%max_divergence, &
               'cfl=', stats%cfl, 'ke=', stats%kinetic_energy, 'piter=', stats%pressure_iterations, '|U|max=', stats%max_velocity
         end if
      end if
   end do

   ! 8. Clean up and finalize simulation.
   call finalize_bc_set(bc)
   call finalize_fields(fields)
   if (params%enable_species) then
      call finalize_species(species)
   end if
   if (params%enable_energy) then
      call finalize_energy(energy)
   end if
   call finalize_transport(transport)
   call mesh_finalize(mesh)

   call profiler_stop('Total_Simulation')
   call profiler_report(flow_mpi%comm, flow_mpi%rank, flow_mpi%nprocs)

   call radiation_mpi_finalize(rad_mpi)
   call flow_mpi_finalize(flow_mpi)
   call mpi_flow_shutdown()

contains

   !> Computes global integral quantities for diagnostic reporting.
   !!
   !! Performs Allreduce operations to find the maximum velocity magnitude, 
   !! total system mass, and minimum species mass fraction.
   subroutine compute_global_observables(mesh, flow, fields, species, transport, stats)
      type(mesh_t), intent(in) :: mesh
      type(flow_mpi_t), intent(in) :: flow
      type(flow_fields_t), intent(in) :: fields
      type(species_fields_t), intent(in) :: species
      type(transport_properties_t), intent(in) :: transport
      type(solver_stats_t), intent(inout) :: stats

      integer :: c
      real(rk) :: local_max_vel, local_min_y, local_total_mass
      real(rk) :: global_max_vel, global_min_y, global_total_mass
      real(rk) :: u, v, w, vel_mag

      local_max_vel = zero
      local_min_y = huge(one)
      local_total_mass = zero

      do c = 1, mesh%ncells
         if (.not. flow%owned(c)) cycle

         u = fields%u(1, c)
         v = fields%u(2, c)
         w = fields%u(3, c)
         vel_mag = sqrt(u**2 + v**2 + w**2)
         if (vel_mag > local_max_vel) local_max_vel = vel_mag

         local_total_mass = local_total_mass + (transport%rho(c) * mesh%cells(c)%volume)

         if (species%nspecies > 0) then
            local_min_y = min(local_min_y, minval(species%Y(:, c)))
         end if
      end do

      call MPI_Allreduce(local_max_vel, global_max_vel, 1, MPI_DOUBLE_PRECISION, MPI_MAX, flow%comm)
      call MPI_Allreduce(local_total_mass, global_total_mass, 1, MPI_DOUBLE_PRECISION, MPI_SUM, flow%comm)
      
      if (species%nspecies > 0) then
         call MPI_Allreduce(local_min_y, global_min_y, 1, MPI_DOUBLE_PRECISION, MPI_MIN, flow%comm)
      else
         global_min_y = zero
      end if

      stats%max_velocity = global_max_vel
      stats%total_mass = global_total_mass
      stats%min_species_y = global_min_y

   end subroutine compute_global_observables


   !> Parses command line arguments to find the case configuration file.
   !!
   !! If no argument is provided, defaults to `case.nml`.
   subroutine get_case_filename(filename)
      character(len=*), intent(out) :: filename

      integer :: argc

      argc = command_argument_count()
      if (argc >= 1) then
         call get_command_argument(1, filename)
      else
         filename = 'case.nml'
      end if

      if (len_trim(filename) == 0) call fatal_error('main', 'empty case filename')
   end subroutine get_case_filename

end program lowmach_react_hex