Difference between revisions of "ConsistentUnits Command"

From OSUPDOCS
Jump to navigation Jump to search
Line 7: Line 7:
If an input file has no <tt>ConsistentUnits</tt> command, the input file is assumed be using "Legacy" units. To convert to using any set of consistent, metric units, the file should add one <tt>ConsistentUnits</tt> command. In scripted files, the command is:
If an input file has no <tt>ConsistentUnits</tt> command, the input file is assumed be using "Legacy" units. To convert to using any set of consistent, metric units, the file should add one <tt>ConsistentUnits</tt> command. In scripted files, the command is:


  ConsistentUnits (length),(mass),(time)
  ConsistentUnits <(length),(mass),(time)>


and this command must be used before the [[Analysis Command]].
and this command must be used before the [[Analysis Command]]. In <tt>XML</tt> files, the units are selected in the <tt>Header</tt> element using:


The <tt>ConsistentUnits</tt> command is currently not supported for scripted input files. The problem is that the tools that create such files ([[NairnFEAMPM]] and [[NairnFEAMPMViz]]) enforce their own units that are currently incompatible with consistent units settings. This situation will change in the fuiture.
<ConsistentUnits length='(length)' mass='(mass)' time='(time)/>


Altthough visualization tools cannot create input files using consistent units, they can read (and correctly interpret) output from simulations generated from raw <tt>XML</tt> files that use consistent. The units are selected in the <tt>Header</tt> element of <tt>XML</tt> files using:
where the the parameters in scripted command (and attributes in <tt>XML</tt> command) are:


<ConsistentUnits length='(units)' mass='(units)' time='(units)/>
* <tt>(length)</tt> can be km, m, dm cm, mm um (or microns), or nm
* <tt>(mass)</tt> can be kg, g, mg, or ug
* <tt>(time)</tt> can be s (or sec), ms (or msec), or us


where the <tt>(units)</tt> settings determine metric units as follows:
In scripted files, you must provide all three parameters or none, where providing none will assume SI units of "m", "kg", and "s". If attributes are missing in <tt>XML</tt> files, they will be labeled as generic units of "L" for length, "M" for mass, and "T" for time.


* <tt>length</tt> can be km, m, dm cm, mm um (or microns), or nm
When running with consistent units, you must make sure all other input commands and material properties are entered using the chosen units. When visualizing results in this system (''i.e.'', using
* <tt>mass</tt> can be kg, g, mg, or ug
[[NairnFEAMPM]] and [[NairnFEAMPMViz]]), the visualization tools will read the units mode and display results in valid units (some options in those tools let you change the units used to display results). If you are visualizing results with third-party tools, the output results will be in the same consistent units used for input commands. A problems with using generic units (L, M, and T) is the output files have no documentation of units assumed for the calculations.
* <tt>time</tt> can be s (or sec), ms (or msec), or us
 
Alternatively, if none of the length, mass, and time attributes are provided, the code will run with generic units for length (L), mass (M), and time (T). The default (if this command is not used) is to use "Legacy Units". If this command is used, you must specify all three attributes or specify none (to use generic units).


== Legacy and Consistent Units ==
== Legacy and Consistent Units ==

Revision as of 07:58, 9 October 2017

Introduction

NairnFEA and NairnMPM were initially developed using a specific set of units. The internal calculations were (for the most part) based on mm-g-seconds units (although there were some exceptions). The units for input of properties and output of results also usually followed this system, but not always. With the addition of the ConsistentUnits command (available since NairnFEA version 5, NairnMPM version 11, and OSParticulas version 2) all code can now be run in a new mode where input and output use consistent units and the user can specify any metric system of units. The old mode (which is still available) is called "Legacy Units" while the new mode is called "Consistent Units."

ConsistentUnits Command

If an input file has no ConsistentUnits command, the input file is assumed be using "Legacy" units. To convert to using any set of consistent, metric units, the file should add one ConsistentUnits command. In scripted files, the command is:

ConsistentUnits <(length),(mass),(time)>

and this command must be used before the Analysis Command. In XML files, the units are selected in the Header element using:

<ConsistentUnits length='(length)' mass='(mass)' time='(time)/>

where the the parameters in scripted command (and attributes in XML command) are:

  • (length) can be km, m, dm cm, mm um (or microns), or nm
  • (mass) can be kg, g, mg, or ug
  • (time) can be s (or sec), ms (or msec), or us

In scripted files, you must provide all three parameters or none, where providing none will assume SI units of "m", "kg", and "s". If attributes are missing in XML files, they will be labeled as generic units of "L" for length, "M" for mass, and "T" for time.

When running with consistent units, you must make sure all other input commands and material properties are entered using the chosen units. When visualizing results in this system (i.e., using NairnFEAMPM and NairnFEAMPMViz), the visualization tools will read the units mode and display results in valid units (some options in those tools let you change the units used to display results). If you are visualizing results with third-party tools, the output results will be in the same consistent units used for input commands. A problems with using generic units (L, M, and T) is the output files have no documentation of units assumed for the calculations.

Legacy and Consistent Units

The original system of units is called "Legacy Units" while the new method is called "Consistent Units." The Legacy units can still be used (to allow backward compatibility of old input files) and it corresponds to any input file that omits the ConsistentUnits command. The units required when using "Legacy Units" and in the second column. The units required for "Generic" units and for some common "Consistent Units" systems are in the remaining columns (note that you can use any metric consistent units are are not limited to those listed in the table). When this documentation refers to units, it will refer to units class by name in the first column. You can refer to this table to see the units needed for "Legacy" units or for various sets of consistent units.


UnitLegacyConsistentSImmgscgs
LengthmmLmmmcm
MassgMkggg
Densityg/cm3M/L3kg/m3g/mm3g/cm3
TimesTsss
Alt TimemsTsss
Velocitymm/sL/Tm/smm/scm/s
Alt Velocitym/sL/Tm/smm/scm/s
Accelerationmm/s2L/T2m/s2mm/s2cm/s2
ForceNF = M-L/T2NμNdyne
PressureMPaP = F/L2PaPaBa
Linear MomentumN-sp = M-L/TN-sμN-sdyne-s
Alt Strain%nonenonenonenone
EnergyJE = F-LJnJerg
Alt EnergyμJE = F-LJnJerg
TorqueJt = F-LJnJerg
Angular MomentumJ-st = F-L-TJ-snJ-serg-s
Energy ReleaseJ/m2E/L2 J/m2nJ/mm2erg/cm2
Stress IntensityMPa-m0.5P-L0.5 Pa-m0.5Pa-mm0.5Ba-cm0.5
ViscositycPoiseP-TPa-sPa-sPoise
Diffusionmm2/sL2/Tm2/smm2/scm2/s
Solvent Fluxkg/(m2-s)M/(L2-T)kg/(m2-s)g/(mm2s)g/(cm2-s)
ConductivityW/(m-K)E/(L-K-s)W/(m-K)nW/(mm-K)erg/(cm-K-s)
Heat CapacityJ/(kg-K)E/(M-K)J/(kg-K)nJ/(g-K)erg/(g-K)
Heat FluxW/m2E/L2W/m2nW/mm2erg/cm2
Heat of FusionJ/kgE/MJ/kgnJ/gerg/g