158 Commits

Author SHA1 Message Date
Grzegorz Kowal
eda9cdcf43 Make subroutine find_new_timestep() private.
Also call it in initialize_evolution().
2012-07-31 15:13:51 -03:00
Grzegorz Kowal
63d1c8c0b1 Implement subroutines advance() and advance_rk2().
Subroutine advance() is a replacement for the subroutine evolve().  It
performs one step variable update by calling the selected integration
method.  So far only 2nd order Runge-Kutta is supported, which is
implemented in subroutine advance_rk2().

Subroutine advance_rk2() advances the conservative variables by one step
using the 2nd order Runge-Kutta method with the boundary update after
each substep.  This results in the reduced number of ghost zones, for
example 2 instead of 4, as in the previous version.
2012-07-31 15:04:40 -03:00
Grzegorz Kowal
4cca807172 Remove module dependency of EVOLUTION on CONFIG. 2012-07-28 11:47:14 -03:00
Grzegorz Kowal
d230bc369e Update primitive variables for each block after each time advance. 2012-07-27 22:33:18 -03:00
Grzegorz Kowal
fc72250516 Rename module PROBLEM to PROBLEMS and update dependencies. 2012-07-27 19:23:11 -03:00
Grzegorz Kowal
10d65b727a Slightly rewrite module EVOLUTION. 2012-07-27 17:01:21 -03:00
Grzegorz Kowal
ff60bb681c Rename module COORDS to COORDINATES. 2012-07-22 22:26:51 -03:00
Grzegorz Kowal
515c82d435 Rewrite module MPITOOLS and adopt the rest to the changes.
Another step of reducing differences between the AMUN and GODUNOV codes.
2012-07-22 19:01:27 -03:00
Grzegorz Kowal
0da52f7aec Rewrite module TIMERS to be compatible with Godunov version. 2012-07-22 15:46:56 -03:00
Grzegorz Kowal
64a098c9bb Rename module TIMER to TIMERS.
Rename internal array timers(:) to times(:) to not conflict with the
module name.
2012-07-22 12:59:15 -03:00
Grzegorz Kowal
dbfbabc613 Change the license to GNU General Public License version 3. 2012-07-22 12:30:20 -03:00
Grzegorz Kowal
1abbafed99 Allow for gradual introduction of the forcing term.
- the new parameter tbfor determines the time when the forcing starts
   to be introduced gradually; the parameter tefor determines at what
   time the forcing operates with the full power; the transition between
   tbfor and tefor is described by sinus function;
2011-06-10 15:46:40 -03:00
Grzegorz Kowal
e5e265bbe5 Add new parameter for the top level.
- the new parameter toplev stores the level of refinement larger or
   equal to maxlev; this level cannot be set in the config.in, but is
   determined during the initiation or restarting the job;

 - several subroutines have been updated to use toplev instead of
   maxlev;
2011-06-06 17:31:51 -03:00
Grzegorz Kowal
8b748dc2d2 Move parameter decay to CONFIG module.
- the parameter decay depends only on alpha_p and cfl parameters and is
   constant for all evolution, so move it to CONFIG module;
2011-05-27 12:59:09 -03:00
Grzegorz Kowal
60071ae6f2 Restore previous version of flux_rk3(). 2011-05-22 16:49:18 -03:00
Grzegorz Kowal
58c7aa135c Restore previous version of flux_rk2(). 2011-05-21 22:12:46 -03:00
Grzegorz Kowal
38776b603d Correct flux_rk3() to compute conservative fluxes. 2011-05-19 20:53:38 -03:00
Grzegorz Kowal
9ad6861c8d Correct flux_rk2() to compute conservative fluxes.
- the subroutine flux_rk2() updates one dimensional fluxes using the
   2nd order Runge-Kutta method, and then calculates the averaged flux,
   which is used to update the block variables;
2011-05-19 18:41:51 -03:00
Grzegorz Kowal
01b91a9c94 Add subroutine advance_solution_1d().
- this subroutine advances the solution only along the one direction
   using a directional flux;
