File doc/controls.txt; TRANSIENT V4.3; 3 Nov. 2023
(C) 2001-2023 Miroslav Kolar
TRANSIENT
Demonstration No. 1
Uniform Corrosion and Transport of Corrosion Products
.---------- p o w e r e d b y ----------.
| TRANSIENT V4.3 nonlinear parabolic diff equation solver |
'---------- http://transient.mkolar.org/ -----------'
Control parameters, their default values and their purpose:
------------------
steady = 0
0 - The main purpose of this program - the time-dependent (transient)
solution of coupled reaction-diffusion equations in one spatial variable;
all control parameters (as listed by ?c-) are used.
1 - Only a steady state solution is obtained using the same evalf() function
as for the transient solution, provided that PDM's evalf consistently uses
global variable 'tStepInv' (tStepInv = 1/tStep) to calculate the contribution
of discretized time derivatives of unknown variables to F[k] and B[k][k]; then
simply setting tStepInv=0 eliminates all time derivative terms. Time is set to
t=tStart (in case there are any time dependent reaction terms, but then
the notion of a steady state may be meaningless).
Only the following control parameters (may) have effect during steady-state run:
steady, TOL, TOLC, sepProf(=-1), echoInit, init_from_file, cDiffMfExcl, tStart.
2 - First a steady state is obtained, and then used in the same run as the initial
state for a transient solution (e.g., to check this steady state stability).
monitor = 0
The amount of diagnostic on-screen output for a transient run:
-1 - Only the value of t is printed at all "pr_Other" output times.
0 - In addition to the above, the value of cDiffM is printed at regular
"pr_Other" output times.
1 - Values of t, cDiffM=(MAX over j and e of |c[j][e]-c_o[j][e]|)/cAVmax;
where cAVmax=(MAX over j and e of |c[j][e]| and |c_o[j][e]|),
tStep, # of attempts, and total # of runband Newton-Raphson (NR) iterations
in all attempts are printed after EACH time step
(here e runs only through the "non-excluded" equations).
2 - During EACH time step a line with iter #, (fresidT), fresidM, node and
equ # where fresidM occurs, (cresidT), cresidM, and the corresponding
node and equ #, are printed after each iteration. Then a line which
starts with t, cDiffM, tStep, Scale = next_tStep/tStep ratio.
Also some details about repeated attempts are given.
3 - In addition to 2, another line is inserted giving where cDiffM occurs and the,
values of (MAX of |c_o|) and (MAX of |c|), both over all nodes j and "non-excluded"
equations e. If non-empty cDiffMfExcl is set (see transien.h), one more line is
added with cDiffMExcl and the respective max of |c_o|, |c|, for equations
from the cDiffMfExcl list.
10, 20, 30 - Same as 1, 2, 3, respectively, except that there is no pause at the
start of a run allowing to read a brief explanation of the output to follow.
Except for monitor=-1, the (last) line continues with the cumulative numbers of
time steps, attempts (calls to runband), and NR iterations (incl. those in
the unsuccessful attempts).
For monitor>0, it ends with the value of cDiffM extrapolated to the time
interval between two consecutive profile output times (to give an estimate
of max relative change between the consecutive outputted profiles:
e.g., 0.01 ~ change by about 1 in the 3rd significant digit; when these estimates are
much larger than the real differences, it indicates numerical noise or oscillations).
For monitor>0, output into the two main output files is flagged by additional
lines containing or .
CmntC = #
Character with a dual (complementary, contrary) role:
- In all output files it marks the beginning of comment lines (lines that would
not be plotted).
- In the input file, or in the interactive input at the command prompt,
any number of its occurrences at the beginning of input lines are equivalent
to white space. On the contrary, any character other than CmntC or a space can
be used at the beginning of an input line to 'comment it out' (ignore it).
Thus, CmntC may be reset in an input file repeatedly to switch on or off blocks
of lines that are prefixed with different characters. Only the last
value of CmntC read in from the input file is then used as the comment
character in the output files.
TOL = 1
Successful NR convergence condition:
if cresidT < TOLC*TOL*(#equations-Nexcl)*#nodes*2e-16 OR fresidT < TOL*#nodes*2e-16
TOLC = 10
See help for TOL
Tau = 0.1
"Implicitness" of the differencing scheme (in time; 0 <= Tau <= 1):
0 fully implicit
0.5 Crank-Nicholson
1 explicit
Preferably use Tau = 0.5; if there are problems, try Tau < 0.5;
in some cases, Tau = 0 may be the best.
NIG = 0.5
New Initial Guess extrapolation factor (-0.5<=NIG<=1) for the next time step:
c_New_Initial_Guess = c + NIG * Scale * (c - c_previous);
where Scale = (t_new - t) / (t - t_previous),
and t & c are the current time and the unknown variable value, respectively
nIterM = 7
Desired (≈ maximum) number of NR iterations in runband() in each attempt
tStart = 0 sec
Initial time (start of transient simulation)
tEnd = 1.6e+16 sec
Final time (end of transient simulation)
tStepInit = 0.001 sec
Magnitude of the initial time step tStep
maxScale = 1.1
Maximum allowed ratio of two consecutive time steps,
i.e., maximum of 'Scale' defined in the description of the control parameter NIG
tOutInit = 2.6298e+06 sec
Initial time (tOut) for c profiles output
tOutMulF = 1.4
Rate of increase of the time interval between subsequent c profiles outputs:
Next_tOut = tOut + (tOut - previous_tOut) * tOutMulF
nOutOTH = -20
pr_Other() is called at |nOutOTH|-1 regularly spaced time instants
between 2 consecutive tOut (can be used for additional, time-dependent
output, placed into the .tdep output file).
If nOutOTH<0, pr_Other calls MAY NOT be exactly equidistant in time.
sepProf = 1
0 - Concentration profiles for all output times will be placed
into a single output file.
1 - Profiles for each time will be placed into a separate file.
-1 - No profiles file created. In addition, no .diag file created.
echoInit = 0
Output of initial profiles (after possible reinitialization, see init_from_file):
0 - Disabled
1 - Initial profiles are written out into an output file with the extension 0
strict = -1
strict < 0: cDifMxf(t) is not used at all to determine the next tStep,
and its growth is limited only by nIterM.
strict = 0: cDiffM does usually not exceed cDifMxf(t) too much.
strict = 1: cDiffM <= cDifMxf(t) is strictly enforced.
Here cDiffM is the maximum magnitude of the change in all non-excluded
c[][]/cAVmax over the whole tStep (see the help for monitor=1); cresidM is
the same quantity, but for a single NR iteration only.
cDifMxf(t) is determined by input parameters cDifMxMode, cDifMxInit,
and if applicable by cDifMxPi (i=1,...,cDifMxMode-2) and cDifMxEnd.
strict<0 gives the fastest run, and sometimes produces good enough results.
cDifMxMode = 1
Type of cDifMxf(t), i.e. of the interpolation between cDifMxInit and cDifMxEnd:
0 - Max allowed change in c is constant and equal to cDifMxInit
1 - Linear interpolation
2 - Log-log linear: ln(cDifMxf) = linear function of ln(|t|)
>2 - Piecewise linear: In this case cDifMxMode = number of all time instants
between each consecutive two of which a linear interpolation of cDifMxf
will be done. This number includes the initial and final times, corresponding
to values cDifMxInit and cDifMxEnd. The remaining cDifMxMode-2 inner points
are entered as values of input parameters cDifMxP1, cDifMxP2, ...,
cDifMxP{cDifMxMode-2}. Their values are the comma-separated
(no spaces allowed around the comma) pairs of time (in sec) and the
corresponding value of cDifMxf. Example:
cDifMxInit = 1e-5
cDifMxP3 = 1e5,0.1
cDifMxP1 = 10.,1e-4
cDifMxEnd = 1.
cDifMxMode = 5
cDifMxP2 = 1e3,0.01
(Order of input lines does not matter, but times corresponding to
cDifMxP{i} must increase with i if tEnd>tStart,
and decrease with i if tEnd0)
cDiffMfExcl =
'Exclusion list' of the indices of equations (dependent variables c)
that will not be used in cresidT/M and fresidT/M in NR iterations, and
in transient runs also when calculating the "relative" change in c
in each time step, cDiffM. Only those c not in this list will
contribute to the above 'error indicators'.
The list is comma separated and preceded by the number of indices in
the list (Nexcl) and a colon, no spaces. Eg: cDiffMfExcl = 3:2,3,9 .
Empty list: all c are used in the calculation of the convergence indicators.
init_from_file =
Name of file containing the initial profiles; if non-NULL, the
user supplied function read_profiles() will be invoked just after
Initialize(), and initial profiles set in Initialize() will be
overwritten by those read in in read_profiles(). Can be used to
continue an interrupted run (possibly after changing some parameters),
by reading in the last good profile output file in read_profiles().