Changes between Version 20 and Version 21 of ModulesOnAstroBear


Ignore:
Timestamp:
07/13/11 15:20:50 (14 years ago)
Author:
ehansen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • ModulesOnAstroBear

    v20 v21  
    7777Currently, AstroBEAR can only run 2D and 3D problems, but a 1D hydro or MHD problem can be simulated by defining a very narrow 2D problem domain and then making sure all the activity is defined in the x-direction (i.e., no {{{py}}} or {{{pz}}} components).
    7878
    79 The ''core'' region of the {{{Info%q}}} array (which does not include ghost zones) is a {{{1:mx}}} by {{{1:my}}} by {{{1:mz}}} box. Mx, my, and mz denote the number of cells in the x, y, and z directions, respectively.  In two dimensions, {{{mz}}} = 1, reducing the box to a rectangle.  {{{Info%q}}} is cell-centered, so the values are assumed to be taken from the midpoint of the cell.  Thus, the cell-to-space conversion is:
     79The ''core'' region of the {{{Info%q}}} array (which does not include ghost zones) is a {{{1:mx}}} by {{{1:my}}} by {{{1:mz}}} box. mx, my, and mz denote the number of cells in the x, y, and z directions, respectively.  In two dimensions, {{{mz}}} = 1, reducing the box to a rectangle.  {{{Info%q}}} is cell-centered, so the values are assumed to be taken from the midpoint of the cell.  Thus, the cell-to-space conversion is:
    8080
    8181{{{
    8282x=(xlower + (REAL(i,xPrec)-half) * dx)
    83 y=(ylower + (REAL(j,xPrec)-half) * dy)
    84 z=(zlower + (REAL(k,xPrec)-half) * dz)
     83y=(ylower + (REAL(j,xPrec)-half) * dx)
     84z=(zlower + (REAL(k,xPrec)-half) * dx)
     85}}}
     86
     87Note that {{{i, j, k, x, y, z, xlower, ylower, zlower, and dx}}} are user defined variables and are explained in further detail below. The variable {{{half}}} is used since the data is in the center of the cell, and {{{xPrec}}} is a type of precision.  {{{half}}} and {{{xPrec}}} are already defined elsewhere and can be used if the following statement is at the beginning of {{{problem.f90}}}:
     88{{{
     89USE GlobalDeclarations
    8590}}}
    8691
     
    116121==== Initializing a Grid ====
    117122
    118 Initializing a grid  involves taking a spatially-constructed problem setup and discretizing it so that it fits nicely in an array.  This process is easiest to explain by dissecting an example, such as the one below, where we are trying to initialize the grid with a density distribution given by {{{rho(x,y,z)}}}:
    119 
    120 Note that during the !ProblemGridInit routine, ghost zones do not need to be initialized (rmbc = 0) - however - during beforestep calculations they should be
     123Initializing a grid  involves taking a spatially-constructed problem setup and discretizing it so that it fits nicely in an array.  This process is easiest to explain by dissecting an example, such as the one below, where we are trying to initialize the grid with a general density distribution given by {{{rho(x,y,z)}}}:
     124
     125Note that during the !ProblemGridInit routine, ghost zones do not need to be initialized (rmbc = 0) - however - during beforestep calculations they should be.
    121126
    122127{{{
     
    140145            DO i=1-rmbc, mx+rmbc
    141146
    142                 x=(xlower + (REAL(i)-half) * dx)
    143                 y=(ylower + (REAL(j)-half) * dx)
    144                 z=(zlower + (REAL(k)-half) * dx)
     147                x=(xlower + (REAL(i, xPrec)-half) * dx)
     148                y=(ylower + (REAL(j, xPrec)-half) * dx)
     149                z=(zlower + (REAL(k, xPrec)-half) * dx)
    145150
    146151                Info%q(i,j,k,irho) = rho(x,y,z)