Difference between revisions of "ConsistentUnits Command"

From OSUPDOCS
Jump to navigation Jump to search
 
(42 intermediate revisions by the same user not shown)
Line 5: Line 5:
== ConsistentUnits Command ==
== ConsistentUnits Command ==


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.
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:


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:
ConsistentUnits <(length),(mass),(time)>


<ConsistentUnits length='(units)' mass='(units)' time='(units)/>
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:


where the <tt>(units)</tt> settings determine metric units as follows:
<ConsistentUnits length='(length)' mass='(mass)' time='(time)/>


* <tt>length</tt> can be km, m, dm cm, mm um (or microns), or nm
where the the parameters in scripted command (and attributes in <tt>XML</tt> command) are:
* <tt>mass</tt> can be kg, g, mg, or ug
* <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).
* <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
 
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.
 
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 ==
== 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 <tt>ConsistentUnits</tt> 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.
The following table lists possible units needed for entering parameters. The first column gives the name and its definition in terms of length (L), mass (M), time (T), and degrees Kelvin (K). The second column lists how to enter those terms in "Legacy" units mode. The third column lists SI or kg-m-s units. The remaining columns give consistent units for various units modes (you are not limited to these modes). To get a property in selected units mode, multiply SI-units property by factor in column for that mode. The "Alt" units entries only differ from their normal units when using "Legacy" mode. When inputting properties in "Legacy" units, all values are converted to the mm-g-s system for internal calculations (<i>i.e.</i>, input properties are scaled by ratio of mm-g-s column to Legacy column conversion factors).


<table border="1" cellpadding="2" cellspacing="0" width="90%" align="center">


<table border="1" cellpadding="2" cellspacing="0" width="90%" align="center">
<tr><th>Unit</th><th>Legacy</th><th>SI (kg-m-s)</th><th>mm-g-s</th><th>mm-g-ms</th><th>c-g-s</th><th>cm-&mu;g-&mu;s</th>
</tr>
 
<tr><td>Length (L)</td><td>x10<sup>3</sup>=mm</td><td>m</td><td>x10<sup>3</sup>=mm</td><td>x10<sup>3</sup>=mm</td><td>x10<sup>2</sup>=cm</td><td>x10<sup>2</sup>=cm</td>
</tr>


<tr><th>Unit</th><th>Legacy</th><th>Consistent</th><th>SI</th><th>mmgs</th><th>cgs</th>
<tr><td>Mass (M)</td><td>x10<sup>3</sup>=g</td><td>kg</td><td>x10<sup>3</sup>=g</td><td>x10<sup>3</sup>=g</td><td>x10<sup>3</sup>=g</td><td>x10<sup>9</sup>=&mu;g</td>
</tr>
</tr>


<tr><td>Length</td><td>mm</td><td>L</td><td>m</td><td>mm</td><td>cm</td>
<tr><td>Time (T)</td><td>s</td><td>s</td><td>s</td><td>x10<sup>3</sup>=ms</td><td>s</td><td>x10<sup>6</sup>=&mu;s</td>
</tr>
</tr>


<tr><td>Mass</td><td>g</td><td>M</td><td>kg</td><td>g</td><td>g</td>
<tr><td>Alt Time</td><td>x10<sup>3</sup>=ms</td><td>s</td><td>s</td><td>x10<sup>3</sup>=ms</td><td>s</td><td>x10<sup>6</sup>=&mu;s</td>
</tr>
</tr>


<tr><td>Density</td><td>g/cm<sup>3</sup></td><td>M/L<sup>3</sup></td><td>kg/m<sup>3</sup></td><td>g/mm<sup>3</sup></td><td>g/cm<sup>3</sup></td>
<tr><td>Density (M/L<sup>3</sup>) </td><td>x10<sup>-3</sup>=g/cm<sup>3</sup></td><td>kg/m<sup>3</sup></td><td>x10<sup>-6</sup>=g/mm<sup>3</sup></td><td>x10<sup>-6</sup>=g/mm<sup>3</sup></td><td>x10<sup>-3</sup>=g/cm<sup>3</sup></td><td>x10<sup>3</sup>=&mu;g/cm<sup>3</sup></td>
</tr>
</tr>


