Skip to content

Commit

Permalink
Simplified FE scheme. Added "num_scheme" to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
charman2 committed Jul 28, 2023
1 parent 8ff175f commit 831677f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 3 additions & 0 deletions doc/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ Default options are
``n_substeps``: (int, default=1)
Number of substeps in the calculation. Each timestep can be subdivided to increase the numerical accuracy of the solution and address some numerical issues, at the cost of longer run times. Note that the substep calculations are not retained in the output. The substeps are aggregated back to the full timestep first

``num_scheme``: (int, default=4)
Numerical scheme used to solve the SAS function. Default is a 4th-order Runge-Kutta scheme (``num_scheme=4``). Valid alternatives are a second-order accurate midpoint scheme (``num_scheme=2``) and a first order accurate forward Euler scheme (``num_scheme=1``).

``max_age``: (int, default=len(data_df))
The maximum age that will be calculated. This controls the number of rows in the output matricies. Set to a smaller value than the default to reduce calculation time (at the cost of replacing calculated concentrations of old water with ``C_old``)

Expand Down
6 changes: 1 addition & 5 deletions mesas/sas/solve.f90
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,7 @@ subroutine solveSAS(J_fullstep, Q_fullstep, SAS_args, P_list, weights_fullstep,
select case (num_scheme)
case (1)
! This is the forward Euler
call get_flux(sT_temp, mT_temp, pQ_temp, mQ_temp, mR_temp, one8)
if (iT_substep == 0) then
call new_state(sT_temp, mT_temp, pQ_temp, mQ_temp, mR_temp, one8)
call get_flux(sT_temp, mT_temp, pQ_temp, mQ_temp, mR_temp, one8)
end if
call get_flux(sT_temp, mT_temp, pQ_temp, mQ_temp, mR_temp, 0.0D0)
call add_to_average(pQ_temp, mQ_temp, mR_temp, one8)
call new_state(sT_temp, mT_temp, pQ_aver, mQ_aver, mR_aver, one8)

Expand Down

0 comments on commit 831677f

Please sign in to comment.