<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Bob<br>
    <br>
    Yes, you are absolutely correct that this setup does lead to
    numerical difficulties of the type you mention. I have previously
    run this simulation using the code PLUTO. This was using the
    Divergence cleaning method and not CT. The results are stable with
    minimal pollution of the solution outside the star (I'm only
    interested in the dynamics of the wind).<br>
    <br>
    Your suggestion of moving the interior boundary to the surface of
    the star I'm guessing would involve using
    Simulation_defineDomain.F90 to remove the blocks inside the stellar
    radius? This sounds like a plan. However, reading the source code
    and the guide, it is a bit opaque how boundary conditions are then
    applied to the removed blocks. The surface of my star is revealed by
    successively refining blocks. If I'm removing hole blocks from the
    simulation, and one block is comparable in size to my star, this my
    not work.<br>
    <br>
    I may try using your suggestion of raising the density in the star
    to freeze in the field. 
<br>
    <br>
    In all honesty, after using PLUTO for a couple of years, I was
    curious to see what other established codes could do, so if I can't
    get this working in FLASH, never mined.<br>
    <br>
    Thank you for your help.<br>
    <br>
    Simon<br>
    <br>
    <div class="moz-cite-prefix"><br>
      On 24/04/2017 11:56, Robert Fisher wrote:<br>
    </div>
    <blockquote
cite="mid:CAD40uowEXqYkBnjV_LAhu5YjiqXR4ypi5ALuRgJcEeabG9f8Sg@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi Simon :
        <div><br>
        </div>
        <div>  You raise a number of interesting technical points, but I
          would advise you to reconsider the setup itself. A key problem
          in numerical MHD is to ensure the satisfaction of the div . B
          = 0 constraint, and by overwriting the interior solution you
          will surely be breaking the constraint along the surface of
          the star, leading to the development of numerical monopoles.
          These monopoles will in turn create forces along the field
          lines, which will corrupt the solution.</div>
        <div><br>
        </div>
        <div>  Perhaps you could consider moving the interior boundary
          to the surface of the star, and specifying the field as a
          boundary condition there. Alternatively you could also reduce
          the magnetic wave speeds within the star (e.g. by increasing
          the density) to such a great extent that the field within the
          star will be effectively completely frozen over the duration
          of your simulation. Either will achieve the same result as
          what you are imposing by hand now, but while also maintaining
          div . B = 0.</div>
        <div><br>
        </div>
        <div>  Best wishes,</div>
        <div> </div>
        <div>  Bob</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Mon, Apr 24, 2017 at 6:25 AM, Simon
          Daley-Yates <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:sdaley@star.sr.bham.ac.uk" target="_blank">sdaley@star.sr.bham.ac.uk</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Flash
            users<br>
            <br>
            I'm in the process of putting together a simulation of a
            stellar wind based on parkers equation for the solar wind. I
            also need to put a dipole magnetic field on the star.<br>
            <br>
            I'm working in Cartesian coordinates and in the rotating
            frame of the star.
<br>
            <br>
            My problem requires the following:<br>
            <br>
            1/ The region inside the star (r < 1 R_star) needs to be
            held constant. To do this I am using the
            Simulation_adjustEvolution.F90 subroutine. <br>
            <br>
            2/ A point source gravity acceleration vector and
            acceleration due to Coriolis and centrifugal forces. I am
            doing both of these with the Gravity_accelOneRow.F90
            subroutine.<br>
            <br>
            3/ I would like to use the unsplit stagard mesh MHD method
            for the magnetic field.<br>
            <br>
            There are a number of different examples of setting up a MHD
            simulation in the source/Simulation/SimulationMa<wbr>in/magnetoMHD
            folder but they all use the method of setting initial
            conditions using the solnData(DENS_VAR,i,j,k) array and not
            the call Grid_putPointData(blockId, CENTER, DENS_VAR,
            EXTERIOR, axis, rhoZone) function call as recommended in the
            user guide pdf. Which is the correct method? <br>
            <br>
            Also, there are no examples for initialising the face
            centred variables i.e. face centred magnetic fields. Is this
            also done with call Grid_putPointData(blockId, CENTER,
            DENS_VAR, EXTERIOR, axis, rhoZone) method and is there an
            example? <br>
            <br>
            When holding the region inside the star constant, I'm
            assuming I need to also hold the magnetic field (cell
            centred and face centred) constant. When I do this the
            output for the magnitude of the magnetic field sqrt(magx**2
            + magy**2 + magz**2) is corrupted (please see attached
            figure).<br>
            <br>
            If anyone has had experience constructing this type of
            problem or they have any advice, it would be very
            appreciated.<br>
            <br>
            Many thanks in advance,<br>
            Simon<br>
            <br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div class="gmail_signature" data-smartmail="gmail_signature">
          <div dir="ltr">Dr. Robert Fisher<br>
            Associate Professor / Graduate Program Director<br>
            University of Massachusetts/Dartmouth<br>
            Department of Physics<br>
            285 Old Westport Road<br>
            North Dartmouth, Massachusetts 02747<br>
            <a moz-do-not-send="true"
              href="mailto:robert.fisher@umassd.edu" target="_blank">robert.fisher@umassd.edu</a><br>
            <a moz-do-not-send="true" href="http://www.novastella.org"
              target="_blank">http://www.novastella.org</a></div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>