<tr><td>Time</td><td>s</td><td>T</td><td>s</td><td>s</td><td>s</td>
<tr><td>Velocity (L/T)</td><td>x10<sup>3</sup>=mm/s</td><td>m/s</td><td>x10<sup>3</sup>=mm/s</td><td>mm/ms</td><td>x10<sup>2</sup>=cm/s</td><td>x10<sup>-4</sup>=cm/&mu;s</td>
</tr>
</tr>


<tr><td>Alt Time</td><td>ms</td><td>T</td><td>s</td><td>s</td><td>s</td>
<tr><td>Alt Velocity</td><td>m/s</td><td>m/s</td><td>x10<sup>3</sup>=mm/s</td><td>mm/ms</td><td>x10<sup>2</sup>=cm/s</td><td>x10<sup>-4</sup>=cm/&mu;s</td>
</tr>
</tr>


<tr><td>Velocity</td><td>mm/s</td><td>L/T</td><td>m/s</td><td>mm/s</td><td>cm/s</td>
<tr><td>Acceleration (L/T<sup>2</sup>)</td><td>x10<sup>3</sup>=mm/s<sup>2</sup></td><td>m/s<sup>2</sup></td><td>x10<sup>3</sup>=mm/s<sup>2</sup></td><td>x10<sup>-3</sup>=mm/ms<sup>2</sup></td><td>x10<sup>2</sup>=cm/s<sup>2</sup></td><td>x10<sup>-10</sup>=cm/&mu;s<sup>2</sup></td>
</tr>
</tr>


<tr><td>Alt Velocity</td><td>m/s</td><td>L/T</td><td>m/s</td><td>mm/s</td><td>cm/s</td>
<tr><td>Force (F=M-L/T<sup>2</sup>)</td><td>N</td><td>N</td><td>x10<sup>6</sup>=&mu;N</td><td>N</td><td>x10<sup>5</sup>=dyne</td><td>x10<sup>-1</sup>=Mdyne</td>
</tr>
</tr>


<tr><td>Acceleration</td><td>mm/s<sup>2</sup></td><td>L/T<sup>2</sup></td><td>m/s<sup>2</sup></td><td>mm/s<sup>2</sup></td><td>cm/s<sup>2</sup></td>
<tr><td>Pressure (P=F/L<sup>2</sup>=M/(L-T<sup>2</sup>))</td><td>x10<sup>-6</sup>=MPa</td><td>Pa</td><td>Pa</td><td>x10<sup>-6</sup>=MPa</td><td>x10=Ba=&mu;bar</td><td>x10<sup>-5</sup>=bar=MBa</td>
</tr>
</tr>


<tr><td>Force</td><td>N</td><td>F = M-L/T<sup>2</sup></td><td>N</td><td>&mu;N</td><td>dyne</td>
<tr><td>Linear Momentum (M-L/T)</td><td>N-s</td><td>N-s</td><td>x10<sup>6</sup>=&mu;N-s</td><td>x10<sup>3</sup>=N-ms</td><td>x10<sup>5</sup>=dyne-s</td><td>x10<sup>5</sup>=dyne-s</td>
</tr>
</tr>


<tr><td>Pressure</td><td>MPa</td><td>P = F/L<sup>2</sup></td><td>Pa</td><td>Pa</td><td>Ba</td>
<tr><td>Alt Strain</td><td>x10<sup>2</sup>=%</td><td>none</td><td>none</td><td>none</td><td>none</td><td>none</td>
</tr>
</tr>


<tr><td>Linear Momentum</td><td>N-s</td><td>p = M-L/T</td><td>N-s</td><td>&mu;N-s</td><td>dyne-s</td>
<tr><td>Energy (E=F-L=M-L<sup>2</sup>/T<sup>2</sup>)</td><td>J</td><td>J</td><td>x10<sup>9</sup>=nJ</td><td>x10<sup>3</sup>=mJ</td><td>x10<sup>7</sup>=erg</td><td>x10<sup>1</sup>=Merg</td>
</tr>
</tr>


<tr><td>Alt Strain</td><td>%</td><td>none</td><td>none</td><td>none</td><td>none</td>
<tr><td>Alt Energy</td><td>x10<sup>6</sup>=&mu;J</td><td>J</td><td>x10<sup>9</sup>=nJ</td><td>x10<sup>3</sup>=mJ</td><td>x10<sup>7</sup>=erg</td><td>x10<sup>1</sup>=Merg</td>
</tr>
</tr>


