170 Commits

Author SHA1 Message Date
Grzegorz Kowal
db478af9e4 Add new global variables to the configuration.
CONFIGURATION

 - add two new variables which determined the half and the double of
   the ghost cell size (nh and nd, respectively);
 - add a variable to determine the half size of the block (ih, jh, and
   kh);
2010-09-18 11:50:24 +02:00
Grzegorz Kowal
d54b57e1eb Cosmetic change in subroutine allocate_datablock() in blocks.F90. 2010-09-18 11:44:46 +02:00
Grzegorz Kowal
b6dc6095ac Make GNU compiler happy and fix indexing of emf. 2010-09-18 11:42:09 +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
a2a7fbf3c4 Add a field for storing fluxes in the blocks.
BLOCK STRUCTURE

 - add a multidimensional array to store the numerical fluxes in the
   block structure; it seems that this is necessary for the boundary
   update, since the fluxes should be synchronized between blocks at
   different levels;
2010-07-26 20:46:45 -03:00
Grzegorz Kowal
f12c32a5af Rewrite the subroutine bnd_prol() to use expand_tvd().
INTERPOLATION

 - add subroutine expand_tvd() to prolongate a multidimensional array
   using the second-order TVD interpolation (subroutine
   expand_1d_tvd());

BOUNDARY CONDITIONS

 - rewrite the subroutine bnd_prol() in order to minimize the size of
   interpolated arrays and use the subroutine expand_tvd();
2010-07-20 15:37:22 -03:00
Grzegorz Kowal
b9dd7d97e8 Remove unnecessary argument from bnd_copy() subroutine.
BOUNDARY CONDITIONS

 - if the blocks are on the same level there is no need for iteration
   over the faces; remove the argument iface from the subroutine
   bnd_copy() since it is not used;
2010-07-20 11:39:23 -03:00
Grzegorz Kowal
ea448122be We don't need to iterate over levels in the boundary update.
BOUNDARY CONDITIONS

 - the boundaries should be updated in the directional manner, i.e.
   first the update of all blocks along the X direction, then along the
   Y direction, and finally along the Z direction; this assures the
   proper boundary zones update;

 - in the boundary update there is no reason for the iteration over the
   levels if the boundary update is happening in the directional manner;
2010-07-20 11:33:24 -03:00
Grzegorz Kowal
26e103ce86 Rewrite subroutine restrict_block.
MESH

 - subroutine restrict_block has been rewritten to use one big array for
   storage variables from all children and them restricting this array
   and putting resulted variables in a new data block;
2010-07-04 01:15:34 -03:00
Grzegorz Kowal
c057d098de Implement magnetic field prolongation with boundary.
INTERPOLATION

 - add subroutine expand_1d_tvd to 1D TVD prolongation;

 - implement magnetic field boundary prolongation with a given boundary;
   this is used for boundary update of magnetic components in a block at
   higher level, where the boundary is updated from the block at lower
   level; the prolongation is divergence free; for now only 2D case is
   implemented;

BOUNDARY CONDITIONS

 - use the boundary prolongation subroutine expand_mag_bnd in the
   updating the magnetic field boundaries in a blocks which neighbors
   are at lower level; this should be ready for 3D too;
2010-07-03 23:37:02 -03:00
Grzegorz Kowal
4dea14df91 Fix compilation when EOS=ISO.
IO

 - obtain indices ipr and ien only when we use adiabatic equation of
   state;

PROBLEM

 - obtain indices ien and ipr only when EOS=ADI;
 - in the case of isothermal EOS define initial star as an increase of
   density instead of pressure;
 - in checking the refirement criterion use only density gradient when
   EOS=ISO;

SCHEME

 - obtain indices ipr and ien only when we use adiabatic EOS;
 - in function maxspeed() obtain parameter csnd2 in the case of
   isothermal equation of state;
2010-03-30 23:23:49 -03:00
Grzegorz Kowal
cc4e6e50bb Rewrite indices in subroutine bnd_copy().
BOUNDARY CONDITIONS

 - rewrite index calculation in subroutine bnd_copy();
