[FLASH-USERS] Changing the system of units

Aaron Froese aaron.froese at generalfusion.com
Fri Aug 5 18:33:55 EDT 2011


Hi Sean,

The two runtime parameters that determine what unit system the solver works in are

UnitSystem = "CGS" or "SI"
pc_unitsbase = "CGS" or "MKS"

In most of the initialization routines, these parameters are read and then used to calculate constant factors.  In Hydro_init.F90, for example:

call RuntimeParameters_get("UnitSystem",          hy_units)

if ( hy_units == "SI" .or. hy_units == "si" ) then
    hy_bref = hy_vref*sqrt(4.0*PI*hy_dref*1.e-7)
else if ( hy_units == "CGS" .or. hy_units == "cgs" ) then
    hy_bref = hy_vref*sqrt(4.0*PI*hy_dref)
else
    hy_bref = hy_vref*sqrt(hy_dref)
end if

As you can see, only CGS and SI are provided in the distribution copy, so changing the solver to use parsecs, solar masses, and mega years would require additional coding.  I think it would be simpler to convert the simulation results from CGS or SI in post-processing.

Cheers,
Aaron


________________________________________
From: flash-users-bounces at flash.uchicago.edu [flash-users-bounces at flash.uchicago.edu] On Behalf Of flash-users-request at flash.uchicago.edu [flash-users-request at flash.uchicago.edu]
Sent: Monday, August 01, 2011 10:00 AM
To: flash-users at flash.uchicago.edu
Subject: flash-users Digest, Vol 46, Issue 1

Send flash-users mailing list submissions to
        flash-users at flash.uchicago.edu

To subscribe or unsubscribe via the World Wide Web, visit
        http://flash.uchicago.edu/mailman/listinfo/flash-users
or, via email, send a message with subject or body 'help' to
        flash-users-request at flash.uchicago.edu

You can reach the person managing the list at
        flash-users-owner at flash.uchicago.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of flash-users digest..."


Today's Topics:

   1.  Changing the system of units (Sean Lynch)


----------------------------------------------------------------------

Message: 1
Date: Mon, 1 Aug 2011 12:53:34 -0400
From: Sean Lynch <sean.m.lynch at drexel.edu>
Subject: [FLASH-USERS] Changing the system of units
To: flash-users <flash-users at flash.uchicago.edu>
Message-ID: <11522DB1-D682-4A7C-A9D8-7AB6B7D92791 at drexel.edu>
Content-Type: text/plain; charset=us-ascii

Hello,

I'm trying to set up a simulation that uses parsec, solar mass, and mega year as the base units. I know that I can use PhysicalConstants_get to convert a constant to the correct units. But how would I go about getting the solvers to use the correct units. For instance, how would I make sure that the eos unit is using the correct value of the gas constant, or that the gravity solver is using the correct value of G.

Thanks for your help.

-Sean

------------------------------

_______________________________________________
flash-users mailing list
flash-users at flash.uchicago.edu
http://flash.uchicago.edu/mailman/listinfo/flash-users


End of flash-users Digest, Vol 46, Issue 1
******************************************



More information about the flash-users mailing list