<tr><td>Energy</td><td>J</td><td>E = F-L</td><td>J</td><td>nJ</td><td>erg</td>
<tr><td>Torque (F-L=M-L<sup>2</sup>/T<sup>2</sup>)</td><td>J</td><td>J</td><td>x10<sup>9</sup>=nJ</td><td>x10<sup>3</sup>=mJ</td><td>x10<sup>7</sup>=erg</td><td>x10<sup>1</sup>=Merg</td>
</tr>
</tr>


<tr><td>Torque</td><td>J</td><td>t = F-L</td><td>J</td><td>nJ</td><td>erg</td>
<tr><td>Angular Momentum (M-L<sup>2</sup>/T)</td><td>J-s</td><td>J-s</td><td>x10<sup>9</sup>=nJ-s</td><td>x10<sup>6</sup>=mJ-ms</td><td>x10<sup>7</sup>=erg-s</td><td>x10<sup>7</sup>=erg-s</td>
</tr>
</tr>


<tr><td>Angular Momentum</td><td>J-s</td><td>t = F-L-T</td><td>J-s</td><td>nJ-s</td><td>erg-s</td>
<tr><td>Energy Release (E/L<sup>2</sup>=M/T<sup>2</sup>=F/L)</td><td>J/m<sup>2</sup></td><td>J/m<sup>2</sup></td><td>x10<sup>3</sup>=mJ/m<sup>2</sup></td><td>x10<sup>-3</sup>=mJ/mm<sup>2</sup>=kJ/m<sup>2</sup></td><td>x10<sup>3</sup>=erg/cm<sup>2</sup>=mJ/m<sup>2</sup></td><td>x10<sup>-3</sup>=Merg/cm<sup>2</sup>=kJ/m<sup>2</sup></td>
</tr>
</tr>


<tr><td>Energy Release</td><td>J/m<sup>2</sup></td><td>E/L<sup>2</sup> </td><td>J/m<sup>2</sup></td><td>nJ/mm<sup>2</sup></td><td>erg/cm<sup>2</sup></td>
<tr><td>Stress Intensity (P-L<sup>0.5</sup>=M/(L<sup>0.5</sup>-T<sup>2</sup>))</td><td>x10<sup>-6</sup>=MPa-m<sup>0.5</sup></td><td>Pa-m<sup>0.5</sup></td><td>x31.623=Pa-mm<sup>0.5</sup></td><td>x31.623=MPa-mm<sup>0.5</sup></td><td>x10<sup>2</sup>=Ba-cm<sup>0.5</sup></td><td>x10<sup>-4</sup>=bar-cm<sup>0.5</sup></td>
</tr>
</tr>


<tr><td>Stress Intensity</td><td>MPa-m<sup>0.5</sup></td><td>P-L<sup>0.5</sup> </td><td>Pa-m<sup>0.5</sup></td><td>Pa-mm<sup>0.5</sup></td><td>Ba-cm<sup>0.5</sup></td>
<tr><td>Viscosity (P-T=M/(L-T))</td><td>x10<sup>3</sup>=cPoise</td><td>Pa-s</td><td>Pa-s</td><td>x10<sup>-3</sup>=MPa-ms</td><td>x10=Poise</td><td>x10=Poise</td>
</tr>
</tr>


<tr><td>Viscosity</td><td>cPoise</td><td>P-T</td><td>Pa-s</td><td>Pa-s</td><td>Poise</td>
<tr><td>Diffusion (L<sup>2</sup>/T)</td><td>x10<sup>6</sup>=mm<sup>2</sup>/s</td><td>m<sup>2</sup>/s</td><td>x10<sup>6</sup>=mm<sup>2</sup>/s</td><td>x10<sup>3</sup>=mm<sup>2</sup>/ms</td><td>x10<sup>4</sup>=cm<sup>2</sup>/s</td><td>x10<sup>-2</sup>=cm<sup>2</sup>/&mu;s</td>
</tr>
</tr>