2010-03-30 21:53:07 -03:00
Grzegorz Kowal
03f00b65d5 Add subroutine divergence() and use it in I/O.
INTERPOLATION

 - add a new subroutine divergence() calculating the divergence of a
   vector field;

IO

 - utilize a new subroutine divergence() in calculation of the
   divergence of staggered magnetic field;
2010-03-30 17:44:48 -03:00
Grzegorz Kowal
1dd934c606 More micro optimizations in subroutine magtocen(). 2010-03-30 16:11:23 -03:00
Grzegorz Kowal
9a2ce9cd41 Index micro optimizations in bnd_rest() and magtocen().
BOUNDARY CONDITIONS

 - micro optimizations of the indices in bnd_rest();

INTERPOLATION

 - micro optimizations of the indices in magtocen();
2010-03-30 16:07:29 -03:00
Grzegorz Kowal
024ead539f Implement divergence free correction in magtocen() for 3D case.
INTERPOLATION

 - in the subroutine magtocen() implement divergence free correction for
   the three dimensional case;
2010-03-22 16:36:14 -03:00
Grzegorz Kowal
81c241a76a Remove argument ng from all restriction subroutines.
BOUNDARY CONDITIONS

 - remove the third argument from all calls of the subroutine shrink();

INTERPOLATION

 - remove ng argument from subroutines shrink() and shrink_1d();
 - small fixes to subroutine magtocen() in the divergence free
   correction calculation;

MESH

 - fix index calculation and remove the third argument from calling the
   subroutine shrink();
2010-03-22 02:17:44 -03:00
Grzegorz Kowal
f035771f28 Fix divergence free prolongation and boundary conditions.
BOUNDARY CONDITIONS

 - update boundary conditions starting from the block with the maximum
   refinement level and stepping down; this fixes update of the
   boundary conditions in the corners;

INTERPOLATION

 - fix divergence free prolongation of the staggered magnetic field;
2010-03-21 19:05:29 -03:00
Grzegorz Kowal
aa1a0867bd Implement divergence-free reconstruction. Rewrite bnd_prol().
BOUNDARY CONDITIONS

 - rewrite subroutine bnd_prol() and use expand_mag() in it;

 - fix some index calculations in bnd_rest();

INTERPOLATION

 - implement new subroutine expand_mag() performing divergence-free
   prolongation of the staggered magnetic field;

 - implement divergence-free correction in interpolation of cell
   centered magnetic field in subroutine magtocen();

MESH

 - use new subroutine expand_mag() in block prolongation;
2010-03-21 11:54:54 -03:00
Grzegorz Kowal
7ea19cd486 Write down the divergence of B in the output files. 2010-03-14 21:16:34 -03:00
Grzegorz Kowal
d64c91be6b Rework indices in bnd_prol().
Now we use more intuitive calculation of the indices for boundary
conditions.
2010-03-14 20:53:26 -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
5a826f0107 Fix the enforcement of the number of ghost zones. 2010-03-08 21:16:21 -03:00
Grzegorz Kowal
6a2b6f6fbb Implement boundary conditions for staggered magnetic field.
BOUNDARY CONDITIONS

  - rewrite bnd_copy() so first the indices are prepared and then there
    is one call to fill out the destination array; include the lower
    index change for staggered magnetic field components;

  - in the subroutine bnd_rest() implement correct restriction of the
    staggered magnetic field components; take into account the change
    of the lower index;

  - in the subroutine bnd_prol() implement correct prolongation of the
    staggered magnetic field components; take into account the change of
    the lowe index;

  - by default use 2 ghost cell and the restriction and expansion to
    prevent errors resulting from interpolation;

CONFIGURATION

  - enforce a lower limit for number of ghost zones to 6 when MHD=Y and
    4 otherwise

INTERPOLATION

  - remove unnecessary interpolation methods

  - limit 'c' interpolation to the second order only

MESH

  - implement divergence-free prolongation and restriction for the
    staggered magnetic field components in the block refinement and
    derefinement
