115 Commits

Author SHA1 Message Date
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
Grzegorz Kowal
96ed98a636 Change the boundary subroutines names.
BOUNDARIES

 - change the name of subroutine boundary() to boundary_variables();
 - change the name of subroutine boundary_flux() to boundary_fluxes();
2010-09-19 14:33:57 +02:00
Grzegorz Kowal
7b48386610 Remove flux calculation from the subroutine update().
SCHEME

 - remove the flux calculation from the subroutine update() and all dependent
   subroutines;
2010-09-19 00:08:20 +02:00
Grzegorz Kowal
ed88bc2526 First step of implementation of time advance using new method.
BLOCK STRUCTURE

 - add new array to the data block structure to store the electromotive
   force components; these components are located at the centers of cell
   edges, in this way the CT update of the staggered magnetic field
   component will be easier;

EVOLUTION

 - add new subroutine advance() which performs several steps in order to
   advance the solution in time by one-step update; the substeps are the
   updates of the numerical flux, the flux boundary, the advance in time
   the solution, the updates of mesh structure, and the boundaries of
   conserved variables, and finally the new time step estimation;

 - add new subroutine update_flux() to update the numerical fluxes
   stored in the data blocks;

SCHEME

 - add new subroutine numerical_flux() to calculate fluxes at the proper
   locations;

 - add new logical argument to HLL and HLLC in order to specify if the
   flux should be returned as a numerical flux or its derivative;
2010-07-27 19:26:15 -03:00
Grzegorz Kowal
0b62ce8c35 Update the array of fluxes and send it out of the update.
EVOLUTION

 - add new output argument returning the updated fluxes for each block;

SCHEME

 - update the fluxes from the one dimensional fluxes returned by the
   Riemann solver;
2010-07-26 21:12:40 -03:00
Grzegorz Kowal
9c861ff96d Use TVD interpolation in boundary update, update mesh before time step.
BOUNDARY CONDITIONS

  - use TVD interpolation for prolongation of the boundary conditions

CONFIGURATION

  - put lower limit for the number of ghost and domain cells

HOST FILES

  - host files should not be included in the revision control

INTERPOLATION

  - define all arrays as REAL, not REAL(KIND=8) since the precision of
    calculations is determined at the compilation stage

  - replace j0 and j1 indices with new more obvious il and ir

MESH

  - update mesh before calculating new time step
2010-03-14 15:40:24 -03:00
Grzegorz Kowal
88761c9622 Implement FLUXCT integration of the induction equation.
SCHEME

  - implement Flux-CT scheme for the staggered magnetic field
    integration;

BLOCK STRUCTURE

  - use more space efficient storage of the variables, which means
    storing only staggered components of magnetic field; cell-centered
    components are calculated only when necessary;

EVOLUTION

  - remove loops in the field updates; operations are performed on the
    arrays;

BOUNDARY CONDITIONS

  - remove loops in the bnd_copy; operations are calculated on the whole
    array now;

INTERPOLATION

  - subroutine magtocen() has been rewritten to avoid problems with the
    array allocation; now as an argument we enter the array of all
    variables; subroutine uses indices for the face-centered and
    cell-centered magnetic field components internally;

MAKE

  - add flag defining Flux-CT scheme;

PROBLEM

  - use predefined array variables instead of allocated;
2010-02-28 18:35:57 -03:00
Grzegorz Kowal
98849f3369 Prepare code for central differencing scheme for magnetic field. 2010-02-22 12:01:58 -03:00
Grzegorz Kowal
bbf998e4a0 Boundaries, interpolation, indices.
Rewritten boundaries allow for a proper handling boundaries between
blocks at different refinement levels. Prolongation and restriction of
the boundaries are improved now.

Rewritten interpolation for prolongation and restriction.

References to the variable indices are assigned more properly.
2010-02-11 23:30:46 -02:00
Grzegorz Kowal
beee9ee2d4 Initial support for the MHD equations.
VARIABLES

 - add indices for the magnetic field components, both face and cell
   centered