<tr><td>Diffusion</td><td>mm<sup>2</sup>/s</td><td>L<sup>2</sup>/T</td><td>m<sup>2</sup>/s</td><td>mm<sup>2</sup>/s</td><td>cm<sup>2</sup>/s</td>
<tr><td>Solvent Flux (M/(L<sup>2</sup>-T))</td><td>kg/(m<sup>2</sup>-s)</td><td>kg/(m<sup>2</sup>-s)</td><td>x10<sup>-3</sup>=g/(mm<sup>2</sup>-s)</td><td>x10<sup>-6</sup>=g/(mm<sup>2</sup>-ms)</td><td>x10<sup>-1</sup>=g/(cm<sup>2</sup>-s)</td><td>x10<sup>-1</sup>=g/(cm<sup>2</sup>-s)</td>
</tr>
</tr>


<tr><td>Solvent Flux</td><td>kg/(m<sup>2</sup>-s)</td><td>M/(L<sup>2</sup>-T)</td><td>kg/(m<sup>2</sup>-s)</td><td>g/(mm<sup>2</sup>s)</td><td>g/(cm<sup>2</sup>-s)</td>
<tr><td>Power (E/T=M-L<sup>2</sup>/T<sup>3</sup>)</td><td>W</td><td>W</td><td>x10<sup>9</sup>=nW</td><td>W</td><td>x10<sup>7</sup>=erg/sec</td><td>x10<sup>-5</sup>=Merg/&mu;s</td>
</tr>
</tr>


<tr><td>Conductivity</td><td>W/(m-K)</td><td>E/(L-K-s)</td><td>W/(m-K)</td><td>nW/(mm-K)</td><td>erg/(cm-K-s)</td>
<tr><td>Conductivity (E/(L-K-T)=M-L/(T<sup>3</sup>-K))</td><td>W/(m-K)</td><td>W/(m-K)</td><td>x10<sup>6</sup>=&mu;W/(m-K)</td><td>x10<sup>-3</sup>=W/(mm-K)</td><td>x10<sup>5</sup>=erg/(cm-K-s)</td><td>x10<sup>-7</sup>=Merg/(cm-K-&mu;s)</td>
</tr>
</tr>


<tr><td>Heat Capacity</td><td>J/(kg-K)</td><td>E/(M-K)</td><td>J/(kg-K)</td><td>nJ/(g-K)</td><td>erg/(g-K)</td>
<tr><td>Heat Capacity (E/(M-K)=L<sup>2</sup>/(T<sup>2</sup>-K))</td><td>J/(kg-K)</td><td>J/(kg-K)</td><td>x10<sup>6</sup>=&mu;J/(kg-K)</td><td>J/(kg-K)</td><td>x10<sup>4</sup>=erg/(g-K)</td><td>x10<sup>-8</sup>=Merg/(&mu;g-K)</td>
</tr>
</tr>


<tr><td>Heat Flux</td><td>W/m<sup>2</sup></td><td>E/L<sup>2</sup></td><td>W/m<sup>2</sup></td><td>nW/mm<sup>2</sup></td><td>erg/cm<sup>2</sup></td>
<tr><td>Heat Flux (E/(T-L<sup>2</sup>)=M/T<sup>3</sup>)</td><td>W/m<sup>2</sup></td><td>W/m<sup>2</sup></td><td>x10<sup>3</sup>=mW/m<sup>2</sup></td><td>x10<sup>-6</sup>=W/mm<sup>2</sup></td><td>x10<sup>3</sup>=erg/(cm<sup>2</sup>-s)</td><td>x10<sup>-9</sup>=Merg/(cm<sup>2</sup>-&mu;s)</td>
</tr>
</tr>


<tr><td>Heat of Fusion</td><td>J/kg</td><td>E/M</td><td>J/kg</td><td>nJ/g</td><td>erg/g</td>
<tr><td>Heat of Fusion (E/M=L<sup>2</sup>/T<sup>2</sup>)</td><td>J/kg</td><td>J/kg</td><td>x10<sup>6</sup>=&mu;J/kg</td><td>J/kg</td><td>x10<sup>4</sup>=erg/g</td><td>x10<sup>-8</sup>=Merg/&mu;g</td>
</tr>
</tr>


</table>
</table>