2010-03-08 19:09:49 -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
cab66e8fc3 Implement FIELD-CD scheme for magnetic field evolution. 2010-02-22 16:21:20 -03:00
Grzegorz Kowal
98849f3369 Prepare code for central differencing scheme for magnetic field. 2010-02-22 12:01:58 -03:00
Grzegorz Kowal
245c4aa52a Use the 1st order TVD prolongation. 2010-02-22 11:47:50 -03:00
Grzegorz Kowal
acd4d8d105 The 'l' and 'u' are handled by the default restriction. 2010-02-14 17:59:10 -02:00
Grzegorz Kowal
6b88835994 Update cell-centered magnetic field in prolongation/restriction.
MESH:

 After restriction/prolongation of the face-centered magnetic field we
need to interpolate also cell-centered field components.
2010-02-14 17:54:51 -02:00
Grzegorz Kowal
ea00024b65 Remove unnecessary dimension variable fm from bnd_prol(). 2010-02-12 15:38:05 -02:00
Grzegorz Kowal
25eee11a94 Reorganize interpolation. Set 'm' as default. 2010-02-12 04:13:55 -02:00
Grzegorz Kowal
1c8d37a333 Switch to a special geometry for 2D blast problem. 2010-02-12 00:05:02 -02: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
7bd227afda Implement Hilbert space filling curve for 3D. 2009-10-03 20:11:03 -03:00
Grzegorz Kowal
3747646780 Some arrays cannot be stored as attributes.
DATA I/O, HDF5

 - arrays of indices, levels, and the block bounds cannot be stored as
   attributes since they can easily exceed the allowed space for
   attributes; instead, they have to be stored as dataset, which
   overcome this limit

 - store the lowest level block dimensions as well
2009-09-30 20:23:35 -03:00
Grzegorz Kowal
719b40c77d Rewrite write_data() using more efficient storage.
IO, HDF5

 - rewrite subroutine write_data() using more efficient storage,
   especially with compression; we are storing only the domain part of
   blocks and their primitive variables, which is selected by setting
   ftype='p'; storing restart files with all parameters will be done
   later

BLOCKS,

 - remove array c(:,:,:) from data_block which stored the values for
   refinement/derefinement estimations
2009-09-30 16:28:17 -03:00
Grzegorz Kowal
36e2dbac40 Fix boundary restriction subroutine bnd_rest() for 3D. 2009-09-30 01:26:05 -03:00
Grzegorz Kowal
463be7ad77 Rewrite and add support for 3D to subroutine derefine_block(). 2009-09-29 17:19:26 -03:00
Grzegorz Kowal
dd8af20c86 Refine the first level if there is only one block.
MESH REFINEMENT, INITIAL GEOMETRY

 - if there is only one block and it is set not to be refined, refine it
   anyway to catch situations when the initial resolution is too small
   for the problem initiation
2009-09-29 16:17:10 -03:00
Grzegorz Kowal
ef0658a215 Add support for 3D in function check_ref(). 2009-09-29 15:56:25 -03:00
Grzegorz Kowal
35fb0cac4f There is no need for importing the block_data structure. 2009-09-29 15:37:31 -03:00
Grzegorz Kowal
671985874f Improve block prolongation and add support for 3D.
MESH STRUCTURE, REFINEMENT

 - subroutine prolong_block() has been completely rewritten; now it
   supports 2D and 3D boxes, and the calculation of bounds for the
   expanded array is automated now
2009-09-29 15:32:58 -03:00
Grzegorz Kowal
1fdf2b72ae Improve block restriction and add support for 3D.
MESH STRUCTURE, DEREFINEMENT

 - subroutine restrict_block() has been completely rewritten; now it
   supports 2D and 3D boxes, and the calculation of bounds for
   source and destination arrays is automated
2009-09-29 15:12:19 -03:00
Grzegorz Kowal
9cad26602f Fix prolongation of boundaries and add suport for 3D. 2009-09-28 18:41:30 -03:00
Grzegorz Kowal
6a862ea650 Improve restriction of boundaries and add support for 3D. 2009-09-27 17:45:48 -03:00
Grzegorz Kowal
53c47874ef Fix the case when boundaries are not periodic and we use MPI. 2009-09-27 03:07:23 -03:00
Grzegorz Kowal
c80833d56c Use specific domain initialization for blast problem for 2D only. 2009-09-26 15:44:25 -03:00