[FLASH-USERS] adding a new variable in FLASH4

Papatheodore, Thomas Leslie tpapathe at utk.edu
Tue Aug 28 16:38:19 EDT 2012


Hey Sean,

The variable is intended to store the maximum pressure reached at all spatial points over all time in the simulation. So if the pressure at a particular point is greater than the previous maximum at that point, then the maximum pressure variable would be updated to the new value. I will need the output of pressure at each timestep in each zone in order to determine whether or not to replace the current maximum.

This maximum pressure data will then be visualized using VisIt so I thought that adding an Unk variable would automatically add it to the list of variables that are sent to checkpoint files.

Would you still proceed in the manner that you described?

Thanks again for you help,

Tom

________________________________
From: Sean Couch [smc at flash.uchicago.edu]
Sent: Tuesday, August 28, 2012 9:13 AM
To: Papatheodore, Thomas Leslie
Cc: flash-users at flash.uchicago.edu
Subject: Re: [FLASH-USERS] adding a new variable in FLASH4

Hi Tom,

What is this variable intended for? Is it really input/output for EOS calls?  If it is meant to store the maximum pressure across the whole domain at a given time, then you do not need to create an extra Unk variable.  If you do indeed need the new variable, you do not need to (and really should not) modify the PPM config file.  Instead, modify your Simulation Config (for instance, if you are using Cellular, edit source/Simulation/SimulationMain/Cellular/Config).  You need only to add the following to the Config file:

VARIABLE mprs

You do not need to specify an EOSMAP for this variable if it will not be input/output for EOS calls.

If you just want the max pressure across the domain, the best approach is to make a copy of IO_writeIntegralQuantities.F90 in your Simulation directory (i.e., source/Simulation/SimulationMain/Cellular) if one doesn't already exist.  Then simply add the check for the maximum pressure in the main i,j,k loop in this file and do an AllReduce following the loop to get the maximum across the domain.  No need for an extra Unk variable.

In general, I would avoid editing the EOS Config files and variable mapping at all cost.

Hope this helps,
Sean


------------------------------------------------------
Sean M. Couch
Hubble Fellow
Flash Center for Computational Science
Department of Astronomy & Astrophysics
University of Chicago
5747 S. Ellis Ave., Jo 315
Chicago, IL, 60637
773-702-3899 (office)

On Aug 27, 2012, at 4:27 PM, "Papatheodore, Thomas Leslie" <tpapathe at utk.edu<mailto:tpapathe at utk.edu>> wrote:

Hello,

I'm trying to add a new variable into FLASH but I have been unsuccessful. The simulation I'm running is a modified version of the Cellular problem (the hydrodynamics are evolved using split PPM and the equation of state is Helmholtz).

The following is my attempt at adding a variable:



In the file source/physics/Hydro/HydroMain/split/PPM/Config I have added the line

VARIABLE mprs        EOSMAP: MPRS  # maximum pressure



In the file source/physics/Eos/Eos.h I have added the lines

basic EOS_MPRS Maximum pressure

#define EOS_MPRS 10

and changed

quantity EOS_VARS 9    to read  quantity EOS_VARS 10

quantity EOS_NUM 22  to read  quantity EOS_NUM 23

#define EOS_VARS 9   to read  #define EOS_VARS 10

#define EOS_NUM 22  to read  #define EOS_NUM 23



In the file source/physics/Eos/EosMain/Eos_map.h I have added the following lines

EOSMAP_MPRS Maximum pressure

#define EOS_MAP MPRS 27

and changed

#define EOSMAP_NUM_ROLES 26   to read  #define EOSMAP_NUM_ROLES 27



The error that I receive after running the setup script (./setup problem_name -auto) is the following:

Bad syntax: file physics/Hydro/HydroMain/split/PPM/Config, line 24:
VARIABLE mprs                   EOSMAP:  MPRS  # maximum pressure

input doesn't match regular expression "VARIABLE\s+(?P<varname>\w+)(\s+)?(?:(TYPE:\s*(?P<type>GENERIC|PER_VOLUME|PER_MASS)|EOSMAP(INOUT)?:\s*(?P<eosmap>pres|PRES|dens|DENS|eint|EINT|temp|TEMP|gamc|GAMC|game|GAME|ener|ENER|velx|VELX|vely|VELY|velz|VELZ|sumy|SUMY|ye|YE|entr|ENTR|pres1|PRES1|pres2|PRES2|pres3|PRES3|eint1|EINT1|eint2|EINT2|eint3|EINT3|temp1|TEMP1|temp2|TEMP2|temp3|TEMP3|e1|E1|e2|E2|e3|E3|sele|SELE)|EOSMAPIN:\s*(?P<eosmapin>pres|PRES|dens|DENS|eint|EINT|temp|TEMP|gamc|GAMC|game|GAME|ener|ENER|velx|VELX|vely|VELY|velz|VELZ|sumy|SUMY|ye|YE|entr|ENTR|pres1|PRES1|pres2|PRES2|pres3|PRES3|eint1|EINT1|eint2|EINT2|eint3|EINT3|temp1|TEMP1|temp2|TEMP2|temp3|TEMP3|e1|E1|e2|E2|e3|E3|sele|SELE)|EOSMAPOUT:\s*(?P<eosmapout>pres|PRES|dens|DENS|eint|EINT|temp|TEMP|gamc|GAMC|game|GAME|ener|ENER|velx|VELX|vely|VELY|velz|VELZ|sumy|SUMY|ye|YE|entr|ENTR|pres1|PRES1|pres2|PRES2|pres3|PRES3|eint1|EINT1|eint2|EINT2|eint3|EINT3|temp1|TEMP1|temp2|TEMP2|temp3|TEMP3|e1|E1|e2|E2|e3|E3|sele|SELE))\s*)*\s*$"

If anyone is familiar with adding new variables, your help would be greatly appreciated.

Thanks,

Tom

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20120828/73ac8a35/attachment.htm>


More information about the flash-users mailing list