Skip to content

Commit 92991d8

Browse files
Fluid materials in cht
1 parent 4632125 commit 92991d8

3 files changed

Lines changed: 19 additions & 7 deletions

File tree

kratos.gid/apps/Buoyancy/write/write.tcl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ proc ::Buoyancy::write::WriteMaterialsFile {{write_const_law True} {include_mode
5050
Fluid::write::WriteMaterialsFile $write_const_law $include_modelpart_name
5151

5252
# Write Buoyancy materials file
53+
set mat_clear [::Buoyancy::write::GetBuoyancyMaterialsFile $write_const_law $include_modelpart_name]
54+
write::writePropertiesJsonFileDone "BuoyancyMaterials.json" $clear_mat
55+
}
56+
57+
proc ::Buoyancy::write::GetBuoyancyMaterialsFile { {write_const_law True} {include_modelpart_name True} } {
5358
set model_part_name ""
5459
if {[write::isBooleanTrue $include_modelpart_name]} {set model_part_name [GetModelPartName]}
5560

@@ -59,7 +64,7 @@ proc ::Buoyancy::write::WriteMaterialsFile {{write_const_law True} {include_mode
5964
set clear_mat [lindex $clear_mat 0]
6065
dict set clear_mat model_part_name ThermalModelPart
6166
set clear_mat [dict create properties [list $clear_mat]]
62-
write::writePropertiesJsonFileDone "BuoyancyMaterials.json" $clear_mat
67+
return $clear_mat
6368
}
6469

6570
proc ::Buoyancy::write::writeSubModelParts { } {

kratos.gid/apps/ConjugateHeatTransfer/write/write.tcl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,21 @@ proc ::ConjugateHeatTransfer::write::PrepareBuoyancy { } {
8888
}
8989

9090
proc ::ConjugateHeatTransfer::write::WriteMaterialsFile { {write_const_law True} {include_modelpart_name True} } {
91-
Buoyancy::write::WriteMaterialsFile $write_const_law $include_modelpart_name
91+
ConjugateHeatTransfer::write::WriteBuoyancyMaterialsFile $write_const_law $include_modelpart_name
9292
ConvectionDiffusion::write::WriteMaterialsFile False $include_modelpart_name
9393
}
9494

95+
proc ::ConjugateHeatTransfer::write::WriteBuoyancyMaterialsFile { {write_const_law True} {include_modelpart_name True} } {
96+
## Write fluid material file
97+
set model_part_name ""
98+
if {[write::isBooleanTrue $include_modelpart_name]} {set model_part_name [GetAttribute model_part_name]}
99+
set fluid_materials [Fluid::write::GetMaterialsFile $write_const_law $include_modelpart_name]
100+
write::writePropertiesJsonFileDone [::Fluid::write::GetAttribute materials_file] $fluid_materials
101+
102+
# Write Buoyancy materials file
103+
set buoyancy_material [::Buoyancy::write::GetBuoyancyMaterialsFile]
104+
write::writePropertiesJsonFileDone "BuoyancyMaterials.json" $buoyancy_material
105+
}
95106

96107
proc ::ConjugateHeatTransfer::write::GetAttribute {att} {
97108
variable writeAttributes

kratos.gid/apps/Fluid/write/write.tcl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,7 @@ proc Fluid::write::GetMaterialsFile { {write_const_law True} {include_modelpart_
131131
set model_part_name ""
132132
if {[write::isBooleanTrue $include_modelpart_name]} {set model_part_name [GetAttribute model_part_name]}
133133
set parts [write::getPropertiesJson [GetAttribute parts_un] $write_const_law $model_part_name]
134-
# set base [dict create model_part_name [GetAttribute model_part_name] properties_id 0 Material null]
135-
# set old_list [dict get $parts properties]
136-
# set new_list [concat [list $base] $old_list]
137-
# set result [dict create properties $new_list]
138-
# return $result
134+
139135
return $parts
140136
}
141137

0 commit comments

Comments
 (0)