2011-05-19 18:35:36 -03:00
Grzegorz Kowal
5ce57da3bc Calculate directional fluxes in update_flux() only.
- instead of calculating all fluxes at once in update_flux(), select
   the direction as a subroutine argument and calculate only the flux
   along this direction;

 - directional fluxes are needed for the directional RK integration of
   the numerical fluxes;

 - update subroutines flux_euler(), flux_rk2(), and flux_rk3() to use
   new update_flux() subroutine;
2011-05-19 18:24:09 -03:00
Grzegorz Kowal
069bc8c887 Pass timestep as an argument to advance_solution(). 2011-05-19 15:00:20 -03:00
Grzegorz Kowal
d9077affd5 Slightly rewrite advance_solution(). 2011-05-18 17:03:24 -03:00
Grzegorz Kowal
3e586c94d3 Fix finding of dxmin in find_new_timestep(). 2011-05-17 20:26:33 -03:00
Grzegorz Kowal
68a39a28e4 Look for dxmin only once in find_new_timestep(). 2011-05-15 13:55:52 -03:00
Grzegorz Kowal
0fc7717100 Move coordinate variables from MESH to new COORDS module.
- a new module COORDS handles the mesh variables which needed to be
   separated from the MESH module since they are used in PROBLEM module,
   which is required by MESH module; this created a circular dependency;
   by introducing a new COORDS module we removed that problem;
2011-05-11 15:32:01 -03:00
Grzegorz Kowal
92980164c2 Pass pointers to objects as arguments instead of objects.
- in EVOLUTION module subroutines pass pointers to objects as arguments
   instead of objects themself; it should reduce memory operations a
   bit;
2011-05-08 00:15:51 -03:00
Grzegorz Kowal
062ae41acf Rewrite the binaries problem.
- allow for time varying shapes;

 - remove unnecessary configuration parameters for the boundaries
   problem and give the remaining parameters more descriptive names;

 - place the star always in the origin of the coordinate system, which
   is the focus point of the satellite orbit, as well;

 - make the satellite orbiting around the main star with a given period
   discribed by a parameter 'tsat'; the satellite orbit is an elipse
   described by the minimum distance from the focus point 'dsat' and
   eccentricity 'esat';
2011-05-07 12:14:34 -03:00
Grzegorz Kowal
7a729ea0a1 Rewrite subroutine update_shapes() so it works with CONSERVATIVE.
- subroutine update_shapes() has been rewritten so now it works well
   with both CONSERVATIVE=Y and CONSERVATIVE=N;

 - since we are calling update_shapes() only once per step per block
   now, it gives a small performance optimization;
2011-05-07 10:33:49 -03:00
Grzegorz Kowal
0e930499a1 Fix diffusion of Psi in MHD-GLM after last changes.
- the diffusion of Psi in MHD-GLM requires spacial step dxmin, so
   update the diffusion so it works after the last commit changes;

 - call find_new_timestep() after job restart, since some parameters
   could change;
2011-05-07 09:32:10 -03:00
Grzegorz Kowal
1bdc4b8706 Replace update_maximum_speed() with find_new_timestep().
- subroutine update_maximum_speed() has been replaced with
   find_new_timestep(), which first finds the minimum spacial step
   dxmin, then finds the maximum speed in the domain, and finally
   estimates new time step;

 - dx_min has been removed from MESH module, since it is not required
   anymore;
2011-05-07 09:23:16 -03:00
Grzegorz Kowal
8076970c22 Update copyright headers with the new email. 2011-05-05 18:37:53 -03:00
Grzegorz Kowal
afefeff129 Start/stop timers from the inside of evolution subroutines. 2011-05-03 00:01:00 -03:00
Grzegorz Kowal
3cd4923d98 Start/stop timers from the inside of mesh subroutines. 2011-05-02 23:35:48 -03:00
Grzegorz Kowal
44f2455e4f Start/stop timers from the inside of boundry subroutines. 2011-05-02 23:12:00 -03:00
Grzegorz Kowal
5610cbfd4a Add injected energy to total one in adiabatic case.
- if we use forcing in the case of adiabatic equation of state, the
   total energy of each cell must be updated by the kinetic energy
   injected to this cell; otherwise the energy conservation will be
   violated;
