MAMMA
1.0
Conduitsolver
|
Steady state equations integration. More...
Functions/Subroutines | |
subroutine | steady_shooting |
Shooting Method. More... | |
subroutine | integrate_equations (qp, flag_output, extrap_z, extrap_z_p, extrap_z_mach, extrap_flag, r_p_1, r_p_2, mach) |
Steady state integration. More... | |
subroutine | perturbe_qp (qp) |
Solution preturbation. More... | |
subroutine | advance_dz (qp, dz, check_convergence) |
Solution advance in space. More... | |
subroutine | eval_f (qp_rel, qp_org, dz, coeff_f, right_term, scal_f) |
Nonlinear function evaluation. More... | |
subroutine | eval_jacobian (qp_rel, qp_org, dz, coeff_f, left_matrix) |
Jacobian evaluation. More... | |
subroutine | steady_lnsrch (x_rel_init, x_org, scal_f_old, grad_f, desc_dir, dz, coeff_f, x_rel_new, scal_f, f_nl, stpmax, check, callf) |
Search the descent stepsize. More... | |
subroutine | linear_extrapolation (zeta_old, qp_old, zeta, qp, extrap_z, extrap_z_p, extrap_z_mach, extrap_flag) |
Linear extrapolation of the solution. More... | |
Variables | |
real *8 | zeta |
real *8, dimension(:), allocatable | fluxes_old |
real *8, dimension(:), allocatable | nh_terms_old |
real *8 | zeta_old |
real *8 | dz_max |
logical | increase_flow_rate |
integer | nl_iter |
Steady state equations integration.
This module contains the subroutine for the integration of the model equations with the shooting technique.
subroutine steady_solver::advance_dz | ( | real*8, dimension(n_eqns), intent(inout) | qp, |
real*8, intent(in) | dz, | ||
logical, intent(out) | check_convergence | ||
) |
Solution advance in space.
This subroutine integrates the conservative variables in space from zeta to zeta+dz.
[in,out] | qp | actual physical variables |
[in] | dz | integration step |
[out] | check_convergence | logical for convergence check |
Definition at line 1271 of file steady_solver.f90.
subroutine steady_solver::eval_f | ( | real*8, dimension(:), intent(in) | qp_rel, |
real*8, dimension(:), intent(in) | qp_org, | ||
real*8, intent(in) | dz, | ||
real*8, dimension(:), intent(in) | coeff_f, | ||
real*8, dimension(:), intent(out) | right_term, | ||
real*8, intent(out) | scal_f | ||
) |
Nonlinear function evaluation.
This subroutine evaluates the residual of the nonlinear functions obtained from the integration in space of the steady equations.
[in] | qp_rel | actual physical variables |
[in] | qp_org | actual physical variables |
[in] | dz | integration step |
[in] | coeff_f | weighting coefficients |
[out] | right_term | array of residuals |
[out] | scal_f | magnitude of the array of residuals |
Definition at line 1621 of file steady_solver.f90.
subroutine steady_solver::eval_jacobian | ( | real*8, dimension(n_vars), intent(in) | qp_rel, |
real*8, dimension(n_vars), intent(in) | qp_org, | ||
real*8, intent(in) | dz, | ||
real*8, dimension(n_eqns), intent(in) | coeff_f, | ||
real*8, dimension(n_eqns,n_eqns), intent(out) | left_matrix | ||
) |
Jacobian evaluation.
This subroutine evaluates with a complex step derivative procedure the Jacobian of the nonlinear system obtained from the integration in space of the steady equations.
[in] | qp_rel | actual physical variables |
[in] | qp_org | actual physical variables |
[in] | dz | integration step |
[in] | coeff_f | weighting coefficients |
[out] | left_matrix | Jacobian matrix |
Definition at line 1702 of file steady_solver.f90.
subroutine steady_solver::integrate_equations | ( | real*8, dimension(n_eqns), intent(inout) | qp, |
logical, intent(in) | flag_output, | ||
real*8, intent(out) | extrap_z, | ||
real*8, intent(out) | extrap_z_p, | ||
real*8, intent(out) | extrap_z_mach, | ||
integer, intent(out) | extrap_flag, | ||
real*8, intent(out) | r_p_1, | ||
real*8, intent(out) | r_p_2, | ||
real*8, intent(out) | mach | ||
) |
Steady state integration.
This subroutine integrate the steady equations for magma ascent along the conduit, givent the state qp at the base of the conduit. The integration ends if one of the top boundary condition is reached befor the top or if the top of the conduit is reached.
[in,out] | qp | physical variables at the inlet |
[in] | flag_output | flag to determine if the output has to be saved |
[out] | extrap_z | depht at which the bdry condition is reached |
[out] | extrap_z_p | depht at which the bdry condition is reached |
[out] | extrap_z_mach | depht at which the bdry condition is reached |
[out] | extrap_flag | flag for the bdry condition reached |
[out] | r_p_1 | exit phase 1 pressure |
[out] | r_p_2 | exit phase 2 (exsolved gas) pressure |
[out] | mach | Mach at the exit |
Integration step
Sound speed of the mixture
Variables used to define the new value of the integration step
Solution at the computational grid point
Solution at the previous integration step
Solution obtained integrating with full step
Solution obtained integrating with one half step
Solution obtained integrating with two half steps
Definition at line 625 of file steady_solver.f90.
subroutine steady_solver::linear_extrapolation | ( | real*8, intent(in) | zeta_old, |
real*8, dimension(n_eqns), intent(in) | qp_old, | ||
real*8, intent(in) | zeta, | ||
real*8, dimension(n_eqns), intent(in) | qp, | ||
real*8, intent(out) | extrap_z, | ||
real*8, intent(out) | extrap_z_p, | ||
real*8, intent(out) | extrap_z_mach, | ||
integer, intent(out) | extrap_flag | ||
) |
Linear extrapolation of the solution.
This subroutine extrapolate linearly some primitive variables of the solution to find where the boundary conditions are reached (below or above the vent).
[in] | zeta_old | zeta at the previous step |
[in] | qp_old | physical variables at the previous step |
[in] | zeta | actual zeta |
[in] | qp | physical conservative variables |
[out] | extrap_z | zeta at which the boundary condition is reached |
[out] | extrap_z_p | zeta at which the boundary condition is reached |
[out] | extrap_z_mach | zeta at which the boundary condition is reached |
[out] | extrap_flag | flag for the boundary condition reached first |
Definition at line 2004 of file steady_solver.f90.
subroutine steady_solver::perturbe_qp | ( | real*8, dimension(n_vars), intent(inout) | qp | ) |
Solution preturbation.
This subroutine perturbes the initial guess for the Newthon-Raphson method in order to improve the convergence.
[in,out] | qp | physical variables |
Definition at line 1240 of file steady_solver.f90.
subroutine steady_solver::steady_lnsrch | ( | real*8, dimension(:), intent(in) | x_rel_init, |
real*8, dimension(:), intent(in) | x_org, | ||
real*8, intent(in) | scal_f_old, | ||
real*8, dimension(:), intent(in) | grad_f, | ||
real*8, dimension(:), intent(inout) | desc_dir, | ||
real*8, intent(in) | dz, | ||
real*8, dimension(:), intent(in) | coeff_f, | ||
real*8, dimension(:), intent(out) | x_rel_new, | ||
real*8, intent(out) | scal_f, | ||
real*8, dimension(:), intent(out) | f_nl, | ||
real*8, intent(in) | stpmax, | ||
logical, intent(out) | check, | ||
callf | |||
) |
Search the descent stepsize.
This subroutine search for the lenght of the descent step in order to have a decrease in the nonlinear function.
[in] | x_rel_init | coefficients for initial guess |
[in] | x_org | initial guess |
[in] | scal_f_old | old value of the function f |
[in] | grad_f | gradient of the f |
[in,out] | desc_dir | descent direction |
[in] | dz | integration step |
[in] | coeff_f | weighting coefficients |
[out] | x_rel_new | optimal solution |
[out] | scal_f | new value of the function f (at x_new) |
[out] | f_nl | values of the vector function f_nl |
[in] | stpmax | max number of steps |
[out] | check | logical for convergence |
[in] | callf | name of the subroutine for the function f |
[in] | x_rel_init | Initial point |
[in] | x_org | Initial point |
[in] | grad_f | Gradient at xold |
[in] | scal_f_old | Value of the function at xold |
[in,out] | desc_dir | Descent direction (usually Newton direction) |
[out] | x_rel_new | Updated solution |
[out] | scal_f | Value of the scalar function at x |
[out] | f_nl | Values of the nonlinear functions at x |
[out] | check | Output quantity check is false on a normal exit |
Definition at line 1790 of file steady_solver.f90.
subroutine steady_solver::steady_shooting | ( | ) |
Shooting Method.
This subroutine search for the steady solution using a Shooting Method for Two-Point Boundary Value Problems. A bisection method is used to find the value of inlet velocity, in order to reach the desired prescribed boundary condition at the exit.
Definition at line 65 of file steady_solver.f90.
real*8 steady_solver::dz_max |
Definition at line 44 of file steady_solver.f90.
real*8, dimension(:), allocatable steady_solver::fluxes_old |
Definition at line 41 of file steady_solver.f90.
logical steady_solver::increase_flow_rate |
Definition at line 46 of file steady_solver.f90.
real*8, dimension(:), allocatable steady_solver::nh_terms_old |
Definition at line 42 of file steady_solver.f90.
integer steady_solver::nl_iter |
Definition at line 48 of file steady_solver.f90.
real*8 steady_solver::zeta |
Definition at line 40 of file steady_solver.f90.
real*8 steady_solver::zeta_old |
Definition at line 44 of file steady_solver.f90.