Commit 60c64bd5 authored by John Tourtellott's avatar John Tourtellott

Update writer for refactored material attributes

parent c288c5aa
......@@ -190,11 +190,11 @@ format_table = {
card('uniform_source', item_path='source-type/constant-uniform-source'),
card('cg_stopping_tolerance', item_path='cg-stopping-tolerance'),
card('maximum_cg_iterations', item_path='maximum-cg-iterations'),
card('num_etasq', item_path='num etasq'),
card('num_etasq', item_path='num-etasq'),
card('steps_per_cycle', item_path='steps-per-cycle'),
card('ss_stopping_tolerance', item_path='ss-stopping-tolerance'),
card('maximum_source_cycles', item_path='maximum-source-cycles'),
card('output_level', 'output-level')
card('output_level', item_path='output-level')
],
# 'ENCLOSURE': [
# card('name', item_path='enclosure-name'),
......@@ -315,20 +315,12 @@ format_table = {
card('output_dt', item_path='output-times/time')
],
'PHASE': [
card('density', item_path='material-type/density', as_property=True),
card('specific heat', item_path='material-type/specific-heat',
if_condition='fluid', as_property=True),
card('specific heat', item_path='material-type/specific-heat',
if_condition='solid', as_property=True),
card('specific heat',
item_path='material-type/thermal-two-phase/specific-heat',
if_condition='two-phase',
as_property=True),
card('conductivity', item_path='material-type/conductivity', as_property=True),
card('viscosity', item_path='material-type/viscosity', \
if_condition=[VISCOUS_FLOW, FLUID_PHASE], as_property=True),
card('density deviation', item_path='material-type/density-deviation', \
if_condition=FLUID_PHASE, as_property=True)
card('density', item_path='density', as_property=True),
card('density-deviation', item_path='density-deviation', as_property=True),
card('specific heat', item_path='specific-heat', as_property=True),
card('conductivity', item_path='conductivity', as_property=True),
card('electrical conductivity', item_path='electrical-properties/electrical-conductivity', as_property=True),
card('viscosity', item_path='viscosity', as_property=True)
],
'PHYSICAL_CONSTANTS': [
card('absolute_zero', item_path='absolute-zero'),
......@@ -413,7 +405,7 @@ namelist_sequence = [
separator='INTERFACE CONDITIONS'),
namelist('BC',
att_type='boundary-condition', custom_method='_write_bc'),
namelist('BODY', att_type='material', custom_method='_write_body', separator='BODIES'),
namelist('BODY', att_type='phase', custom_method='_write_body', separator='BODIES'),
namelist('FUNCTION', att_type='fn.initial-condition', custom_method='_write_function'),
namelist('DS_SOURCE', att_type='ht.source'),
namelist('PROBE', att_type='probe'),
......@@ -426,10 +418,8 @@ namelist_sequence = [
]
test_sequence = [
namelist('ALTMESH', if_condition=INDUCTION_HEATING, att_type='electromagnetics',
custom_method='_write_mesh'),
namelist('ELECTROMAGNETICS', if_condition=INDUCTION_HEATING, att_type='electromagnetics'),
namelist('INDUCTION_COIL', if_condition=INDUCTION_HEATING, att_type='induction-coil'),
namelist('MATERIAL', custom_method='_write_materials', separator='MATERIALS'),
namelist('FUNCTION', att_type='fn.material', custom_method='_write_function')
]
......
......@@ -7,6 +7,168 @@
<Definitions>
<AttDef Type="fn.material" BaseType="" Abstract="true" Version="0"></AttDef>
<AttDef Type="fn.initial-condition" BaseType="" Abstract="true" Version="0"></AttDef>
<!-- Thermal Conductivity function of Temp-->
<AttDef Type="fn.material.conductivity" BaseType="fn.material" Label="Conductivity" RootName="ConductivityFn" Version="0">
<ItemDefinitions>
<String Name="type" Label="Function Type" Version="0" stuff="Heat Transfer">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<ChildrenDefinitions>
<String Name="interpolation" Label="Interpolation Method" Version="0">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<DiscreteInfo DefaultIndex="0">
<Value>linear</Value>
<Value>akima</Value>
</DiscreteInfo>
</String>
<String Name="extrapolation" Label="Extrapolation Method" Version="0">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<DiscreteInfo DefaultIndex="0">
<Value>nearest</Value>
<Value>linear</Value>
</DiscreteInfo>
</String>
<Group Name="tabular-data" Label="Tabular Data" Extensible="true" NumberOfRequiredGroups="1">
<ItemDefinitions>
<Double Name="X" Label="Temp" NumberOfRequiredValues="1">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
</Double>
<Double Name="Value" Label="Conductivity" NumberOfRequiredValues="1">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
</Double>
</ItemDefinitions>
</Group>
<Double Name="center" Label="Center Temperature">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<DefaultValue>0</DefaultValue>
</Double>
<Group Name="polynomial-terms" Label="Polynomial Terms" Extensible="true" NumberOfRequiredGroups="1">
<ItemDefinitions>
<Double Name="X" Label="Coefficient" NumberOfRequiredValues="1">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
</Double>
<Int Name="Value" Label="Exponent (Temp)" NumberOfRequiredValues="1">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
</Int>
</ItemDefinitions>
</Group>
</ChildrenDefinitions>
<DiscreteInfo>
<Structure>
<Value Enum="Polynomial">polynomial</Value>
<Items>
<Item>center</Item>
<Item>polynomial-terms</Item>
</Items>
</Structure>
<Structure>
<Value Enum="Tabular">tabular</Value>
<Items>
<Item>interpolation</Item>
<Item>extrapolation</Item>
<Item>tabular-data</Item>
</Items>
</Structure>
</DiscreteInfo>
</String>
</ItemDefinitions>
</AttDef>
<!-- Density deviation function of Temp-->
<AttDef Type="fn.material.density-deviation" BaseType="fn.material" Label="Density Deviation" RootName="DensityDeviationFn" Version="0">
<ItemDefinitions>
<String Name="type" Label="Function Type" Version="0" stuff="Heat Transfer">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<ChildrenDefinitions>
<String Name="interpolation" Label="Interpolation Method" Version="0">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<DiscreteInfo DefaultIndex="0">
<Value>linear</Value>
<Value>akima</Value>
</DiscreteInfo>
</String>
<String Name="extrapolation" Label="Extrapolation Method" Version="0">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<DiscreteInfo DefaultIndex="0">
<Value>nearest</Value>
<Value>linear</Value>
</DiscreteInfo>
</String>
<Group Name="tabular-data" Label="Tabular Data" Extensible="true" NumberOfRequiredGroups="1">
<ItemDefinitions>
<Double Name="X" Label="Temp" NumberOfRequiredValues="1">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
</Double>
<Double Name="Value" Label="Density Deviation" NumberOfRequiredValues="1">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
</Double>
</ItemDefinitions>
</Group>
<Double Name="center" Label="Center Temperature">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<DefaultValue>0</DefaultValue>
</Double>
<Group Name="polynomial-terms" Label="Polynomial Terms" Extensible="true" NumberOfRequiredGroups="1">
<ItemDefinitions>
<Double Name="X" Label="Coefficient" NumberOfRequiredValues="1">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
</Double>
<Int Name="Value" Label="Exponent (Temp)" NumberOfRequiredValues="1">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
</Int>
</ItemDefinitions>
</Group>
</ChildrenDefinitions>
<DiscreteInfo>
<Structure>
<Value Enum="Polynomial">polynomial</Value>
<Items>
<Item>center</Item>
<Item>polynomial-terms</Item>
</Items>
</Structure>
<Structure>
<Value Enum="Tabular">tabular</Value>
<Items>
<Item>interpolation</Item>
<Item>extrapolation</Item>
<Item>tabular-data</Item>
</Items>
</Structure>
</DiscreteInfo>
</String>
</ItemDefinitions>
</AttDef>
<!-- Specific Heat function of Temp-->
<AttDef Type="fn.material.specific-heat" BaseType="fn.material" Label="Specific Heat" RootName="SpecificHeatFn" Version="0">
<ItemDefinitions>
......@@ -88,8 +250,8 @@
</String>
</ItemDefinitions>
</AttDef>
<!-- Thermal Conductivity function of Temp-->
<AttDef Type="fn.material.conductivity" BaseType="fn.material" Label="Conductivity" RootName="ConductivityFn" Version="0">
<!-- Viscosity function of Temp-->
<AttDef Type="fn.material.viscosity" BaseType="fn.material" Label="Viscosity" RootName="ViscosityFn" Version="0">
<ItemDefinitions>
<String Name="type" Label="Function Type" Version="0" stuff="Heat Transfer">
<Categories>
......@@ -121,7 +283,7 @@
<Cat>Heat Transfer</Cat>
</Categories>
</Double>
<Double Name="Value" Label="Conductivity" NumberOfRequiredValues="1">
<Double Name="Value" Label="Viscosity" NumberOfRequiredValues="1">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
......
......@@ -49,7 +49,7 @@ density from the reference density</BriefDescription>
<Cat>Solid Mechanics</Cat>
</Categories>
<DefaultValue>0.0</DefaultValue>
<ExpressionType>fn.material</ExpressionType>
<ExpressionType>fn.material.density-deviation</ExpressionType>
</Double>
<Double Name="conductivity" Label="Conductivity (K)">
<BriefDescription>Thermal conductivity of the material phase</BriefDescription>
......@@ -59,7 +59,7 @@ density from the reference density</BriefDescription>
<Cat>Induction Heating</Cat>
<Cat>Solid Mechanics</Cat>
</Categories>
<ExpressionType>fn.material</ExpressionType>
<ExpressionType>fn.material.conductivity</ExpressionType>
<RangeInfo>
<Min Inclusive="false">0.0</Min>
</RangeInfo>
......@@ -72,31 +72,28 @@ density from the reference density</BriefDescription>
<Cat>Induction Heating</Cat>
<Cat>Solid Mechanics</Cat>
</Categories>
<ExpressionType>fn.material</ExpressionType>
<ExpressionType>fn.material.specific-heat</ExpressionType>
<RangeInfo>
<Min Inclusive="false">0.0</Min>
</RangeInfo>
</Double>
<!-- Electromagnetic properties-->
<Group Name="electrical properties" Label="Electrical Properties">
<Group Name="electrical-properties" Label="Electrical Properties">
<ItemDefinitions>
<Double Name="electrical-conductivity" Label="Electrical Conductivity">
<DefaultValue>0.0</DefaultValue>
<ExpresionType>fn.material</ExpresionType>
<Categories>
<Cat>Induction Heating</Cat>
</Categories>
</Double>
<Double Name="electrical-susceptibility" Label="Electrical Susceptibility" AdvanceLevel="1">
<DefaultValue>0.0</DefaultValue>
<ExpresionType>fn.material</ExpresionType>
<Categories>
<Cat>Induction Heating</Cat>
</Categories>
</Double>
<Double Name="magnetic-susceptibility" Label="Magnetic Susceptibility" AdvanceLevel="1">
<DefaultValue>0.0</DefaultValue>
<ExpresionType>fn.material</ExpresionType>
<Categories>
<Cat>Induction Heating</Cat>
</Categories>
......@@ -117,7 +114,7 @@ density from the reference density</BriefDescription>
<Cat>Solid Mechanics</Cat>
</Categories>
<DefaultValue>0.0</DefaultValue>
<ExpressionType>fn.material</ExpressionType>
<ExpressionType>fn.material.viscosity</ExpressionType>
<RangeInfo>
<Min Inclusive="false">0.0</Min>
</RangeInfo>
......
......@@ -68,17 +68,28 @@ SMTK_AttributeResource(Version="3")
AttDef(Type="fn.material" BaseType="" Abstract="true" Version="0")
AttDef(Type="fn.initial-condition" BaseType="" Abstract="true" Version="0")
// Thermal Conductivity function of Temp
AttDef(Type="fn.material.conductivity" BaseType="fn.material" Label="Conductivity" RootName="ConductivityFn" Version="0")
+fn1('Heat Transfer',
['Tabular Data', 'Temp', 'Conductivity'],
['Center Temperature', 'Polynomial Terms', 'Coefficient', 'Exponent (Temp)'])
// Density deviation function of Temp
AttDef(Type="fn.material.density-deviation" BaseType="fn.material" Label="Density Deviation" RootName="DensityDeviationFn" Version="0")
+fn1('Heat Transfer',
['Tabular Data', 'Temp', 'Density Deviation'],
['Center Temperature', 'Polynomial Terms', 'Coefficient', 'Exponent (Temp)'])
// Specific Heat function of Temp
AttDef(Type="fn.material.specific-heat" BaseType="fn.material" Label="Specific Heat" RootName="SpecificHeatFn" Version="0")
+fn1('Heat Transfer',
['Tabular Data', 'Temp', 'Specific Heat'],
['Center Temperature', 'Polynomial Terms', 'Coefficient', 'Exponent (Temp)'])
// Thermal Conductivity function of Temp
AttDef(Type="fn.material.conductivity" BaseType="fn.material" Label="Conductivity" RootName="ConductivityFn" Version="0")
// Viscosity function of Temp
AttDef(Type="fn.material.viscosity" BaseType="fn.material" Label="Viscosity" RootName="ViscosityFn" Version="0")
+fn1('Heat Transfer',
['Tabular Data', 'Temp', 'Conductivity'],
['Tabular Data', 'Temp', 'Viscosity'],
['Center Temperature', 'Polynomial Terms', 'Coefficient', 'Exponent (Temp)'])
......
......@@ -6,19 +6,16 @@ mixin categories-all
Cat Solid Mechanics
mixin electrical
Group(Name="electrical properties" Label="Electrical Properties")
Group(Name="electrical-properties" Label="Electrical Properties")
ItemDefinitions
Double(Name="electrical-conductivity" Label="Electrical Conductivity")
DefaultValue 0.0
ExpresionType fn.material
Categories #[Cat Induction Heating]
Double(Name="electrical-susceptibility" Label="Electrical Susceptibility" AdvanceLevel="1")
DefaultValue 0.0
ExpresionType fn.material
Categories #[Cat Induction Heating]
Double(Name="magnetic-susceptibility" Label="Magnetic Susceptibility" AdvanceLevel="1")
DefaultValue 0.0
ExpresionType fn.material
Categories #[Cat Induction Heating]
doctype xml
......@@ -58,17 +55,17 @@ SMTK_AttributeResource(Version="3")
| density from the reference density
+categories-all
DefaultValue 0.0
ExpressionType fn.material
ExpressionType fn.material.density-deviation
Double(Name="conductivity" Label="Conductivity (K)")
BriefDescription Thermal conductivity of the material phase
+categories-all
ExpressionType fn.material
ExpressionType fn.material.conductivity
RangeInfo
Min(Inclusive="false") 0.0
Double(Name="specific-heat" Label="Specific Heat (Cp)")
BriefDescription Specific heat of the material phase
+categories-all
ExpressionType fn.material
ExpressionType fn.material.specific-heat
RangeInfo
Min(Inclusive="false") 0.0
......@@ -83,7 +80,7 @@ SMTK_AttributeResource(Version="3")
| The dynamic viscosity of a fluid phase
+categories-all
DefaultValue 0.0
ExpressionType fn.material
ExpressionType fn.material.viscosity
RangeInfo
Min(Inclusive="false") 0.0
......@@ -111,118 +108,4 @@ SMTK_AttributeResource(Version="3")
Accepts
Resource(Name="smtk::attribute::Resource" Filter="attribute[type='phase']")
//-AttDef(Type="material" Label="Material" BaseType="" Version="0" Unique="true")
AssociationsDef(Name="MaterialAssociations" Version="0"
NumberOfRequiredValues="0" Extensible="true")
MembershipMask volume
ItemDefinitions
String(Name="material-type" Label="Material Type")
+categories-all
ChildrenDefinitions
Double(Name="density" Label="Density (rho)" Optional="false")
BriefDescription Mass density of the material phase
+categories-all
RangeInfo
Min(Inclusive="false") 0.0
Double(Name="density-deviation" Label="Density Deviation"
Optional="true" IsEnabledByDefault="false")
BriefDescription
| The relative deviation of the true temperature-dependent
| density from the reference density
+categories-all
DefaultValue 0.0
ExpressionType tabular-function
Double(Name="conductivity" Label="Conductivity (K)")
BriefDescription Thermal conductivity of the material phase
+categories-all
ExpressionType fn.material.conductivity
RangeInfo
Min(Inclusive="false") 0.0
Double(Name="viscosity" Label="Viscosity (nu)")
BriefDescription
| The dynamic viscosity of a fluid phase
+categories-all
DefaultValue 0.0
ExpressionType tabular-function
RangeInfo
Min(Inclusive="false") 0.0
Double(Name="specific-heat" Label="Specific Heat (Cp)")
BriefDescription Specific heat of the material phase
+categories-all
ExpressionType fn.material.specific-heat
RangeInfo
Min(Inclusive="false") 0.0
// Electromagnetic properties
Group(Name="solid-electrical-properties" Label="Solid Electrical Properties")
+electrical
Group(Name="fluid-electrical-properties" Label="Fluid Electrical Properties")
+electrical
// Two phase properties
Double(Name="latent-heat" Label="Latent Heat (Lf)")
BriefDescription The latent heats of the phase transformations.
+categories-all
RangeInfo
Min(Inclusive="false") 0.0
Double(Name="solid-transition-temperature" Label="Solidus Temperature (Ts)")
+categories-all
DefaultValue 0.0
Double(Name="liquid-transition-temperature" Label="Liquidus Temperature (Tl)")
+categories-all
DefaultValue 100.0
// Void material properties
Double(Name="void-temperature" Label="Temperature")
+categories-all
DefaultValue 0.0
Double(Name="sound-speed" Label="Speed of Sound" AdvanceLevel="1")
+categories-all
BriefDescription
| The adiabatic sound speed that is used in computing the
| compressibility of each cell containing the material.
| This is not a real sound speed, but a numerical artifice
| used to permit collapse of small void bubbles.
DefaultValue 0.0
RangeInfo
Min(Inclusive="true") 0.0
DiscreteInfo(DefaultIndex="2")
Structure
Value(Enum="Solid") solid
Items
Item density
Item density-deviation
Item conductivity
Item specific-heat
Item solid-electrical-properties
Structure
Value(Enum="Fluid") fluid
Items
Item density
Item density-deviation
Item conductivity
Item viscosity
Item specific-heat
Item fluid-electrical-properties
Structure
Value(Enum="Two Phase") two-phase
Items
Item density
Item density-deviation
Item conductivity
Item viscosity
Item specific-heat
Item latent-heat
Item solid-transition-temperature
Item liquid-transition-temperature
Item solid-electrical-properties
Item fluid-electrical-properties
Structure
Value(Enum="Void") void
Items
Item void-temperature
Item sound-speed
= "\n"
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment