Skip to content

Commit 2baab15

Browse files
committed
output control and Z component
1 parent d3f5c33 commit 2baab15

2 files changed

Lines changed: 28 additions & 8 deletions

File tree

kratos.gid/apps/ShallowWater/examples/DamBreak.tcl

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,21 +127,31 @@ proc ::ShallowWater::examples::DamBreak::TreeAssignation {args} {
127127
spdAux::AddIntervalGroup Walls "Walls//Total"
128128
set flow_rate_node [customlib::AddConditionGroupOnXPath $flow_rate_cond "Walls//Total"]
129129
$flow_rate_node setAttribute ov line
130-
set props [list selector_component_X Not value_component_Y 0.0 Interval Total]
130+
set props [list selector_component_X Not value_component_Y 0.0 selector_component_Z Not Interval Total]
131131
spdAux::SetValuesOnBaseNode $flow_rate_node $props
132132

133133
spdAux::AddIntervalGroup Right "Right//Total"
134134
set flow_rate_node [customlib::AddConditionGroupOnXPath $flow_rate_cond "Right//Total"]
135135
$flow_rate_node setAttribute ov line
136-
set props [list value_component_X 0.0 selector_component_Y Not Interval Total]
136+
set props [list value_component_X 0.0 selector_component_Y Not selector_component_Z Not Interval Total]
137137
spdAux::SetValuesOnBaseNode $flow_rate_node $props
138138

139139
spdAux::AddIntervalGroup Left "Left//Total"
140140
set flow_rate_node [customlib::AddConditionGroupOnXPath $flow_rate_cond "Left//Total"]
141141
$flow_rate_node setAttribute ov line
142-
set props [list value_component_X 0.0 selector_component_Y Not Interval Total]
142+
set props [list value_component_X 0.0 selector_component_Y Not selector_component_Z Not Interval Total]
143143
spdAux::SetValuesOnBaseNode $flow_rate_node $props
144144

145+
# Time parameters
146+
set parameters [list EndTime 2.0]
147+
set xpath [spdAux::getRoute "SWTimeParameters"]
148+
spdAux::SetValuesOnBasePath $xpath $parameters
149+
150+
# Output
151+
set parameters [list OutputControlType time OutputDeltaTime 0.1]
152+
set xpath "[spdAux::getRoute Results]/container\[@n='GiDOutput'\]/container\[@n='GiDOptions'\]"
153+
spdAux::SetValuesOnBasePath $xpath $parameters
154+
145155
# Refresh
146156
spdAux::RequestRefresh
147157
}

kratos.gid/apps/ShallowWater/examples/HydraulicJump.tcl

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ proc ::ShallowWater::examples::HydraulicJump::TreeAssignation {args} {
7777
set topography_cond "$topography_conditions/condition\[@n='Topography'\]"
7878
set topography_node [customlib::AddConditionGroupOnXPath $topography_cond Channel]
7979
$topography_node setAttribute ov surface
80-
set props [list ByFunction 1 function_value "3*x"]
80+
set props [list ByFunction 1 function_value "2.45135310e-07*x**4 -4.82230477e-05*x**3 +2.54997185e-03*x**2 -4.57311854e-02*x +2.73225488e+00"]
8181
spdAux::SetValuesOnBaseNode $topography_node $props
8282

8383
# Initial conditions
@@ -86,7 +86,7 @@ proc ::ShallowWater::examples::HydraulicJump::TreeAssignation {args} {
8686
spdAux::AddIntervalGroup Channel "Channel//Initial"
8787
set initial_node [customlib::AddConditionGroupOnXPath $initial_cond "Channel//Initial"]
8888
$initial_node setAttribute ov surface
89-
set props [list variable_name FREE_SURFACE_ELEVATION value 2.0 Interval Initial set_minimum_height 1 minimum_height_value 1]
89+
set props [list variable_name FREE_SURFACE_ELEVATION value 2.8 Interval Initial set_minimum_height 1 minimum_height_value 1]
9090
spdAux::SetValuesOnBaseNode $initial_node $props
9191

9292
# Conditions
@@ -97,21 +97,31 @@ proc ::ShallowWater::examples::HydraulicJump::TreeAssignation {args} {
9797
spdAux::AddIntervalGroup Walls "Walls//Total"
9898
set flow_rate_node [customlib::AddConditionGroupOnXPath $flow_rate_cond "Walls//Total"]
9999
$flow_rate_node setAttribute ov line
100-
set props [list selector_component_X Not value_component_Y 0.0 Interval Total]
100+
set props [list selector_component_X Not value_component_Y 0.0 selector_component_Z Not Interval Total]
101101
spdAux::SetValuesOnBaseNode $flow_rate_node $props
102102

103103
spdAux::AddIntervalGroup Upstream "Upstream//Total"
104104
set flow_rate_node [customlib::AddConditionGroupOnXPath $flow_rate_cond "Upstream//Total"]
105105
$flow_rate_node setAttribute ov line
106-
set props [list value_component_X 2.0 selector_component_Y 0.0 Interval Total]
106+
set props [list value_component_X 2.0 selector_component_Y 0.0 selector_component_Z Not Interval Total]
107107
spdAux::SetValuesOnBaseNode $flow_rate_node $props
108108

109109
spdAux::AddIntervalGroup Downstream "Downstream//Total"
110110
set free_surface_node [customlib::AddConditionGroupOnXPath $water_height_cond "Downstream//Total"]
111111
$free_surface_node setAttribute ov line
112-
set props [list value 2.0 Interval Total]
112+
set props [list value 2.8 Interval Total]
113113
spdAux::SetValuesOnBaseNode $free_surface_node $props
114114

115+
# Time parameters
116+
set parameters [list EndTime 50.0]
117+
set xpath [spdAux::getRoute "SWTimeParameters"]
118+
spdAux::SetValuesOnBasePath $xpath $parameters
119+
120+
# Output
121+
set parameters [list OutputControlType time OutputDeltaTime 1.0]
122+
set xpath "[spdAux::getRoute Results]/container\[@n='GiDOutput'\]/container\[@n='GiDOptions'\]"
123+
spdAux::SetValuesOnBasePath $xpath $parameters
124+
115125
# Refresh
116126
spdAux::RequestRefresh
117127
}

0 commit comments

Comments
 (0)