84 Commits

Author SHA1 Message Date
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
Grzegorz Kowal
b3b4b42ad8 Change flag RESIS to RESISTIVITY. 2011-03-22 17:24:28 -03:00
Grzegorz Kowal
2e77f327b1 Implement viscous terms. 2011-03-18 15:33:24 -03:00
Grzegorz Kowal
cd91d350ab Introduce a compilation flag REFINE.
- the flag REFINE determines if the code should be compiler with the
   adaptive mesh refining/derefining; otherwise, the static mesh is
   generated;
2011-03-10 01:08:00 -03:00
Grzegorz Kowal
de3d89bb1b FORCE: implement and use Fourier transform of velocity.
- we need to calculate Fourier transform of velocity for all forcing
   components in order to minimize the velocity-force correlation;
2011-03-07 00:08:31 -03:00
Grzegorz Kowal
16b550e765 FORCE: update momenta due to forcinf only once.
- do not put forcing terms in the RK substeps; instead, update the
   momenta components only once before executing the Riemann solver and
   update step;
2011-03-06 23:37:51 -03:00
Grzegorz Kowal
2682d37d20 Update the copyright information. 2011-02-27 22:45:54 -03:00
Grzegorz Kowal
3bd4868bb2 EVOLUTION: take resistivity timestep condition into account. 2010-12-14 17:29:38 -02:00
Grzegorz Kowal
da8d2fee81 EVOLUTION: include forcing terms in the RK3 integration. 2010-12-09 17:54:59 -02:00
Grzegorz Kowal
04a3f6a4ba EVOLUTION: add forcing terms in the RK2 update. 2010-12-08 21:55:45 -02:00
Grzegorz Kowal
cb0c67faff EVOLUTION: add forcing terms in the block update. 2010-12-08 21:48:43 -02:00
Grzegorz Kowal
ac2a969636 EVOLUTION: evolve the forcing source terms.
- call subroutine evolve_forcing() before the update of all blocks;
   this subroutine evolves the forcing source terms by an interval dt in
   the Fourier space; then during the update the forcing Fourier
   coefficients will be transformed to real space for each block
   separately;
2010-12-08 18:19:16 -02:00
Grzegorz Kowal
41e44779e5 Revert "INTERPOLATION: pass the spacial increment to reconstruct()."
This reverts commit d92ae5d3a62743b66e97c42be4aa5f31ef5993d1.
2010-12-06 16:20:49 -02:00
Grzegorz Kowal
d92ae5d3a6 INTERPOLATION: pass the spacial increment to reconstruct().
- pass the spacial increment to the reconstruction subroutine since
   some interpolation methods require it; in addition, move obtaining
   the spacial interval and its inversion to the subroutine update();
2010-12-06 16:09:09 -02:00
Grzegorz Kowal
637be3ac0c EVOLUTION: reduce cmax instead of dt.
- now we reduce the maximum speed over all processors instead of the
   time step;
2010-12-03 18:02:07 -02:00
Grzegorz Kowal
a59f23fb0a EVOLUTION: implement the 3rd order RK method.
- implement the 3rd order Runge-Kutta time integration;
 - rewrite slightly the 2nd order Runge-Kutta method;
2010-12-03 15:38:48 -02:00
Grzegorz Kowal
c65688aaf4 EVOLUTION, GLM-MHD: update Psi after all RK substeps.
- the scalar potential is updated after each Runge-Kutta substep now;
2010-12-01 15:23:27 -02:00
Grzegorz Kowal
c08cf9e98b EVOLUTION: remove unused subroutines.
- remove subroutine advance(); this subroutine is good for GALERKIN
   approach; it's gonna be reintroduced during this method
   implementation;
 - remove subroutine update_flux(); this subroutine is called from
   advance() and is not used in the GLM-MHD approach;
 - make GNU Fortran happy bu adding () to the subroutine calls;
2010-12-01 15:14:07 -02:00
Grzegorz Kowal
c220a578b0 SCHEME: move cmax parameter from module 'evolution' to 'scheme'. 2010-12-01 13:13:27 -02:00
Grzegorz Kowal
9eef6af9b4 GLM-MHD: implement Psi decay due to a source term.
- the scalar potential Psi evolution is controlled by a dissipative
   source term; include this update using a simple analytical solution;
2010-12-01 11:20:25 -02:00
Grzegorz Kowal
87b8225b55 GLM-MHD: take into account the maximum speed in update.
- the divergence of B propagates with the maximum speed c_h; take it
   into account while updating the solution for the scalar potential
   Psi;
2010-12-01 10:57:40 -02:00
Grzegorz Kowal
166adf0e64 GLM-MHD: update global solution.
- update the magnetic field components and scalar potential in the
   Euler and RK2 methods, evolve_euler() and evolve_rk2() subroutines,
   respectively;
2010-12-01 10:53:21 -02:00
Grzegorz Kowal
71d20ced15 EVOLUTION: add subroutine to update the maximum speed.
- make the variable cmax global in the module 'evolution';
 - add a new subroutine update_maximum_speed() which updates the maximum
   speed cmax in the system iterating over all data blocks;
 - use the subroutine update_maximum_speed() in evolve();
2010-12-01 10:39:18 -02:00
Grzegorz Kowal
226c2a3fe9 Move variable indices to new module 'variables'.
VARIABLES

 - create new module 'variables' which stores references to variable
   indices; we gonna store dofferent objects related to variables in
   this module;
2010-12-01 09:25:30 -02:00
Grzegorz Kowal
aab8831bbf Update the copyright info and fix the length of separating lines. 2010-10-13 03:32:10 -03:00