From 5fcd992a77e9531e560ae57ec8f45b3410479537 Mon Sep 17 00:00:00 2001 From: "Christopher D. Ellis" <25395795+tallchellis@users.noreply.github.com> Date: Fri, 30 Aug 2024 17:28:09 +0100 Subject: [PATCH] Added doc strings to Solvers. --- src/Solvers/Solvers_1_SIMPLE_comp.jl | 16 +++++ src/Solvers/Solvers_2_PISO_comp.jl | 21 ++++++ src/Solvers/Solvers_3_solver_dispatch.jl | 84 ++++++++++++++++++++++++ 3 files changed, 121 insertions(+) diff --git a/src/Solvers/Solvers_1_SIMPLE_comp.jl b/src/Solvers/Solvers_1_SIMPLE_comp.jl index 97f9decf..a548e013 100644 --- a/src/Solvers/Solvers_1_SIMPLE_comp.jl +++ b/src/Solvers/Solvers_1_SIMPLE_comp.jl @@ -5,6 +5,22 @@ export simple_comp! Compressible variant of the SIMPLE algorithm with a sensible enthalpy transport equation for the energy. + +### Input +- `model in` -- Physics model defiend by user and passed to run!. +- `config` -- Configuration structure defined by user with solvers, schemes, runtime and + hardware structures set. +- `resume` -- True or false indicating if case is resuming or starting a new simulation. +- `pref` -- Reference pressure value for cases that do not have a pressure defining BC. + +### Output +- `R_ux` - Vector of x-velocity residuals for each iteration. +- `R_uy` - Vector of y-velocity residuals for each iteration. +- `R_uz` - Vector of y-velocity residuals for each iteration. +- `R_p` - Vector of pressure residuals for each iteration. +- `R_e` - Vector of energy residuals for each iteration. +- `model` - Physics model output including field parameters. + """ simple_comp!(model_in, config; resume=true, pref=nothing) = begin R_ux, R_uy, R_uz, R_p, R_e, model = setup_compressible_solvers( diff --git a/src/Solvers/Solvers_2_PISO_comp.jl b/src/Solvers/Solvers_2_PISO_comp.jl index 9c69b4be..7e745651 100644 --- a/src/Solvers/Solvers_2_PISO_comp.jl +++ b/src/Solvers/Solvers_2_PISO_comp.jl @@ -1,5 +1,26 @@ export piso_comp! +""" + piso_comp!(model_in, config; resume=true, pref=nothing) + +Compressible variant of the PISO algorithm with a sensible enthalpy transport equation for +the energy. + +### Input +- `model in` -- Physics model defiend by user and passed to run!. +- `config` -- Configuration structure defined by user with solvers, schemes, runtime and + hardware structures set. +- `resume` -- True or false indicating if case is resuming or starting a new simulation. +- `pref` -- Reference pressure value for cases that do not have a pressure defining BC. + +### Output +- `R_ux` - Vector of x-velocity residuals for each iteration. +- `R_uy` - Vector of y-velocity residuals for each iteration. +- `R_uz` - Vector of y-velocity residuals for each iteration. +- `R_p` - Vector of pressure residuals for each iteration. +- `model` - Physics model output including field parameters. + +""" piso_comp!(model_in, config; resume=true, pref=nothing) = begin R_ux, R_uy, R_uz, R_p, R_e, model = setup_unsteady_compressible_solvers( diff --git a/src/Solvers/Solvers_3_solver_dispatch.jl b/src/Solvers/Solvers_3_solver_dispatch.jl index 5599b442..8ad1aa0c 100644 --- a/src/Solvers/Solvers_3_solver_dispatch.jl +++ b/src/Solvers/Solvers_3_solver_dispatch.jl @@ -1,6 +1,26 @@ export run! # Incompressible solver (steady) +""" + run!( + model::Physics{T,F,M,Tu,E,D,BI}, config; pref=nothing + ) where{T<:Steady,F<:Incompressible,M,Tu,E,D,BI} + +Incompressible steady solver using the SIMPLE algorithm. + +### Input +- `model` -- Physics model defiend by user and passed to run!. +- `config` -- Configuration structure defined by user with solvers, schemes, runtime and + hardware structures set. +- `pref` -- Reference pressure value for cases that do not have a pressure defining BC. + +### Output +- `R_ux` - Vector of x-velocity residuals for each iteration. +- `R_uy` - Vector of y-velocity residuals for each iteration. +- `R_uz` - Vector of y-velocity residuals for each iteration. +- `R_p` - Vector of pressure residuals for each iteration. +- `model` - Physics model output including field parameters. +""" run!( model::Physics{T,F,M,Tu,E,D,BI}, config; pref=nothing ) where{T<:Steady,F<:Incompressible,M,Tu,E,D,BI} = @@ -10,6 +30,26 @@ begin end # Incompressible solver (transient) +""" + run!( + model::Physics{T,F,M,Tu,E,D,BI}, config; pref=nothing + ) where{T<:Transient,F<:Incompressible,M,Tu,E,D,BI} + +Incompressible unsteady solver using the PISO algorithm. + +### Input +- `model` -- Physics model defiend by user and passed to run!. +- `config` -- Configuration structure defined by user with solvers, schemes, runtime and + hardware structures set. +- `pref` -- Reference pressure value for cases that do not have a pressure defining BC. + +### Output +- `R_ux` - Vector of x-velocity residuals for each iteration. +- `R_uy` - Vector of y-velocity residuals for each iteration. +- `R_uz` - Vector of y-velocity residuals for each iteration. +- `R_p` - Vector of pressure residuals for each iteration. +- `model` - Physics model output including field parameters. +""" run!( model::Physics{T,F,M,Tu,E,D,BI}, config; pref=nothing ) where{T<:Transient,F<:Incompressible,M,Tu,E,D,BI} = @@ -19,6 +59,28 @@ begin end # Weakly Compressible solver (steady) +""" + run!( + model::Physics{T,F,M,Tu,E,D,BI}, config; pref=nothing + ) where{T<:Steady,F<:WeaklyCompressible,M,Tu,E,D,BI} + +Mildly compressible steady solver using the SIMPLE algorithm for low speed cases with heat + transfer. + +### Input +- `model` -- Physics model defiend by user and passed to run!. +- `config` -- Configuration structure defined by user with solvers, schemes, runtime and + hardware structures set. +- `pref` -- Reference pressure value for cases that do not have a pressure defining BC. + +### Output +- `R_ux` - Vector of x-velocity residuals for each iteration. +- `R_uy` - Vector of y-velocity residuals for each iteration. +- `R_uz` - Vector of y-velocity residuals for each iteration. +- `R_p` - Vector of pressure residuals for each iteration. +- `R_e` - Vector of energy residuals for each iteration. +- `model` - Physics model output including field parameters. +""" run!( model::Physics{T,F,M,Tu,E,D,BI}, config; pref=nothing ) where{T<:Steady,F<:WeaklyCompressible,M,Tu,E,D,BI} = @@ -37,6 +99,28 @@ begin end # Weakly Compressible solver (transient) +""" + run!( + model::Physics{T,F,M,Tu,E,D,BI}, config; pref=nothing + ) where{T<:Transient,F<:WeaklyCompressible,M,Tu,E,D,BI} + +Mildly compressible unsteady solver using the PISO algorithm for low speed cases with heat + transfer. + +### Input +- `model` -- Physics model defiend by user and passed to run!. +- `config` -- Configuration structure defined by user with solvers, schemes, runtime and + hardware structures set. +- `pref` -- Reference pressure value for cases that do not have a pressure defining BC. + +### Output +- `R_ux` - Vector of x-velocity residuals for each iteration. +- `R_uy` - Vector of y-velocity residuals for each iteration. +- `R_uz` - Vector of y-velocity residuals for each iteration. +- `R_p` - Vector of pressure residuals for each iteration. +- `R_e` - Vector of energy residuals for each iteration. +- `model` - Physics model output including field parameters. +""" run!( model::Physics{T,F,M,Tu,E,D,BI}, config ) where{T<:Transient,F<:WeaklyCompressible,M,Tu,E,D,BI} =