03-1. Solver Settings
In this section we will discuss the input file solver/settings.input
. This file sets parameters for the solver and domain of the simulation.
This the file is read in by the subroutine read_me
in the reader.f90
module. The relevant inputs extracted from this file are then shared with the rest of the code.
We will refer to the equations:
∂u∂t=ϵ(∂2u∂x2+∂2u∂x2)+F(u,v)∂v∂t=(∂2v∂x2+∂2v∂y2)+G(u,v),
Explanation of File Contents
This first section is:
Settings ________________
1 !!! Time_switch (time marching if 1)
1 !!! Non_Linear_switch (non linear if 1)
2 !!! Eqn_number
2 !!! Domain_number
-
Time_switch
toggles the the solver between a BVP solver when set to 0 and a IBVP solver when set to 1. When we have a BVP, this is equivalent to setting the time derivatives ∂u∂t=1 and ∂v∂t=1. -
Non_Linear_switch
controls the Newton-iteration solver, disabling it when set to 0 and enabling it when set to 1. The equation that we solve when theNon_Linear_switch
is 0 is linear, and so F(u,v)=G(u,v)=0. -
Eqn_number
sets how many equations to solve. If set to 1, we only solve for u. If set to 2, we solve for both u and v. -
Domain_number
specifies the number of domains. If set to 1, we only solve over one domain x. If set to 2, we only solve over one domain x and y.
Domain sections:
!!! xdomain settings_____
30 !!! nx - size of x domain
0,5 !!! xl, xr - start and end points of x domain
0,2.25 !!! x_stretch_on or off, grid stretch parameter (xhalf)
!!! ydomain settings_____
30 !!! ny - size of y domain
0,5 !!! yl, yr - start and end points of y domain
0,2.25 !!! y_stretch_on or off, grid stretch parameter (yhalf)
!!! temporal marching settings_____
1000 !!! nt - size of t domain
0.d0,10.d0 !!! tl, tr - start and end points of time domain
-
nx
,ny
andnt
set the number of points inside each domain. -
xl
andxr
are the start and end of the x domain respectively. This is repeated for y and t. -
For the spatial domains x and y we also include a grid stretch switch
x_stretch_on
andy_stretch_on
When set to 0, then we have uniform domains. When set to 1, half the grid points have been clustered betweenxl
andxhalf
in a smooth manner. This is the same for y.
!!! general settings_____
4 !!! DiffOrder - order of finite differences scheme
1.d-6 !!! Newton_Error
2000 !!! Max_iter - max Newton iterations
-
DiffOrder
sets the order of the finite differences. Can be 2 (second order), 3 (fourth order interior and second order boundaries) or 4 (fourth order). -
Newton_Error
sets the tolerance needed to achieve convergence in the non-linear Newton iteration at each step. A smaller number yields a more accurate result. -
Max_iter
sets the maximum number of iterations allowed for the non-liner Newton iteration. If we pass this number, convergence is not reached and the solver stops.