main_loop Subroutine

subroutine main_loop()

Main loop

Arguments

None

Calls

proc~~main_loop~~CallsGraph proc~main_loop main_loop proc~boundary_resolution_from_and_to_ports boundary_resolution_from_and_to_ports proc~main_loop->proc~boundary_resolution_from_and_to_ports proc~channels_ff_flux_port_comm channels_FF_flux_port_comm proc~main_loop->proc~channels_ff_flux_port_comm proc~channels_to_ff_src_port_comm channels_to_FF_src_port_comm proc~main_loop->proc~channels_to_ff_src_port_comm proc~circulator_resolution_from_and_to_ports circulator_resolution_from_and_to_ports proc~main_loop->proc~circulator_resolution_from_and_to_ports proc~explicit_scheme_for_fluxes_channel explicit_scheme_for_fluxes_channel proc~main_loop->proc~explicit_scheme_for_fluxes_channel proc~explicit_scheme_for_fluxes_solid explicit_scheme_for_fluxes_solid proc~main_loop->proc~explicit_scheme_for_fluxes_solid proc~explicit_scheme_for_fluxes_strand explicit_scheme_for_fluxes_strand proc~main_loop->proc~explicit_scheme_for_fluxes_strand proc~ff_src_port_to_channels_comm FF_src_port_to_channels_comm proc~main_loop->proc~ff_src_port_to_channels_comm proc~ffsrclink_prelax_resolution_from_and_to_ports FFsrcLink_Prelax_resolution_from_and_to_ports proc~main_loop->proc~ffsrclink_prelax_resolution_from_and_to_ports proc~ffsrclink_resolution_from_and_to_ports FFsrcLink_resolution_from_and_to_ports proc~main_loop->proc~ffsrclink_resolution_from_and_to_ports proc~flux_from_ff_flux_ports_self flux_from_FF_flux_ports_self proc~main_loop->proc~flux_from_ff_flux_ports_self proc~flux_from_ss_flux_ports_self flux_from_SS_flux_ports_self proc~main_loop->proc~flux_from_ss_flux_ports_self proc~friction_source_term friction_source_term proc~main_loop->proc~friction_source_term proc~from_sol_to_prim_channel from_sol_to_prim_channel proc~main_loop->proc~from_sol_to_prim_channel proc~from_sol_to_temp_mesh2d from_sol_to_temp_mesh2D proc~main_loop->proc~from_sol_to_temp_mesh2d proc~from_sol_to_temp_solid from_sol_to_temp_solid proc~main_loop->proc~from_sol_to_temp_solid proc~from_sol_to_temp_strand from_sol_to_temp_strand proc~main_loop->proc~from_sol_to_temp_strand proc~fslink_resolution_from_and_to_ports FSlink_resolution_from_and_to_ports proc~main_loop->proc~fslink_resolution_from_and_to_ports proc~fslink_src_reinitialization FSlink_src_reinitialization proc~main_loop->proc~fslink_src_reinitialization proc~full_physics_definition_channel full_physics_definition_channel proc~main_loop->proc~full_physics_definition_channel proc~full_physics_definition_mesh2d full_physics_definition_mesh2D proc~main_loop->proc~full_physics_definition_mesh2d proc~full_physics_definition_solid full_physics_definition_solid proc~main_loop->proc~full_physics_definition_solid proc~full_physics_definition_strand full_physics_definition_strand proc~main_loop->proc~full_physics_definition_strand proc~handle_numerical_error handle_numerical_error proc~main_loop->proc~handle_numerical_error proc~he_riemann_solver_channel He_Riemann_solver_channel proc~main_loop->proc~he_riemann_solver_channel proc~heat_diffusion_mesh2d heat_diffusion_mesh2D proc~main_loop->proc~heat_diffusion_mesh2d proc~heat_diffusion_solid heat_diffusion_solid proc~main_loop->proc~heat_diffusion_solid proc~heat_diffusion_strand heat_diffusion_strand proc~main_loop->proc~heat_diffusion_strand proc~junction_resolution_from_and_to_ports Junction_resolution_from_and_to_ports proc~main_loop->proc~junction_resolution_from_and_to_ports proc~last_tasks_for_channels last_tasks_for_channels proc~main_loop->proc~last_tasks_for_channels proc~links_circulator_update links_circulator_update proc~main_loop->proc~links_circulator_update proc~links_ffsrclink_update links_FFsrcLink_update proc~main_loop->proc~links_ffsrclink_update proc~links_fslink_update links_FSlink_update proc~main_loop->proc~links_fslink_update proc~links_junction_update links_junction_update proc~main_loop->proc~links_junction_update proc~links_ssfluxlink_update links_SSfluxLink_update proc~main_loop->proc~links_ssfluxlink_update proc~links_sssrclink_update links_SSsrcLink_update proc~main_loop->proc~links_sssrclink_update proc~mesh2ds_fs_port_comm mesh2Ds_FS_port_comm proc~main_loop->proc~mesh2ds_fs_port_comm proc~mesh2ds_ss_src_port_comm mesh2Ds_SS_src_port_comm proc~main_loop->proc~mesh2ds_ss_src_port_comm proc~pardiso_fact_solve Pardiso_fact_solve proc~main_loop->proc~pardiso_fact_solve proc~scenario_update scenario_update proc~main_loop->proc~scenario_update proc~sim_step_management simulation_t%sim_step_management proc~main_loop->proc~sim_step_management proc~sim_update_exp_dt simulation_t%sim_update_exp_dt proc~main_loop->proc~sim_update_exp_dt proc~solid_scenario_update solid_scenario_update proc~main_loop->proc~solid_scenario_update proc~source_from_ff_src_ports_self_channel source_from_FF_src_ports_self_channel proc~main_loop->proc~source_from_ff_src_ports_self_channel proc~source_from_fs_ports_self_channel source_from_FS_ports_self_channel proc~main_loop->proc~source_from_fs_ports_self_channel proc~source_from_fs_ports_self_mesh2d source_from_FS_ports_self_mesh2D proc~main_loop->proc~source_from_fs_ports_self_mesh2d proc~source_from_fs_ports_self_solid source_from_FS_ports_self_solid proc~main_loop->proc~source_from_fs_ports_self_solid proc~source_from_fs_ports_self_strand source_from_FS_ports_self_strand proc~main_loop->proc~source_from_fs_ports_self_strand proc~source_from_ss_src_ports_self_mesh2d source_from_SS_src_ports_self_mesh2D proc~main_loop->proc~source_from_ss_src_ports_self_mesh2d proc~source_from_ss_src_ports_self_solid source_from_SS_src_ports_self_solid proc~main_loop->proc~source_from_ss_src_ports_self_solid proc~source_term_definition_channel source_term_definition_channel proc~main_loop->proc~source_term_definition_channel proc~source_term_definition_solid source_term_definition_solid proc~main_loop->proc~source_term_definition_solid proc~source_term_definition_strand source_term_definition_strand proc~main_loop->proc~source_term_definition_strand proc~ssfluxlink_resolution_from_and_to_ports SSfluxLink_resolution_from_and_to_ports proc~main_loop->proc~ssfluxlink_resolution_from_and_to_ports proc~sssrclink_resolution_from_and_to_ports SSsrcLink_resolution_from_and_to_ports proc~main_loop->proc~sssrclink_resolution_from_and_to_ports proc~sssrclink_src_reinitialization SSsrcLink_src_reinitialization proc~main_loop->proc~sssrclink_src_reinitialization proc~strands_ss_flux_port_comm strands_SS_flux_port_comm proc~main_loop->proc~strands_ss_flux_port_comm proc~timer_set timer_t%timer_set proc~main_loop->proc~timer_set proc~writing_hdf5_2d_casing writing_HDF5_2D_casing proc~main_loop->proc~writing_hdf5_2d_casing proc~solve_boundary_mt solve_boundary_MT proc~boundary_resolution_from_and_to_ports->proc~solve_boundary_mt proc~solve_boundary_pt solve_boundary_PT proc~boundary_resolution_from_and_to_ports->proc~solve_boundary_pt proc~imposed_mass_flow_rate imposed_mass_flow_rate proc~circulator_resolution_from_and_to_ports->proc~imposed_mass_flow_rate proc~incoming_branch_cold_circulator incoming_branch_cold_circulator proc~circulator_resolution_from_and_to_ports->proc~incoming_branch_cold_circulator proc~mdot_derivatives mdot_derivatives proc~circulator_resolution_from_and_to_ports->proc~mdot_derivatives proc~outgoing_branch_cold_circulator outgoing_branch_cold_circulator proc~circulator_resolution_from_and_to_ports->proc~outgoing_branch_cold_circulator proc~material_heat_capacity material_t%material_heat_capacity proc~explicit_scheme_for_fluxes_solid->proc~material_heat_capacity proc~material_critical_current_density material_t%material_critical_current_density proc~explicit_scheme_for_fluxes_strand->proc~material_critical_current_density proc~material_critical_field material_t%material_critical_field proc~explicit_scheme_for_fluxes_strand->proc~material_critical_field proc~material_critical_temperature material_t%material_critical_temperature proc~explicit_scheme_for_fluxes_strand->proc~material_critical_temperature proc~material_current_sharing_temperature material_t%material_current_sharing_temperature proc~explicit_scheme_for_fluxes_strand->proc~material_current_sharing_temperature proc~explicit_scheme_for_fluxes_strand->proc~material_heat_capacity proc~material_strain material_t%material_strain proc~explicit_scheme_for_fluxes_strand->proc~material_strain proc~he_prop he_prop proc~ffsrclink_prelax_resolution_from_and_to_ports->proc~he_prop proc~state_rot state_roT proc~ffsrclink_prelax_resolution_from_and_to_ports->proc~state_rot proc~t_rop T_roP proc~ffsrclink_prelax_resolution_from_and_to_ports->proc~t_rop proc~nusselt_correlation nusselt_t%nusselt_correlation proc~ffsrclink_resolution_from_and_to_ports->proc~nusselt_correlation proc~nusselt_correlation_der_pra nusselt_t%nusselt_correlation_der_Pra proc~ffsrclink_resolution_from_and_to_ports->proc~nusselt_correlation_der_pra proc~nusselt_correlation_der_re nusselt_t%nusselt_correlation_der_Re proc~ffsrclink_resolution_from_and_to_ports->proc~nusselt_correlation_der_re proc~nusselt_correlation_der_t nusselt_t%nusselt_correlation_der_T proc~ffsrclink_resolution_from_and_to_ports->proc~nusselt_correlation_der_t proc~nusselt_correlation_der_tother nusselt_t%nusselt_correlation_der_Tother proc~ffsrclink_resolution_from_and_to_ports->proc~nusselt_correlation_der_tother proc~der_friction_factor_laminar der_friction_factor_laminar proc~friction_source_term->proc~der_friction_factor_laminar proc~friction_correlation friction_t%friction_correlation proc~friction_source_term->proc~friction_correlation proc~friction_correlation_der friction_t%friction_correlation_der proc~friction_source_term->proc~friction_correlation_der proc~friction_factor_laminar friction_factor_laminar proc~friction_source_term->proc~friction_factor_laminar proc~friction_source_term->proc~he_prop proc~jacobian_rot jacobian_roT proc~friction_source_term->proc~jacobian_rot proc~state_roe state_roE proc~friction_source_term->proc~state_roe proc~state_roe_withr state_roE_withR proc~friction_source_term->proc~state_roe_withr proc~set_error set_error proc~from_sol_to_prim_channel->proc~set_error proc~from_sol_to_prim_channel->proc~state_roe proc~from_sol_to_prim_channel->proc~state_roe_withr proc~from_sol_to_temp_strand->proc~material_critical_current_density proc~from_sol_to_temp_strand->proc~material_critical_field proc~from_sol_to_temp_strand->proc~material_critical_temperature proc~from_sol_to_temp_strand->proc~material_current_sharing_temperature proc~from_sol_to_temp_strand->proc~material_strain proc~fslink_resolution_from_and_to_ports->proc~nusselt_correlation proc~fslink_resolution_from_and_to_ports->proc~nusselt_correlation_der_pra proc~fslink_resolution_from_and_to_ports->proc~nusselt_correlation_der_re proc~fslink_resolution_from_and_to_ports->proc~nusselt_correlation_der_t proc~fslink_resolution_from_and_to_ports->proc~nusselt_correlation_der_tother proc~full_physics_definition_channel->proc~source_term_definition_channel proc~dc2_rot dc2_roT proc~full_physics_definition_channel->proc~dc2_rot proc~full_physics_definition_mesh2d->proc~material_heat_capacity proc~material_heat_capacity_der material_t%material_heat_capacity_der proc~full_physics_definition_mesh2d->proc~material_heat_capacity_der proc~signal_v0d signal_t%signal_v0d proc~full_physics_definition_mesh2d->proc~signal_v0d proc~full_physics_definition_solid->proc~source_term_definition_solid proc~full_physics_definition_solid->proc~material_heat_capacity proc~full_physics_definition_solid->proc~material_heat_capacity_der proc~full_physics_definition_strand->proc~source_term_definition_strand proc~full_physics_definition_strand->proc~material_critical_current_density proc~full_physics_definition_strand->proc~material_critical_field proc~full_physics_definition_strand->proc~material_critical_temperature proc~full_physics_definition_strand->proc~material_current_sharing_temperature proc~full_physics_definition_strand->proc~material_heat_capacity proc~full_physics_definition_strand->proc~material_heat_capacity_der proc~full_physics_definition_strand->proc~material_strain proc~close_hdf5_files close_hdf5_files proc~handle_numerical_error->proc~close_hdf5_files proc~flux_internal_calculation_channel flux_internal_calculation_channel proc~he_riemann_solver_channel->proc~flux_internal_calculation_channel proc~jacobian_channel jacobian_channel proc~he_riemann_solver_channel->proc~jacobian_channel proc~jacobian_channel_req_rem jacobian_channel_Req_rem proc~he_riemann_solver_channel->proc~jacobian_channel_req_rem proc~states_l_and_r_channel states_L_and_R_channel proc~he_riemann_solver_channel->proc~states_l_and_r_channel proc~required_variables_for_implicit_2d_heat_diffusion required_variables_for_implicit_2D_heat_diffusion proc~heat_diffusion_mesh2d->proc~required_variables_for_implicit_2d_heat_diffusion proc~s_heat_flux_internal_calculation S_heat_flux_internal_calculation proc~heat_diffusion_solid->proc~s_heat_flux_internal_calculation proc~s_heat_flux_internal_calculation~2 S_heat_flux_internal_calculation proc~heat_diffusion_strand->proc~s_heat_flux_internal_calculation~2 proc~junction_resolution_from_and_to_ports->proc~set_error proc~solve_junction solve_junction proc~junction_resolution_from_and_to_ports->proc~solve_junction proc~last_tasks_for_channels->proc~state_rot proc~accumulate accumulate proc~links_ffsrclink_update->proc~accumulate proc~mesh2ds_fs_port_comm->proc~material_heat_capacity proc~mesh2ds_fs_port_comm->proc~material_heat_capacity_der proc~material_thermal_conductivity material_t%material_thermal_conductivity proc~mesh2ds_fs_port_comm->proc~material_thermal_conductivity proc~material_thermal_conductivity_der material_t%material_thermal_conductivity_der proc~mesh2ds_fs_port_comm->proc~material_thermal_conductivity_der proc~mesh2ds_ss_src_port_comm->proc~material_heat_capacity proc~mesh2ds_ss_src_port_comm->proc~material_heat_capacity_der proc~mesh2ds_ss_src_port_comm->proc~material_thermal_conductivity proc~mesh2ds_ss_src_port_comm->proc~material_thermal_conductivity_der proc~pardiso_fact_solve->proc~timer_set pardiso pardiso proc~pardiso_fact_solve->pardiso pardisoinit pardisoinit proc~pardiso_fact_solve->pardisoinit proc~from_ptr_arr from_ptr_arr proc~pardiso_fact_solve->proc~from_ptr_arr proc~pardiso_fact_solve->proc~set_error proc~compute_effective_field compute_effective_field proc~scenario_update->proc~compute_effective_field proc~scenario_update->proc~signal_v0d proc~signal_v1d signal_t%signal_v1d proc~scenario_update->proc~signal_v1d proc~filter filter proc~sim_step_management->proc~filter proc~sim_step_management->proc~signal_v0d proc~sim_print sim_print proc~sim_step_management->proc~sim_print proc~solid_scenario_update->proc~signal_v1d proc~source_term_definition_channel->proc~signal_v1d proc~sourceterms_notfriction_channel SourceTerms_NOTfriction_channel proc~source_term_definition_channel->proc~sourceterms_notfriction_channel proc~source_term_definition_solid->proc~material_heat_capacity proc~source_term_definition_solid->proc~material_heat_capacity_der proc~source_term_definition_solid->proc~material_thermal_conductivity proc~source_term_definition_solid->proc~material_thermal_conductivity_der proc~solid_source_terms solid_source_terms proc~source_term_definition_strand->proc~solid_source_terms proc~sssrclink_resolution_from_and_to_ports->proc~material_thermal_conductivity proc~strands_ss_flux_port_comm->proc~material_critical_current_density proc~strands_ss_flux_port_comm->proc~material_critical_field proc~strands_ss_flux_port_comm->proc~material_critical_temperature proc~strands_ss_flux_port_comm->proc~material_current_sharing_temperature proc~strands_ss_flux_port_comm->proc~material_heat_capacity proc~strands_ss_flux_port_comm->proc~material_strain proc~strands_ss_flux_port_comm->proc~material_thermal_conductivity proc~strands_ss_flux_port_comm->proc~material_thermal_conductivity_der h5aclose_f h5aclose_f proc~writing_hdf5_2d_casing->h5aclose_f h5acreate_f h5acreate_f proc~writing_hdf5_2d_casing->h5acreate_f h5awrite_f h5awrite_f proc~writing_hdf5_2d_casing->h5awrite_f h5dcreate_f h5dcreate_f proc~writing_hdf5_2d_casing->h5dcreate_f h5dwrite_f h5dwrite_f proc~writing_hdf5_2d_casing->h5dwrite_f h5fcreate_f h5fcreate_f proc~writing_hdf5_2d_casing->h5fcreate_f h5gclose_f h5gclose_f proc~writing_hdf5_2d_casing->h5gclose_f h5gcreate_f h5gcreate_f proc~writing_hdf5_2d_casing->h5gcreate_f h5sclose_f h5sclose_f proc~writing_hdf5_2d_casing->h5sclose_f h5screate_f h5screate_f proc~writing_hdf5_2d_casing->h5screate_f h5screate_simple_f h5screate_simple_f proc~writing_hdf5_2d_casing->h5screate_simple_f h5tcopy_f h5tcopy_f proc~writing_hdf5_2d_casing->h5tcopy_f h5tset_size_f h5tset_size_f proc~writing_hdf5_2d_casing->h5tset_size_f h5fclose_f h5fclose_f proc~close_hdf5_files->h5fclose_f proc~additional_data_hdf5_2d_casing additional_data_HDF5_2D_casing proc~close_hdf5_files->proc~additional_data_hdf5_2d_casing proc~compute_effective_field->proc~material_critical_current_density proc~compute_effective_field->proc~material_critical_field proc~compute_effective_field->proc~material_critical_temperature proc~compute_effective_field->proc~material_strain proc~compute_effective_field->proc~set_error dfloat dfloat proc~compute_effective_field->dfloat proc~eos_terms eos_terms proc~dc2_rot->proc~eos_terms proc~flux_internal_calculation_channel->proc~set_error proc~wave_speed_calculation_channel wave_speed_calculation_channel proc~flux_internal_calculation_channel->proc~wave_speed_calculation_channel proc~he_prop->proc~jacobian_rot proc~he_prop->proc~set_error proc~incoming_branch_cold_circulator->proc~jacobian_rot proc~hhh_derivatives HHH_derivatives proc~incoming_branch_cold_circulator->proc~hhh_derivatives proc~imposed_compression_energy imposed_compression_energy proc~incoming_branch_cold_circulator->proc~imposed_compression_energy proc~jacobian_star jacobian_star proc~incoming_branch_cold_circulator->proc~jacobian_star proc~jacobian_star_req_rem jacobian_star_Req_rem proc~incoming_branch_cold_circulator->proc~jacobian_star_req_rem proc~state_rop state_roP proc~incoming_branch_cold_circulator->proc~state_rop proc~jacobian_channel_req_rem->proc~jacobian_rot proc~jacobian_rot->proc~eos_terms proc~mdot_derivatives->proc~jacobian_rot proc~outgoing_branch_cold_circulator->proc~dc2_rot proc~outgoing_branch_cold_circulator->proc~jacobian_rot proc~outgoing_branch_cold_circulator->proc~set_error proc~outgoing_branch_cold_circulator->proc~t_rop proc~circulator_dynamic_parameters_df circulator_dynamic_parameters_t%circulator_dynamic_parameters_df proc~outgoing_branch_cold_circulator->proc~circulator_dynamic_parameters_df proc~circulator_dynamic_parameters_f circulator_dynamic_parameters_t%circulator_dynamic_parameters_f proc~outgoing_branch_cold_circulator->proc~circulator_dynamic_parameters_f proc~outgoing_branch_cold_circulator->proc~jacobian_star proc~outgoing_branch_cold_circulator->proc~jacobian_star_req_rem proc~outgoing_branch_cold_circulator->proc~state_rop proc~zero zero proc~outgoing_branch_cold_circulator->proc~zero proc~required_variables_for_implicit_2d_heat_diffusion->proc~material_thermal_conductivity proc~required_variables_for_implicit_2d_heat_diffusion->proc~material_thermal_conductivity_der proc~required_variables_for_implicit_2d_heat_diffusion->proc~signal_v0d proc~s_heat_flux_internal_calculation->proc~material_thermal_conductivity proc~s_heat_flux_internal_calculation->proc~material_thermal_conductivity_der proc~s_heat_flux_internal_calculation~2->proc~material_thermal_conductivity proc~s_heat_flux_internal_calculation~2->proc~material_thermal_conductivity_der proc~signal_v0d->proc~signal_v1d interface~to_str to_str proc~sim_print->interface~to_str proc~s_to_str s_to_str proc~sim_print->proc~s_to_str proc~solid_source_terms->proc~material_critical_current_density proc~solid_source_terms->proc~material_critical_field proc~solid_source_terms->proc~material_critical_temperature proc~solid_source_terms->proc~material_current_sharing_temperature proc~solid_source_terms->proc~material_heat_capacity proc~solid_source_terms->proc~material_heat_capacity_der proc~solid_source_terms->proc~material_strain proc~solid_source_terms->proc~set_error proc~material_critical_current_density_der material_t%material_critical_current_density_der proc~solid_source_terms->proc~material_critical_current_density_der proc~material_resistivity material_t%material_resistivity proc~solid_source_terms->proc~material_resistivity proc~material_resistivity_der material_t%material_resistivity_der proc~solid_source_terms->proc~material_resistivity_der proc~supercond_current supercond_current proc~solid_source_terms->proc~supercond_current proc~solve_boundary_mt->proc~dc2_rot proc~solve_boundary_mt->proc~jacobian_rot proc~solve_boundary_mt->proc~set_error proc~solve_boundary_mt->proc~signal_v0d proc~solve_boundary_mt->proc~t_rop proc~function_of_pstar_mt function_of_pstar_MT proc~solve_boundary_mt->proc~function_of_pstar_mt proc~jacobian_star_req_rem~2 jacobian_star_Req_rem proc~solve_boundary_mt->proc~jacobian_star_req_rem~2 proc~jacobian_star~2 jacobian_star proc~solve_boundary_mt->proc~jacobian_star~2 proc~solve_boundary_mt->proc~state_rop proc~solve_boundary_pt->proc~dc2_rot proc~solve_boundary_pt->proc~jacobian_rot proc~solve_boundary_pt->proc~set_error proc~solve_boundary_pt->proc~signal_v0d proc~solve_boundary_pt->proc~state_rot proc~derivative_function_of_pstar_pt derivative_function_of_pstar_PT proc~solve_boundary_pt->proc~derivative_function_of_pstar_pt proc~derustar_acoustic derUstar_acoustic proc~solve_boundary_pt->proc~derustar_acoustic proc~function_of_pstar_pt function_of_pstar_PT proc~solve_boundary_pt->proc~function_of_pstar_pt proc~hugoniot_star_state hugoniot_star_state proc~solve_boundary_pt->proc~hugoniot_star_state proc~solve_boundary_pt->proc~jacobian_star_req_rem~2 proc~solve_boundary_pt->proc~jacobian_star~2 proc~ro_pt ro_pT proc~solve_boundary_pt->proc~ro_pt proc~solve_boundary_pt->proc~state_rop proc~state_rop_withr state_roP_withR proc~solve_boundary_pt->proc~state_rop_withr proc~solve_junction->proc~jacobian_rot proc~solve_junction->proc~set_error proc~droeint_drop droeint_droP proc~solve_junction->proc~droeint_drop proc~fsolve fsolve proc~solve_junction->proc~fsolve proc~inv inv proc~solve_junction->proc~inv proc~jacobian_star_loc jacobian_star_loc proc~solve_junction->proc~jacobian_star_loc proc~jacobian_star_req_rem_loc jacobian_star_Req_rem_loc proc~solve_junction->proc~jacobian_star_req_rem_loc proc~r_rot r_roT proc~solve_junction->proc~r_rot proc~solve_junction->proc~state_rop proc~t_roe T_roE proc~solve_junction->proc~t_roe proc~sourceterms_notfriction_channel->proc~he_prop proc~sourceterms_notfriction_channel->proc~jacobian_rot proc~sourceterms_notfriction_channel->proc~nusselt_correlation proc~sourceterms_notfriction_channel->proc~nusselt_correlation_der_pra proc~sourceterms_notfriction_channel->proc~nusselt_correlation_der_re proc~sourceterms_notfriction_channel->proc~nusselt_correlation_der_t proc~sourceterms_notfriction_channel->proc~state_roe proc~sourceterms_notfriction_channel->proc~state_roe_withr proc~state_roe->proc~jacobian_rot proc~state_roe->proc~t_roe proc~state_roe_withr->proc~jacobian_rot proc~state_roe_withr->proc~t_rop proc~state_rot->proc~jacobian_rot proc~brent brent proc~t_rop->proc~brent proc~fill_f_terms fill_f_terms proc~t_rop->proc~fill_f_terms proc~fill_g_dreg_terms fill_g_Dreg_terms proc~t_rop->proc~fill_g_dreg_terms proc~str_from_int str_from_int interface~to_str->proc~str_from_int proc~str_from_real str_from_real interface~to_str->proc~str_from_real proc~additional_data_hdf5_2d_casing->h5dcreate_f proc~additional_data_hdf5_2d_casing->h5dwrite_f proc~additional_data_hdf5_2d_casing->h5sclose_f proc~additional_data_hdf5_2d_casing->h5screate_simple_f proc~brent->proc~set_error proc~brent->proc~zero f f proc~brent->f proc~circulator_dynamic_parameters_df->proc~jacobian_rot proc~circulator_dynamic_parameters_df->proc~t_rop proc~circulator_dynamic_parameters_f->proc~state_rop proc~derivative_function_of_pstar_pt->proc~jacobian_rot proc~derivative_function_of_pstar_pt->proc~t_rop proc~droeint_drop->proc~t_rop proc~droeint_drop->proc~eos_terms proc~eos_terms->proc~fill_f_terms proc~eos_e_terms eos_e_terms proc~eos_terms->proc~eos_e_terms proc~hybrd hybrd proc~fsolve->proc~hybrd proc~function_of_pstar_mt->proc~t_rop proc~function_of_pstar_pt->proc~state_rop proc~hhh_derivatives->proc~jacobian_rot proc~hugoniot_star_state->proc~set_error proc~hugoniot_star_state->proc~droeint_drop proc~hugoniot_star_state->proc~zero proc~inv->proc~set_error dgetrf dgetrf proc~inv->dgetrf dgetri dgetri proc~inv->dgetri proc~jacobian_star_req_rem->proc~jacobian_rot proc~jacobian_star_req_rem_loc->proc~jacobian_rot proc~jacobian_star_req_rem~2->proc~jacobian_rot proc~r_rot->proc~fill_f_terms proc~r_rot->proc~fill_g_dreg_terms proc~fill_ff_terms fill_ff_terms proc~r_rot->proc~fill_ff_terms proc~ro_pt->proc~brent proc~state_rop->proc~jacobian_rot proc~state_rop->proc~t_rop proc~state_rop_withr->proc~jacobian_rot proc~state_rop_withr->proc~t_rop proc~supercond_current->proc~set_error float float proc~supercond_current->float proc~t_roe->proc~brent proc~fill_e_tpart fill_e_Tpart proc~t_roe->proc~fill_e_tpart proc~t_roe->proc~fill_ff_terms proc~zero->f proc~eos_e_terms->proc~fill_e_tpart proc~eos_e_terms->proc~fill_ff_terms proc~fill_e_tpart->proc~fill_g_dreg_terms fcn fcn proc~hybrd->fcn proc~dogleg dogleg proc~hybrd->proc~dogleg proc~enorm eNorm proc~hybrd->proc~enorm proc~fdjac1 fdJac1 proc~hybrd->proc~fdjac1 proc~qform qform proc~hybrd->proc~qform proc~qrfac qrFac proc~hybrd->proc~qrfac proc~r1mpyq r1mpyq proc~hybrd->proc~r1mpyq proc~r1updt r1updt proc~hybrd->proc~r1updt proc~dogleg->proc~enorm proc~fdjac1->fcn proc~qrfac->proc~enorm