SOLVER, MHD

 - add support for the magnetohydrodynamic (MHD) equations to the
   subroutines cons2prim(), prim2cons()

 - add MHD flux and the fastest speed calculation in the subroutine
   fluxspeed()

 - include magnetosonic speed in the calculation of the maximum speed in
   the system required for estimation of the new time step

 - extend the HLL solver in subroutine hll() to support MHD

 - calculate the magnetic field update according to a CT scheme in the
   subroutine update()

INTERPOLATION

 - add subroutine magtocen() to interpolate cell centered magnetic field

EVOLUTION

 - add evolution of the magnetic field components in the evolve_euler()
   and evolve_rk2() time integration subroutines

 - also call the subroutine magtocen() in the right places

BOUNDARY CONDITIONS

 - support for magnetic field boundary update only in the case of blocks
   with the same level so far; later we need to include proper
   restriction and prolongation for the magnetic field to keep its
   divergence equal zero

PROBLEMS, BLAST

 - extend the blast problem to include the initial magnetic field

IO, HDF5

 - write down in a HDF5 file magnetic field components
2009-10-28 00:12:18 -02:00
Grzegorz Kowal
0924f90bd7 Implement mesh update uniprocessors and MPI-friendly.
MESH STRUCTURE

 - subroutine mesh_update() performs refinement/derefinement of blocks
   using new structures of meta and data blocks; it is implemented for
   to be MPI friendly as well

 - update subroutine derefine_block() to use new structures of meta and
   data blocks

 - update subroutines restrict_block() and prolong_block() to use new
   meta and data structures
2009-09-21 16:57:34 -03:00
Grzegorz Kowal
25d035fd68 Fix prolongation of the boundary conditions.
BOUNDARY CONDITIONS

 - fix prolongation of the boundary conditions
 - use the same subroutines for the uniprocessor and MPI version
   boundaries
2009-09-21 01:12:32 -03:00
Grzegorz Kowal
f399274574 Finish implementing proper handling of boundary conditions for MPI.
BOUNDARY CONDITIONS

 - using a list of info blocks the implementation of boundary conditions
   for neighbor blocks laying on different processors is successfully
   completed; it is simpler and more clear than the previous
   implementation
2009-09-18 20:34:23 -03:00
Grzegorz Kowal
ac188d32e4 Divide blocks among processors. Initial work on boundaries.
BLOCK STRUCTURE: MPI

 - divide initial block structure between all processors and remove
   non-local data blocks

DATA I/O

 - dump the total number of blocks and the number of data blocks

BOUNDARY CONDITIONS

 - initial work on the boundary condition for new structure of blocks
2009-09-14 19:15:21 -03:00
Grzegorz Kowal
bf5e332ce1 Evolve new list of data blocks.
TIME INTEGRATION

 - now update the solution using new list of data blocks belonging to
   the current process only
2009-09-14 18:28:17 -03:00
Grzegorz Kowal
7827e60f30 Rework subroutine refine_block() to use new meta and data blocks. 2009-09-11 21:52:18 -03:00
Grzegorz Kowal
c216adb422 First approach to implement MPI refinement.
It seems to be pretty complex. So far I collect blocks selected for
refinement which have neighbors laying on other processors. Using this I
set the neighbors from other processors for refinement if required. The
remaining things are the neighbors update after refinement and MPI
version of derefinement.
2009-01-03 22:49:04 -06:00
Grzegorz Kowal
c686e301fc Fix boundary update and reduce the next time step over all CPUs.
The boundary conditions finally works when using MPI with arbitrary
number of processors. This is however a dirty hack. Has to be done in a
better way later, since now it may be very tricky to generalize the code
to 3D.

The next time step should be reduced to the minimum value over all
processes. This has been added in subroutine 'evolution' now.

The block structure contains a new field %pos which specifies the
position of the child block in its parent.
2009-01-02 20:18:57 -06:00
Grzegorz Kowal
6c620a97cf Implement boundary block exchange between processes.
Now, in the boundary subroutine we collect information about the blocks
which neighbors lay on a different processor. Using this information we
send neighboring blocks and update the block boundaries. This is the
initial implementation, not very well optimized and containg some bugs.
2008-12-31 12:02:36 -06:00
Grzegorz Kowal
1aa75ac2ef Change the leaf field of the block to be logical.
This change should speed up a bit the conditions, since it is faster
than the character comparisons.
2008-12-19 00:02:05 -06:00