Simulator WorkFlow

Here are shown some graphs of the ALFAsim simulator workflow. In those graphs, it is possible to identify when the Solver Hooks are called during the simulation. Some of them, like Hydrodynamic Solver and Tracer Solver, have their graphs expanded to make it possible to see more internal hooks.

Main Overview

digraph { nodesep = 0.6; newrank=true node [fillcolor="#FAAC2C" style="rounded, filled" color="#FAAC2C" fontcolor="#ffffff"] edge [color="#8699A3" fontcolor="#2c3e50"] init [label="Initialize Simulation"] end [label="End of Simulation"] node [shape=point, width=0] invisible_point hook_initialize_point [peripheries="2"] hook_finalize_point [peripheries="2"] time [fixedsize=true, label="Time Step", width="1.0", shape="circle"]; decision [label="Final \n Time?", shape="diamond", fixedsize=true, width=2.0, height=1.0, labelcolor="#8699A3", style="filled"] node[shape="rectangular", target="_top"] config [label="Solver Configuration"] hyd_solver [label="Hydrodynamic Solver", URL="../07_workflow.html#hydrodynamic-solver"] tracer_solver [label="Tracer Solver" URL="../07_workflow.html#tracer-solver"] output [label="Output Variables"] node[peripheries="0" shape="cds", color="#DA5961", fontcolor="#DA5961", style=""] hook_initialize [ label="HOOK_INITIALIZE", URL="../06_solver_hooks.html#_alfasim_sdk.hook_specs.initialize"] hook_finalize [label="HOOK_FINALIZE", URL="../06_solver_hooks.html#_alfasim_sdk.hook_specs.finalize"] {rank = same; hook_initialize_point; hook_initialize} {rank = same; hook_finalize_point; hook_finalize; } {rank=same; time;tracer_solver} {rank=same; invisible_point;hyd_solver} init -> config; config -> hook_initialize_point [arrowhead= none]; hook_initialize_point -> invisible_point [arrowhead=none]; hook_initialize_point -> hook_initialize [style=dotted, color="#DA5961"]; subgraph cluster_a{ label="Transient Solver" style="dashed, rounded" shape="reactangular" color="#8699A3" fontcolor="#2c3e50" labeljust="l" invisible_point -> time; time:ne -> hyd_solver:w [style=dashed]; hyd_solver -> tracer_solver [weight=1000]; tracer_solver -> output [weight=1000]; output:nw -> time:se [style=dashed]; time:s -> decision:n [weight=10]; decision:w -> time:sw [label="No"]; } decision -> hook_finalize_point [arrowhead= none, label="Yes"]; hook_finalize_point -> hook_finalize [style=dotted, color="#DA5961"]; hook_finalize_point -> end; }

Hydrodynamic Solver