Latest revision as of 12:59, 11 August 2023

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 following table lists possible units needed for entering parameters. The first column gives the name and its definition in terms of length (L), mass (M), time (T), and degrees Kelvin (K). The second column lists how to enter those terms in "Legacy" units mode. The third column lists SI or kg-m-s units. The remaining columns give consistent units for various units modes (you are not limited to these modes). To get a property in selected units mode, multiply SI-units property by factor in column for that mode. The "Alt" units entries only differ from their normal units when using "Legacy" mode. When inputting properties in "Legacy" units, all values are converted to the mm-g-s system for internal calculations (i.e., input properties are scaled by ratio of mm-g-s column to Legacy column conversion factors).

UnitLegacySI (kg-m-s)mm-g-smm-g-msc-g-scm-μg-μs
Length (L)x103=mmmx103=mmx103=mmx102=cmx102=cm
Mass (M)x103=gkgx103=gx103=gx103=gx109=μg
Time (T)sssx103=mssx106=μs
Alt Timex103=msssx103=mssx106=μs
Density (M/L3) x10-3=g/cm3kg/m3x10-6=g/mm3x10-6=g/mm3x10-3=g/cm3x103=μg/cm3
Velocity (L/T)x103=mm/sm/sx103=mm/smm/msx102=cm/sx10-4=cm/μs
Alt Velocitym/sm/sx103=mm/smm/msx102=cm/sx10-4=cm/μs
Acceleration (L/T2)x103=mm/s2m/s2x103=mm/s2x10-3=mm/ms2x102=cm/s2x10-10=cm/μs2
Force (F=M-L/T2)NNx106=μNNx105=dynex10-1=Mdyne
Pressure (P=F/L2=M/(L-T2))x10-6=MPaPaPax10-6=MPax10=Ba=μbarx10-5=bar=MBa
Linear Momentum (M-L/T)N-sN-sx106=μN-sx103=N-msx105=dyne-sx105=dyne-s
Alt Strainx102=%nonenonenonenonenone
Energy (E=F-L=M-L2/T2)JJx109=nJx103=mJx107=ergx101=Merg
Alt Energyx106=μJJx109=nJx103=mJx107=ergx101=Merg
Torque (F-L=M-L2/T2)JJx109=nJx103=mJx107=ergx101=Merg
Angular Momentum (M-L2/T)J-sJ-sx109=nJ-sx106=mJ-msx107=erg-sx107=erg-s
Energy Release (E/L2=M/T2=F/L)J/m2J/m2x103=mJ/m2x10-3=mJ/mm2=kJ/m2x103=erg/cm2=mJ/m2x10-3=Merg/cm2=kJ/m2
Stress Intensity (P-L0.5=M/(L0.5-T2))x10-6=MPa-m0.5Pa-m0.5x31.623=Pa-mm0.5x31.623=MPa-mm0.5x102=Ba-cm0.5x10-4=bar-cm0.5
Viscosity (P-T=M/(L-T))x103=cPoisePa-sPa-sx10-3=MPa-msx10=Poisex10=Poise
Diffusion (L2/T)x106=mm2/sm2/sx106=mm2/sx103=mm2/msx104=cm2/sx10-2=cm2/μs
Solvent Flux (M/(L2-T))kg/(m2-s)kg/(m2-s)x10-3=g/(mm2-s)x10-6=g/(mm2-ms)x10-1=g/(cm2-s)x10-1=g/(cm2-s)
Power (E/T=M-L2/T3)WWx109=nWWx107=erg/secx10-5=Merg/μs
Conductivity (E/(L-K-T)=M-L/(T3-K))W/(m-K)W/(m-K)x106=μW/(m-K)x10-3=W/(mm-K)x105=erg/(cm-K-s)x10-7=Merg/(cm-K-μs)
Heat Capacity (E/(M-K)=L2/(T2-K))J/(kg-K)J/(kg-K)x106=μJ/(kg-K)J/(kg-K)x104=erg/(g-K)x10-8=Merg/(μg-K)
Heat Flux (E/(T-L2)=M/T3)W/m2W/m2x103=mW/m2x10-6=W/mm2x103=erg/(cm2-s)x10-9=Merg/(cm2-μs)
Heat of Fusion (E/M=L2/T2)J/kgJ/kgx106=μJ/kgJ/kgx104=erg/gx10-8=Merg/μg