2011-05-01 19:21:43 -03:00
Grzegorz Kowal
fe9d53136d Put condition from previous commit in boundary_correct_fluxes(). 2011-05-01 10:44:31 -03:00
Grzegorz Kowal
0b378f75a6 Don't correct fluxes on uniform mesh. 2011-05-01 10:33:21 -03:00
Grzegorz Kowal
0ac2cfd209 Implement flux integration using RK3 method. 2011-05-01 10:31:27 -03:00
Grzegorz Kowal
39c629f3a2 Add magnetic terms to advance_solution() and update_solution(). 2011-05-01 09:44:19 -03:00
Grzegorz Kowal
48e88de4de Include forcing term in update_solution(). 2011-05-01 09:24:11 -03:00
Grzegorz Kowal
e6408438c9 Implement flux integration using RK2.
- implement subroutine flux_rk2() which calculates fluxes at time t and
   t + dt and averages them; then the calculated flux is passed to
   variable update;

 - implement subroutine advance_solution() which advances an array of
   conserved variables using fluxes provided as an argument;

 - use advance_solution() in update_solution();
2011-05-01 08:57:14 -03:00
Grzegorz Kowal
ed4c3d23af Implement subroutines to correct boundary fluxes.
- subroutine boundary_correct_fluxes() sweeps over all leafs and if it
   finds that a neighbor is at higher level, performs a correction of
   the numerical flux of current block in this direction; this
   subroutine does not support MPI yet!;

 - subroutine correct_flux() performs the atual correction of the
   numerical flux; only part belonging to domain is updated, since ghost
   zones are updated anyway in the next step during the variable update;

 - call boundary_correct_flux() from evolve();
2011-04-30 15:10:02 -03:00
Grzegorz Kowal
735605c575 Add one step update of conserved variables.
- after calculating an integrals of fluxes with a given order we
   performed one step updated of the conserved variables stored in data
   blocks using corresponding numerical flux stored in the same data
   block; the subroutine which performs update is called
   update_solution();
2011-04-30 13:14:07 -03:00
Grzegorz Kowal
5953dfc817 Implement flux integration using Euler method.
- subroutine flux_euler() integrates the numerical flux using the first
   order Euler method;
2011-04-30 12:53:17 -03:00
Grzegorz Kowal
ed429e795e Add a subroutine to calculate numerical fluxes.
- the subroutine update_flux() in the SCHEME module calculates
   numerical fluxes from the conserved variables; the calculated fluxes
   are then returned;
2011-04-30 12:28:02 -03:00
Grzegorz Kowal
fc32225dc1 Change the license to GNU General Public License, version 2. 2011-04-29 11:21:30 -03:00
Grzegorz Kowal
4e54018330 Perform the refinement step only if maxlev > 1. 2011-04-26 12:37:25 -03:00
Grzegorz Kowal
6acbc9dc3b Fix forcing term in subroutine evolve_rk2(). 2011-04-26 11:50:57 -03:00
Grzegorz Kowal
72ca908bc6 Add forcing terms after the main update.
- change order of calculating terms; first perform the main update
   of the conserved variables, then add forcing and source terms; in
   this way we do not change time step which determines the stability of
   scheme before the conserved variables enter Riemann solver; this is
   especially important in highly supersonic simulations, when in the
   presence of very low density, even small change of velocity can make
   the scheme numerically unstable;
2011-04-26 10:36:16 -03:00
Grzegorz Kowal
0ff433e16b Rename the code from Godunov-AMR to AMUN. 2011-04-25 13:44:34 -03:00