Called by

proc~~main_loop~~CalledByGraph proc~main_loop main_loop program~reims_p reims_p program~reims_p->proc~main_loop

Source Code

subroutine main_loop() !! Main loop
    real(dp) :: error_val

    call timer%set(9,description='Main loop start')
    if(sim%rollback) then ! Rollback in progress: state already set, skip state advance
        sim%rollback = .false.
        h5%steps_to_revert = 3
    else if(sim%rejected) then ! Retrieve previous state
        channels%StVar       = channels%StVarOld
        strands%StVar     = strands%StVarOld
        solids%StVar      = solids%StVarOld
        mesh2Ds%StVar     = mesh2Ds%StVarOld
    else                  ! Advance state variables
        channels%StVarOld6   = channels%StVarOld5
        channels%StVarOld5   = channels%StVarOld4
        channels%StVarOld4   = channels%StVarOld3
        channels%StVarOld3   = channels%StVarOld2
        channels%StVarOld2   = channels%StVarOld
        channels%StVarOld    = channels%StVar
        strands%StVarOld6 = strands%StVarOld5
        strands%StVarOld5 = strands%StVarOld4
        strands%StVarOld4 = strands%StVarOld3
        strands%StVarOld3 = strands%StVarOld2
        strands%StVarOld2 = strands%StVarOld
        strands%StVarOld  = strands%StVar
        solids%StVarOld6  = solids%StVarOld5
        solids%StVarOld5  = solids%StVarOld4
        solids%StVarOld4  = solids%StVarOld3
        solids%StVarOld3  = solids%StVarOld2
        solids%StVarOld2  = solids%StVarOld
        solids%StVarOld   = solids%StVar
        mesh2Ds%StVarOld6 = mesh2Ds%StVarOld5
        mesh2Ds%StVarOld5 = mesh2Ds%StVarOld4
        mesh2Ds%StVarOld4 = mesh2Ds%StVarOld3
        mesh2Ds%StVarOld3 = mesh2Ds%StVarOld2
        mesh2Ds%StVarOld2 = mesh2Ds%StVarOld
        mesh2Ds%StVarOld  = mesh2Ds%StVar
    endif

    ! Qext_Check_step=0.0_dp

    !$omp parallel do private(i)
        do i=1, size(channels)
            call friction_source_term(channels(i))
            call channels_FF_flux_port_comm(channels(i))
        enddo
    !$omp end parallel do
    if (handle_numerical_error()) return
    !$omp parallel do private(i)
        do i=1, size(junctions)
            call junction_resolution_from_and_to_ports(junctions(i))
        enddo
    !$omp end parallel do
    if (handle_numerical_error()) return
    do i=1, size(circulators)
        call circulator_resolution_from_and_to_ports(circulators(i))
    enddo
    if (handle_numerical_error()) return
    do i=1, size(boundaries)
        call boundary_resolution_from_and_to_ports(boundaries(i))
    enddo
    if (handle_numerical_error()) return
    !$omp parallel do private(i)
        do i=1, size(channels)
            call He_Riemann_solver_channel(channels(i),sim)
            call flux_from_FF_flux_ports_self(channels(i))
        enddo
    !$omp end parallel do
    if (handle_numerical_error()) return
    !$omp parallel do private(i)
        do i=1, size(strands)
            call scenario_update(strands(i),sim)
            call strands_SS_flux_port_comm(strands(i))
        enddo
    !$omp end parallel do
    if (handle_numerical_error()) return
    !$omp parallel do private(i)
        do i=1, size(solids)
            call solid_scenario_update(solids(i))
        enddo
    !$omp end parallel do
    !$omp parallel do private(i)
        do i=1, size(SSfluxLinks)
            call SSfluxLink_resolution_from_and_to_ports(SSfluxLinks(i))
        enddo
    !$omp end parallel do
    !$omp parallel do private(i)
        do i=1, size(strands)
            call heat_diffusion_strand(strands(i))
            call flux_from_SS_flux_ports_self(strands(i))
        enddo
    !$omp end parallel do
    !$omp parallel do private(i)
        do i=1, size(solids)
            call heat_diffusion_solid(solids(i))
        enddo
    !$omp end parallel do
    !$omp parallel do private(i)
        do i=1, size(mesh2Ds)
            call heat_diffusion_mesh2D(mesh2Ds(i),sim)
            call mesh2Ds_FS_port_comm(mesh2Ds(i))
            call mesh2Ds_SS_src_port_comm(mesh2Ds(i))
        enddo
    !$omp end parallel do

    ! Calculation of minimal time for wave propagation through the node
    ! and updating explicit step
    call sim%update_exp_dt( min( &
        minVal(channels%wave_time), &
        minVal(junctions%wave_time), &
        minVal(circulators%wave_time), &
        minVal(boundaries%wave_time)))

    call timer%set(10,9,'Fluxes + Riemann')
    call timer%set(11)
    if(sim%explicit) then
        ! explicit fluxes / implicit source terms ------------------------------
        !print*,'Explicit scheme at physical time',sim%t,'(in s)'

        !$omp parallel do private(i)
            do i=1,size(channels)
                call explicit_scheme_for_fluxes_channel(channels(i),sim%dt)
                call friction_source_term(channels(i))
                call source_term_definition_channel(channels(i),sim)
            enddo
        !$omp end parallel do
        if (handle_numerical_error()) return
        !$omp parallel do private(i)
            do i=1,size(strands)
                call explicit_scheme_for_fluxes_strand(strands(i),sim%dt)
                call source_term_definition_strand(strands(i),sim) !,Qext_Check_step)   ! Attention in case of parallelization --> Qext_Check
            enddo
        !$omp end parallel do
        if (handle_numerical_error()) return
        !$omp parallel do private(i)
            do i=1,size(solids)
                call explicit_scheme_for_fluxes_solid(solids(i),sim%dt)
                call source_term_definition_solid(solids(i),sim)
            enddo
        !$omp end parallel do
    else ! full implicit -------------------------------------------------------
        !$omp parallel do private(i)
            do i=1,size(channels)
                call full_physics_definition_channel(channels(i),sim)
            enddo
        !$omp end parallel do
        if (handle_numerical_error()) return
        !$omp parallel do private(i)
            do i=1,size(strands)
                call full_physics_definition_strand(strands(i),sim) !,Qext_Check_step)
            enddo
        !$omp end parallel do
        if (handle_numerical_error()) return  
        !$omp parallel do private(i)                      
            do i=1,size(solids)
                call full_physics_definition_solid(solids(i),sim)
            enddo
        !$omp end parallel do
        !$omp parallel do private(i)
            do i=1,size(junctions)
                call links_junction_update(junctions(i),sim%dt)
            enddo
        !$omp end parallel do
        do i=1,size(circulators)
            call links_circulator_update(circulators(i),sim%dt)
        enddo
        !$omp parallel do private(i)
            do i=1,size(SSfluxLinks)
                call links_SSfluxLink_update(SSfluxLinks(i),sim%dt)
            enddo
        !$omp end parallel do
    endif ! --------------------------------------------------------------------

    ! Qext_Check_case_step=0.0_dp
    !$omp parallel do private(i)
        do i=1,size(mesh2Ds)
            ! SurfReg=0.0_dp
            ! do nb_e=1,mesh2Ds(i)%M2D_Prop%nb_elements
            !     if(trim(mesh2Ds(i)%M2D_Prop%elem(nb_e)%PhysE)=='SS_Outer') then
            !         SurfReg=SurfReg+mesh2Ds(i)%M2D_Prop%elem(nb_e)%surface
            !     endif
            ! enddo
            call full_physics_definition_mesh2D(mesh2Ds(i),sim) !,Qext_Check_case_loc)       
            ! Qext_Check_case_step = Qext_Check_case_step + Qext_Check_case_loc * SurfReg * 1.062_dp
        enddo
    !$omp end parallel do

    !$omp parallel do private(i)
        do i=1, size(FSlinks)
            call FSlink_src_reinitialization(FSlinks(i))
        enddo
    !$omp end parallel do
    !$omp parallel do private(i)
        do i=1, size(FSlinks)
            call FSlink_resolution_from_and_to_ports(FSlinks(i))
            call links_FSlink_update(FSlinks(i),sim%dt)
        enddo
    !$omp end parallel do
    !$omp parallel do private(i)
        do i=1, size(channels)
            call source_from_FS_ports_self_channel(channels(i),sim%dt)
        enddo
    !$omp end parallel do
    !$omp parallel do private(i)
        do i=1, size(strands)
            call source_from_FS_ports_self_strand(strands(i),sim%dt)
        enddo
    !$omp end parallel do
    !$omp parallel do private(i)
        do i=1, size(solids)
            call source_from_FS_ports_self_solid(solids(i),sim%dt)
        enddo
    !$omp end parallel do
    !$omp parallel do private(i)
        do i=1, size(mesh2Ds)
            call source_from_FS_ports_self_mesh2D(mesh2Ds(i),sim%dt)
        enddo
    !$omp end parallel do

    !$omp parallel do private(i)
        do i=1, size(SSsrcLinks)
            call SSsrcLink_src_reinitialization(SSsrcLinks(i))
        enddo
    !$omp end parallel do
    !$omp parallel do private(i)
        do i=1, size(SSsrcLinks)
            call SSsrcLink_resolution_from_and_to_ports(SSsrcLinks(i))
            call links_SSsrcLink_update(SSsrcLinks(i),sim%dt)
        enddo
    !$omp end parallel do
    !$omp parallel do private(i)
        do i=1, size(solids)
            call source_from_SS_src_ports_self_solid(solids(i),sim%dt)
        enddo
    !$omp end parallel do
    !$omp parallel do private(i)
        do i=1, size(mesh2Ds)
            call source_from_SS_src_ports_self_mesh2D(mesh2Ds(i),sim%dt)
        enddo
    !$omp end parallel do

    !$omp parallel do private(i)
        do i=1, size(FFsrcLinks)
            call FFsrcLink_resolution_from_and_to_ports(FFsrcLinks(i))
            call links_FFsrcLink_update(FFsrcLinks(i),sim%dt)
        enddo
    !$omp end parallel do
    !$omp parallel do private(i)
        do i=1, size(channels)
            call source_from_FF_src_ports_self_channel(channels(i),sim%dt)
        enddo
    !$omp end parallel do
    if (handle_numerical_error()) return

    ! ---------------------- L I N E A R   S O L V E R -------------------------
    call Pardiso_fact_solve(krn,sim%explicit,timer)
    if (handle_numerical_error()) return
    ! --------------------------------------------------------------------------
    call timer%set(12)

    !$omp parallel do private(i)
        do i=1,size(channels)
            call from_sol_to_prim_channel(channels(i))
        enddo
    !$omp end parallel do
    if (handle_numerical_error()) return
    !$omp parallel do private(i)
        do i=1,size(strands)
            call from_sol_to_temp_strand(strands(i),sim)
        enddo
    !$omp end parallel do
    !$omp parallel do private(i)
        do i=1,size(solids)
            call from_sol_to_temp_solid(solids(i),sim)
        enddo
    !$omp end parallel do
    !$omp parallel do private(i)
        do i=1,size(mesh2Ds)
            call from_sol_to_temp_mesh2D(mesh2Ds(i),sim)
        enddo
    !$omp end parallel do
    !$omp parallel do private(i)
        do i=1,size(channels)
            call channels_to_FF_src_port_comm(channels(i))
        enddo
    !$omp end parallel do
    !$omp parallel do private(i)
        do i=1, size(FFsrcLinks)
            call FFsrcLink_Prelax_resolution_from_and_to_ports(FFsrcLinks(i))
        enddo
    !$omp end parallel do
    !$omp parallel do private(i)
        do i=1,size(channels)
            call FF_src_port_to_channels_comm(channels(i))
            call last_tasks_for_channels(channels(i),sim)
        enddo
    !$omp end parallel do

    if (handle_numerical_error()) return

    if(sim%explicit) then
        ! pressure criteria for switching to implicit
        error_val = maxVal(sqrt(channels%err) / max(1.0e-6_dp, sqrt(channels%err_den)))
    else; error_val = &
        ! compute local truncation error (lte) - energy calculation as
        ! criteria for implicit step
        sqrt(sum(channels%err))   / max(sqrt(sum(channels%err_den)),   sim_delta) + &
        sqrt(sum(strands%err)) / max(sqrt(sum(strands%err_den)), sim_delta) + &
        sqrt(sum(solids%err))  / max(sqrt(sum(solids%err_den)),  sim_delta) + &
        sqrt(sum(mesh2Ds%err)) / max(sqrt(sum(mesh2Ds%err_den)), sim_delta)
    endif
    call timer%set(13,12,'Solution distribution')

    call sim%step_management(error_val)
    if(.not.sim%rejected) call h5%write(sim%t,sim%dt,sim%t_final)
    if(h5%write_results2D .and. .not.sim%rejected) then
        if(sim%t >= next2DWriteTime) then
            step2D = step2D + 1
            do i=1,size(mesh2Ds)
                call writing_HDF5_2D_casing(mesh2Ds(i),sim%t,step2D)
            enddo
            next2DWriteTime = next2DWriteTime + h5%time_btw_2D_writes
        endif
    endif

    ! if(.not.sim%rejected) then
    !   mDotHOut = channels(1)%flxHe%Cons(Con_Ene,15) * channels(1)%HeProp%Area
    !   mDotHin  = channels(1)%flxHe%Cons(Con_Ene,5)*channels(1)%HeProp%Area
    !   checkMDotHDt = checkMDotHDt + (mDotHOut-mDotHin)*sim%dt
    !   write(132,'(4(e13.6,1x))') sim%t, FullEnergy_MC, FullEnergy_2D, -checkMDotHDt

    !   Qext_Check = Qext_Check + Qext_Check_step
    !   write(133,'(2(e13.6,1x))') sim%t, Qext_Check

    !   Qext_Check_case = Qext_Check_case + Qext_Check_case_step
    !   write(133,'(2(e13.6,1x))') sim%t, Qext_Check_case

    !   do i=1,size(solids)
    !       do ii=1,solids(i)%MC_Prop%NbCells
    !           if(abs(solids(i)%StVarOld%MCtemp(ii))>1.0e-10_dp) then
    !               Q_MC = Q_MC + solids(i)%MC_Prop%ro_M * solids(i)%MC_Prop%volLoc(ii) * &
    !                             (CpSS_Integral(solids(i)%StVar%MCtemp(ii)) - CpSS_Integral(solids(i)%StVarOld%MCtemp(ii)))
    !               if(i==1) then
    !                   Q_MC1 = Q_MC1 + solids(i)%MC_Prop%ro_M * solids(i)%MC_Prop%volLoc(ii) * &
    !                             (CpSS_Integral(solids(i)%StVar%MCtemp(ii)) - CpSS_Integral(solids(i)%StVarOld%MCtemp(ii)))
    !               else if(i==2) then
    !                   Q_MC2 = Q_MC2 + solids(i)%MC_Prop%ro_M * solids(i)%MC_Prop%volLoc(ii) * &
    !                   (CpSS_Integral(solids(i)%StVar%MCtemp(ii)) - CpSS_Integral(solids(i)%StVarOld%MCtemp(ii)))
    !               endif
    !           endif
    !       enddo
    !   enddo
    !   do i=1,size(mesh2Ds)
    !       do ii=1,mesh2Ds(i)%M2D_Prop%nb_elements
    !           if(abs(mesh2Ds(i)%StVarOld%temp(ii))>1.0e-10_dp) then
    !               Q_2D = Q_2D + 7900.0_dp * mesh2Ds(i)%M2D_Prop%elem(ii)%surface * 0.5_dp * &   ! 0.5_dp for 0.5m of contact with MC
    !                             (CpSS_Integral(mesh2Ds(i)%StVar%temp(ii)) - CpSS_Integral(mesh2Ds(i)%StVarOld%temp(ii)))
    !           endif
    !       enddo
    !   enddo
    !   write(134,'(9(e13.6,1x))') sim%t, Q_MC, Q_MC1, Q_MC2, Q_2D
    ! endif

end subroutine main_loop