digraph { nodesep = 0.6; newrank=true; node [fillcolor="#FAAC2C", style="rounded, filled", color="#FAAC2C", fontcolor="#ffffff", target="_top"] edge [color="#8699A3", fontcolor="#2c3e50"] hydrodynamic_1 [label="Primary Variables \n (Solver Unknowns)"] hydrodynamic_2 [label="Calculate \n State Variables" URL="../07_workflow.html#state-variable-calculator"] hydrodynamic_3 [label="Calculate \n Secondary Variables"] hydrodynamic_4 [label="Calculate \n Source Terms"] invisible_init [shape=point, style=invis] invisible_end [shape=point, style=invis] hook_update_variables_point [shape = point, width = 0, peripheries="2"] hook_calculate_source_terms_point [shape = point, width = 0, peripheries="2" ] // Align Hooks node[peripheries="0", shape="cds", color="#DA5961", fontcolor="#DA5961", style=""] hook_update_variables [label="HOOK_UPDATE_PLUGINS_SECONDARY_VARIABLES", URL="../06_solver_hooks.html#_alfasim_sdk.hook_specs.update_plugins_secondary_variables"] hook_calculate_mass_source_terms [label="HOOK_CALCULATE_MASS_SOURCE_TERM", URL="../06_solver_hooks.html#_alfasim_sdk.hook_specs.calculate_mass_source_term"] hook_calculate_momentum_source_terms [label="HOOK_CALCULATE_MOMENTUM_SOURCE_TERM", URL="../06_solver_hooks.html#_alfasim_sdk.hook_specs.calculate_momentum_source_term"] hook_calculate_energy_source_terms [label="HOOK_CALCULATE_ENERGY_SOURCE_TERM", URL="../06_solver_hooks.html#_alfasim_sdk.hook_specs.calculate_energy_source_term"] {rank = same; hook_update_variables_point; hook_update_variables } {rank = same; hook_calculate_source_terms_point; hook_calculate_momentum_source_terms; } invisible_init -> hydrodynamic_1 hook_calculate_source_terms_point -> invisible_end ; // Align all hooks hook_calculate_mass_source_terms -> hook_calculate_momentum_source_terms -> hook_calculate_energy_source_terms [constraint=true, style=invis] subgraph cluster1{ labeljust="l" style="rounded, dashed" color="#8699A3" hydrodynamic_1 -> hydrodynamic_2 -> hydrodynamic_3 hydrodynamic_3 -> hook_update_variables_point [arrowhead=none, ltail=cluster1] hook_update_variables_point -> hydrodynamic_4 hydrodynamic_4 -> hook_calculate_source_terms_point [arrowhead=none] } hook_update_variables_point -> hook_update_variables [constraint=false, style=dotted, color="#DA5961"] hook_calculate_source_terms_point -> hook_calculate_mass_source_terms:w [constraint=false, style=dotted, color="#DA5961"] hook_calculate_source_terms_point -> hook_calculate_momentum_source_terms [constraint=false, style=dotted, color="#DA5961"] hook_calculate_source_terms_point -> hook_calculate_energy_source_terms:w [constraint=false, style=dotted, color="#DA5961"] // Align Notes subgraph cluster2{ labeljust="l" style="rounded, dashed" fontcolor="#2c3e50" color="#8699A3" node[shape=box, color="#FAAC2C",fillcolor="#FFFFFF", fontcolor="#FAAC2C", peripheries="1" shape="rectangular"] note_1 [label="α, P, U, T"] note_2 [label="ρ, μ, Cₚ, ... = ƒ(P,T)"] note_3 [label="Mass Flow Rate, Flow Pattern ..."] } {rank=same; hydrodynamic_1; note_1} {rank=same; hydrodynamic_2; note_2} {rank=same; hydrodynamic_3; note_3} note_1->note_2->note_3[ style = invis ] edge[arrowhead=none, style=dashed, constraint=false,] hydrodynamic_1 -> note_1 hydrodynamic_2 -> note_2 hydrodynamic_3 -> note_3 }

State Variable Calculator

digraph { newrank=true nodesep=0.7 node [fillcolor="#FAAC2C" style="rounded, filled" color="#FAAC2C" fontcolor="#ffffff" shape="rectangular"] edge [ color="#8699A3" fontcolor="#2c3e50" ] node_1 [label="Calculate State Variables \n for ALFAsim Phases"] node_2 [label="Setup"] node_3 [label="Calculate State Variables"] node_4 [label="Calculate Phase Pair \n State Variables \n (Surface Tension)"] node_5 [label="Finalize"] loop_1 [fixedsize=true, label="Phases Set \n By Plugins", width="1.2", shape="circle"] node [shape=point style=invis width=0] invisible_init invisible_end invisible_1 invisible_2 invisible_3 node[peripheries="0" shape="cds", color="#DA5961", fontcolor="#DA5961" , style="" target="_top" fontsize=10] hook_initialize_state_variables_calculator [label=" HOOK_INITIALIZE_STATE_VARIABLES_CALCULATOR" URL="../06_solver_hooks.html#_alfasim_sdk.hook_specs.initialize_state_variables_calculator"] hook_calculate_state_variable [label=" HOOK_CALCULATE_STATE_VARIABLE", URL="../06_solver_hooks.html#_alfasim_sdk.hook_specs.calculate_state_variable"] hook_calculate_phase_pair_state_variable [label=" HOOK_CALCULATE_PHASE_PAIR_STATE_VARIABLE", URL="../06_solver_hooks.html#_alfasim_sdk.hook_specs.calculate_phase_pair_state_variable"] hook_finalize_state_variables_calculator [label=" HOOK_FINALIZE_STATE_VARIABLES_CALCULATOR" URL="../06_solver_hooks.html#_alfasim_sdk.hook_specs.finalize_state_variables_calculator"] {rank = same node_2 hook_initialize_state_variables_calculator } {rank = same node_3 hook_calculate_state_variable } {rank = same node_4 hook_calculate_phase_pair_state_variable} {rank = same node_5 hook_finalize_state_variables_calculator } {rank=same loop_1 node_3} invisible_init -> node_1 subgraph cluster1{ label="" labeljust="l" style="rounded, dashed" color="#8699A3" node_2->node_3->node_4->node_5 [weight=9999] loop_1:ne -> node_2:w [style=dashed] node_5:w -> loop_1:se [style=dashed] invisible_1 -> loop_1 [weight=9999] edge[arrowhead=none style=normal] node_1 -> invisible_1 [weight=9999] loop_1 -> invisible_2 invisible_2 -> invisible_3 } invisible_3 -> invisible_end edge[constraint=false, style=dotted, color="#DA5961"] node_2 -> hook_initialize_state_variables_calculator node_3 -> hook_calculate_state_variable node_4 -> hook_calculate_phase_pair_state_variable node_5 -> hook_finalize_state_variables_calculator }

Tracer Solver

digraph { nodesep = 0.7 newrank=true node [fillcolor="#FAAC2C" style="rounded, filled" color="#FAAC2C" fontcolor="#ffffff" shape="rectangular"] edge [ color="#8699A3" fontcolor="#2c3e50" ] tracer_1 [label="Primary Variables \n (Solver Unknowns, ϕ) "] tracer_2 [label="Calculate \n Secondary Variables"] tracer_3 [label="Calculate \n Source Terms"] invisible_init [shape=point, style=invis] invisible_end [shape=point, style=invis] node[shape = point, width = 0, peripheries="2" ] hook_initialize_user_defined_tracer_point hook_set_bc_user_defined_tracer_point hook_update_variables_point hook_calculate_source_terms_point node[peripheries="0" shape="cds", color="#DA5961", fontcolor="#DA5961" , style="" target="_top" fontsize=10] hook_initialize_user_defined_tracer [label=" HOOK_INITIALIZE_MASS_FRACTION_OF_TRACER" URL="../06_solver_hooks.html#_alfasim_sdk.hook_specs.initialize_mass_fraction_of_tracer"] hook_set_bc_user_defined_tracer [label=" HOOK_SET_PRESCRIBED_BOUNDARY_CONDITION_OF_MASS_FRACTION_OF_TRACER", URL="../06_solver_hooks.html#_alfasim_sdk.hook_specs.set_prescribed_boundary_condition_of_mass_fraction_of_tracer"] hook_update_variables [label=" HOOK_UPDATE_PLUGINS_SECONDARY_VARIABLES_ON_TRACER_SOLVER", URL="../06_solver_hooks.html#_alfasim_sdk.hook_specs.update_plugins_secondary_variables_on_tracer_solver"] hook_calculate_tracer_source_terms [label=" HOOK_CALCULATE_TRACER_SOURCE_TERM" URL="../06_solver_hooks.html#_alfasim_sdk.hook_specs.calculate_tracer_source_term"] hook_update_bc_user_defined_tracer [label=" HOOK_UPDATE_BOUNDARY_CONDITION_OF_MASS_FRACTION_OF_TRACER" URL="../06_solver_hooks.html#_alfasim_sdk.hook_specs.update_boundary_condition_of_mass_fraction_of_tracer"] hook_calculate_mass_fraction_of_tracer_in_field [label=" HOOK_CALCULATE_MASS_FRACTION_OF_TRACER_IN_FIELD \n HOOK_CALCULATE_MASS_FRACTION_OF_TRACER_IN_PHASE" URL="../06_solver_hooks.html#_alfasim_sdk.hook_specs.calculate_mass_fraction_of_tracer_in_phase" ] {rank = same hook_update_variables_point hook_update_variables} {rank = same hook_calculate_source_terms_point hook_calculate_tracer_source_terms } {rank = same hook_initialize_user_defined_tracer_point hook_initialize_user_defined_tracer } {rank = same hook_set_bc_user_defined_tracer_point hook_set_bc_user_defined_tracer } {rank = same tracer_1 hook_update_bc_user_defined_tracer } {rank = same tracer_2 hook_calculate_mass_fraction_of_tracer_in_field} invisible_init -> hook_initialize_user_defined_tracer_point [arrowhead=none] hook_calculate_source_terms_point -> invisible_end subgraph cluster1{ labeljust="l" style="rounded, dashed" color="#8699A3" hook_initialize_user_defined_tracer_point -> hook_set_bc_user_defined_tracer_point [arrowhead=none] hook_set_bc_user_defined_tracer_point-> tracer_1 tracer_1 -> tracer_2 tracer_2 -> hook_update_variables_point [arrowhead=none] hook_update_variables_point -> tracer_3 tracer_3 -> hook_calculate_source_terms_point [arrowhead=none] } edge[constraint=false, style=dotted, color="#DA5961"] subgraph cluster2{ label="Hooks for User Defined Tracers" labeljust="l" fontcolor="#2c3e50" style="rounded, dashed" color="#8699A3" hook_initialize_user_defined_tracer_point -> hook_initialize_user_defined_tracer hook_set_bc_user_defined_tracer_point -> hook_set_bc_user_defined_tracer tracer_1 -> hook_update_bc_user_defined_tracer tracer_2 -> hook_calculate_mass_fraction_of_tracer_in_field } hook_calculate_source_terms_point -> hook_calculate_tracer_source_terms hook_update_variables_point -> hook_update_variables }