Commit fd481317 authored by John Tourtellott's avatar John Tourtellott

Update heat transfer attributes

* Recast surface conditions as individual atts,
  anticipating exclusion function
* Use a more consistent naming convention
parent 4d50eff4
"""
Script to fix <BriefDescription> newlines
"""
from __future__ import print_function
import os
import re
......@@ -9,23 +10,23 @@ from lxml import etree
if __name__ == '__main__':
#print sys.argv
#print(sys.argv)
if len(sys.argv) < 2:
app = os.path.basename(sys.argv[0])
print
print 'Script to prune whitespace from xml text'
print 'Usage: python %s filename' % app
print
print()
print('Script to prune whitespace from xml text')
print('Usage: python %s filename' % app)
print()
sys.exit(-1)
filename = sys.argv[1]
dom = etree.parse(filename)
root = dom.getroot()
#print root.tag
#print(root.tag)
mods = 0 # count the modified elements
for element in root.iter(tag="BriefDescription"):
#print element.text
#print( element.text)
text = element.text
# Check for any newline-followed-by-whitespace
if re.match(r"\n\s", text):
......@@ -35,17 +36,17 @@ if __name__ == '__main__':
content_list = [item for item in split_list if item != '']
new_string = '\n'.join(content_list)
# print 'new_string:'
# print new_string
# print
# print('new_string:')
# print(new_string)
# print()
element.text = new_string
mods += 1
if mods:
dom.write(filename)
print 'Wrote %d text-element updates to %s' % (mods, filename)
print('Wrote %d text-element updates to %s' % (mods, filename))
else:
print 'No text-element updates to %s' % filename
print('No text-element updates to %s' % filename)
#print 'Finis'
#print('Finis')
......@@ -33,7 +33,7 @@
</ItemDefinitions>
</AttDef>
<!-- DS_SOURCE-->
<AttDef Type="ds-source" Label="Volumetric Heat Source" BaseType="" Version="0">
<AttDef Type="ht/source" Label="Volumetric Heat Source" BaseType="" Version="0">
<AssociationsDef Name="DSSourceAssociations" Version="0" NumberOfRequiredValues="0" Extensible="true">
<MembershipMask>volume</MembershipMask>
</AssociationsDef>
......
......@@ -73,7 +73,7 @@ moving-enclosure radiation is enabled</BriefDescription>
</ItemDefinitions>
</AttDef>
<!-- Thermal Solver Settings-->
<AttDef Type="thermal-solver" Label="Solver" BaseType="" Version="0" Unique="true">
<AttDef Type="ht/solver" Label="Solver" BaseType="" Version="0" Unique="true">
<ItemDefinitions>
<String Name="analysis" Label="Analysis Type">
<Categories>
......
......@@ -41,7 +41,7 @@ SMTK_AttributeResource(Version="3")
DefaultValue 0.0
// DS_SOURCE
AttDef(Type="ds-source" Label="Volumetric Heat Source" BaseType="" Version="0")
AttDef(Type="ht/source" Label="Volumetric Heat Source" BaseType="" Version="0")
AssociationsDef(Name="DSSourceAssociations" Version="0"
NumberOfRequiredValues="0" Extensible="true")
MembershipMask volume
......
......@@ -62,7 +62,7 @@ SMTK_AttributeSystem(Version="2")
+categories-all
// Thermal Solver Settings
AttDef(Type="thermal-solver" Label="Solver"
AttDef(Type="ht/solver" Label="Solver"
BaseType="" Version="0" Unique="true")
ItemDefinitions
String(Name="analysis" Label="Analysis Type")
......
......@@ -2,94 +2,76 @@ doctype xml
SMTK_AttributeSystem(Version="2")
Categories
Cat Heat Transfer
Cat Fluid Flow
// Attribute Definitions for thermal surface conditions
// Attribute definitions for thermal surface conditions
Definitions
AttDef(Type="thermal-surface-condition" BaseType="" Abstract="true" Unique="true")
// Boundary condition definitions
AttDef(Type="ht/boundary" BaseType="" Abstract="true" Version="0")
AssociationsDef(Name="ModelAssociations" Version="0"
NumberOfRequiredValues="0" Extensible="true")
MembershipMask face
AttDef(Type="thermal-boundary-condition" Label="Thermal Boundary Condition"
BaseType="thermal-surface-condition" Version="0")
AttDef(Type="ht/boundary/dirichlet" Label="Dirichlet" BaseType="ht/boundary" Version="0")
ItemDefinitions
String(Name="ds-boundary-condition" Label="DS Boundary Condition")
Double(Name="temperature" Label="Temperature")
Categories #[Cat Heat Transfer]
ChildrenDefinitions
Double(Name="temperature" Label="Temperature")
Categories #[Cat Heat Transfer]
DefaultValue 0.0
Double(Name="heat-flux" Label="Heat Flux")
Categories #[Cat Heat Transfer]
DefaultValue 0.0
DefaultValue 0.0
ExpressionType tabular-function
Group(Name="htc" Label="HTC" Optional="true" IsEnabledByDefault="false")
ItemDefinitions
Double(Name="heat-transfer-coefficient"
Label="Heat Transfer Coefficient (h)")
Categories #[Cat Heat Transfer]
DefaultValue 0.0
Double(Name="reference-temperature"
Label="Reference Temperature (T0)")
Categories #[Cat Heat Transfer]
DefaultValue 0.0
AttDef(Type="ht/boundary/flux" Label="Flux" BaseType="ht/boundary" Version="0")
ItemDefinitions
Double(Name="heat-flux" Label="Heat Flux")
Categories #[Cat Heat Transfer]
DefaultValue 0.0
ExpressionType tabular-function
Group(Name="radiation" Label="External" Optional="true" IsEnabledByDefault="false")
ItemDefinitions
Double(Name="emissivity" Label="Emissivity (epsilon)")
Categories #[Cat Heat Transfer]
DefaultValue 0.0
RangeInfo
Min(Inclusive="true") 0.0
Max(Inclusive="true") 1.0
Double(Name="ambient-temperature"
Label="Ambient Temperature (T infinity)")
Categories #[Cat Heat Transfer]
DefaultValue 0.0
AttDef(Type="ht/boundary/htc" Label="HTC" BaseType="ht/boundary" Version="0")
ItemDefinitions
Double(Name="heat-transfer-coefficient" Label="Heat Transfer Coefficient (h)")
Categories #[Cat Heat Transfer]
DefaultValue 0.0
ExpressionType tabular-function
// DS Boundary Condition types
DiscreteInfo(DefaultIndex="0")
Structure
Value(Enum="Dirichlet") dirichlet
Items
Item temperature
Structure
Value(Enum="Flux") flux
Items
Item heat-flux
Structure
Value(Enum="HTC and/or External Radiation") htc-and-radiation
Items
Item htc
Item radiation
AttDef(Type="ht/boundary/radiation" Label="Radiation" BaseType="ht/boundary" Version="0")
ItemDefinitions
Double(Name="emissivity" Label="Emissivity (epsilon)")
Categories #[Cat Heat Transfer]
DefaultValue 0.0
ExpressionType tabular-function
RangeInfo
Min(Inclusive="true") 0.0 ExpressionType tabular-function
Max(Inclusive="true") 1.0
Double(Name="ambient-temperature"
Label="Ambient Temperature (T infinity)")
Categories #[Cat Heat Transfer]
DefaultValue 0.0
ExpressionType tabular-function
// Interface condition definitions
AttDef(Type="ht/interface" BaseType="" Abstract="true" Version="0")
AssociationsDef(Name="ModelAssociations" Version="0"
NumberOfRequiredValues="0" Extensible="true")
MembershipMask face
AttDef(Type="ht/interface/htc" Label="HTC" BaseType="ht/interface" Version="0")
ItemDefinitions
Double(Name="heat-transfer-coefficient" Label="Heat Transfer Coefficient (alpha)")
Categories #[Cat Heat Transfer]
DefaultValue 0.0
ExpressionType tabular-function
// DS Interface Condition
AttDef(Type="thermal-interface-condition" Label="Thermal Interface Condition"
BaseType="thermal-surface-condition" Version="0")
AttDef(Type="ht/interface/radiation" Label="Gap Radiation" BaseType="ht/interface" Version="0")
ItemDefinitions
String(Name="ds-interface-condition" Label="DS Interface Condition")
Double(Name="emissivity" Label="Emissivity (epsilon)")
Categories #[Cat Heat Transfer]
ChildrenDefinitions
Double(Name="heat-transfer-coefficient"
Label="Heat Transfer Coefficient (alpha)")
Categories #[Cat Heat Transfer]
DefaultValue 0.0
Double(Name="emissivity" Label="Emissivity (epsilon)")
Categories #[Cat Heat Transfer]
DefaultValue 0.0
RangeInfo
Min(Inclusive="true") 0.0
Max(Inclusive="true") 1.0
DiscreteInfo(DefaultIndex="0")
Structure
Value(Enum="Internal HTC") htc
Items
Item heat-transfer-coefficient
Structure
Value(Enum="Gap Radiation") radiation
Items
Item emissivity
DefaultValue 0.0
ExpressionType tabular-function
RangeInfo
Min(Inclusive="true") 0.0
Max(Inclusive="true") 1.0
//- // Enclosure Surface
//- Void(Name="moving" Label="Moving?" Version="0"
......
......@@ -2,136 +2,100 @@
<SMTK_AttributeSystem Version="2">
<Categories>
<Cat>Heat Transfer</Cat>
<Cat>Fluid Flow</Cat>
</Categories>
<!-- Attribute Definitions for thermal surface conditions-->
<!-- Attribute definitions for thermal surface conditions-->
<Definitions>
<AttDef Type="thermal-surface-condition" BaseType="" Abstract="true" Unique="true">
<!-- Boundary condition definitions-->
<AttDef Type="ht/boundary" BaseType="" Abstract="true" Version="0">
<AssociationsDef Name="ModelAssociations" Version="0" NumberOfRequiredValues="0" Extensible="true">
<MembershipMask>face</MembershipMask>
</AssociationsDef>
</AttDef>
<AttDef Type="thermal-boundary-condition" Label="Thermal Boundary Condition" BaseType="thermal-surface-condition" Version="0">
<AttDef Type="ht/boundary/dirichlet" Label="Dirichlet" BaseType="ht/boundary" Version="0">
<ItemDefinitions>
<String Name="ds-boundary-condition" Label="DS Boundary Condition">
<Double Name="temperature" Label="Temperature">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<ChildrenDefinitions>
<Double Name="temperature" Label="Temperature">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<DefaultValue>0.0</DefaultValue>
</Double>
<Double Name="heat-flux" Label="Heat Flux">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<DefaultValue>0.0</DefaultValue>
</Double>
<Group Name="htc" Label="HTC" Optional="true" IsEnabledByDefault="false">
<ItemDefinitions>
<Double Name="heat-transfer-coefficient" Label="Heat Transfer Coefficient (h)">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<DefaultValue>0.0</DefaultValue>
</Double>
<Double Name="reference-temperature" Label="Reference Temperature (T0)">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<DefaultValue>0.0</DefaultValue>
</Double>
</ItemDefinitions>
</Group>
<Group Name="radiation" Label="External" Optional="true" IsEnabledByDefault="false">
<ItemDefinitions>
<Double Name="emissivity" Label="Emissivity (epsilon)">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<DefaultValue>0.0</DefaultValue>
<RangeInfo>
<Min Inclusive="true">0.0</Min>
<Max Inclusive="true">1.0</Max>
</RangeInfo>
</Double>
<Double Name="ambient-temperature" Label="Ambient Temperature (T infinity)">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<DefaultValue>0.0</DefaultValue>
</Double>
</ItemDefinitions>
</Group>
</ChildrenDefinitions>
<!-- DS Boundary Condition types-->
<DiscreteInfo DefaultIndex="0">
<Structure>
<Value Enum="Dirichlet">dirichlet</Value>
<Items>
<Item>temperature</Item>
</Items>
</Structure>
<Structure>
<Value Enum="Flux">flux</Value>
<Items>
<Item>heat-flux</Item>
</Items>
</Structure>
<Structure>
<Value Enum="HTC and/or External Radiation">htc-and-radiation</Value>
<Items>
<Item>htc</Item>
<Item>radiation</Item>
</Items>
</Structure>
</DiscreteInfo>
</String>
<DefaultValue>0.0</DefaultValue>
<ExpressionType>tabular-function</ExpressionType>
</Double>
</ItemDefinitions>
</AttDef>
<!-- DS Interface Condition-->
<AttDef Type="thermal-interface-condition" Label="Thermal Interface Condition" BaseType="thermal-surface-condition" Version="0">
<AttDef Type="ht/boundary/flux" Label="Flux" BaseType="ht/boundary" Version="0">
<ItemDefinitions>
<String Name="ds-interface-condition" Label="DS Interface Condition">
<Double Name="heat-flux" Label="Heat Flux">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<ChildrenDefinitions>
<Double Name="heat-transfer-coefficient" Label="Heat Transfer Coefficient (alpha)">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<DefaultValue>0.0</DefaultValue>
</Double>
<Double Name="emissivity" Label="Emissivity (epsilon)">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<DefaultValue>0.0</DefaultValue>
<RangeInfo>
<Min Inclusive="true">0.0</Min>
<Max Inclusive="true">1.0</Max>
</RangeInfo>
</Double>
</ChildrenDefinitions>
<DiscreteInfo DefaultIndex="0">
<Structure>
<Value Enum="Internal HTC">htc</Value>
<Items>
<Item>heat-transfer-coefficient</Item>
</Items>
</Structure>
<Structure>
<Value Enum="Gap Radiation">radiation</Value>
<Items>
<Item>emissivity</Item>
</Items>
</Structure>
</DiscreteInfo>
</String>
<DefaultValue>0.0</DefaultValue>
<ExpressionType>tabular-function</ExpressionType>
</Double>
</ItemDefinitions>
</AttDef>
<AttDef Type="ht/boundary/htc" Label="HTC" BaseType="ht/boundary" Version="0">
<ItemDefinitions>
<Double Name="heat-transfer-coefficient" Label="Heat Transfer Coefficient (h)">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<DefaultValue>0.0</DefaultValue>
<ExpressionType>tabular-function</ExpressionType>
</Double>
</ItemDefinitions>
</AttDef>
<AttDef Type="ht/boundary/radiation" Label="Radiation" BaseType="ht/boundary" Version="0">
<ItemDefinitions>
<Double Name="emissivity" Label="Emissivity (epsilon)">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<DefaultValue>0.0</DefaultValue>
<ExpressionType>tabular-function</ExpressionType>
<RangeInfo>
<Min Inclusive="true">0.0 ExpressionType tabular-function</Min>
<Max Inclusive="true">1.0</Max>
</RangeInfo>
</Double>
<Double Name="ambient-temperature" Label="Ambient Temperature (T infinity)">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<DefaultValue>0.0</DefaultValue>
<ExpressionType>tabular-function</ExpressionType>
</Double>
</ItemDefinitions>
</AttDef>
<!-- Interface condition definitions-->
<AttDef Type="ht/interface" BaseType="" Abstract="true" Version="0">
<AssociationsDef Name="ModelAssociations" Version="0" NumberOfRequiredValues="0" Extensible="true">
<MembershipMask>face</MembershipMask>
</AssociationsDef>
</AttDef>
<AttDef Type="ht/interface/htc" Label="HTC" BaseType="ht/interface" Version="0">
<ItemDefinitions>
<Double Name="heat-transfer-coefficient" Label="Heat Transfer Coefficient (alpha)">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<DefaultValue>0.0</DefaultValue>
<ExpressionType>tabular-function</ExpressionType>
</Double>
</ItemDefinitions>
</AttDef>
<AttDef Type="ht/interface/radiation" Label="Gap Radiation" BaseType="ht/interface" Version="0">
<ItemDefinitions>
<Double Name="emissivity" Label="Emissivity (epsilon)">
<Categories>
<Cat>Heat Transfer</Cat>
</Categories>
<DefaultValue>0.0</DefaultValue>
<ExpressionType>tabular-function</ExpressionType>
<RangeInfo>
<Min Inclusive="true">0.0</Min>
<Max Inclusive="true">1.0</Max>
</RangeInfo>
</Double>
</ItemDefinitions>
</AttDef>
</Definitions>
......
......@@ -18,25 +18,25 @@
<View Type="Attribute" Title="HT Boundary Conditions" Label="Boundary">
<AttributeTypes>
<Att Type="thermal-boundary-condition"/>
<Att Type="ht/boundary"/>
</AttributeTypes>
</View>
<View Type="Attribute" Title="HT Interface Conditions" Label="Interface">
<AttributeTypes>
<Att Type="thermal-interface-condition"/>
<Att Type="ht/interface"/>
</AttributeTypes>
</View>
<View Type="Instanced" Title="HT Solver" Label="Solver">
<InstancedAttributes>
<Att Name="Solver" Type="thermal-solver" />
<Att Name="Solver" Type="ht/solver" />
</InstancedAttributes>
</View>
<View Type="Attribute" Title="HT Sources" Label="Sources">
<AttributeTypes>
<Att Type="ds-source" />
<Att Type="ht/source" />
</AttributeTypes>
</View>
</Views>
......
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