Skip to content

Commit 4c4700f

Browse files
Fix Fluid derived apps
1 parent b4724a3 commit 4c4700f

14 files changed

Lines changed: 51 additions & 38 deletions

File tree

kratos.gid/apps/CDEM/xml/XmlController.tcl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ proc CDEM::xml::Init { } {
1010
Model::ForgetElements
1111
Model::ForgetMaterials
1212
Model::ForgetConstitutiveLaws
13-
Model::ForgetElement SphericPartDEMElement3D
1413
Model::getElements ElementsC.xml
1514
Model::ForgetConditions
1615
Model::getConditions Conditions.xml
@@ -52,4 +51,11 @@ proc CDEM::xml::ProcGetElements { domNode args } {
5251
return $diction
5352
}
5453

54+
proc CDEM::xml::MultiAppEvent {args} {
55+
if {$args eq "init"} {
56+
spdAux::parseRoutes
57+
spdAux::ConvertAllUniqueNames DEM ${::CDEM::prefix}
58+
}
59+
}
60+
5561
CDEM::xml::Init
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<container n="Preferences" pn="Model information" un="DEMPreferences" icon="solution" state="normal" open_window="0">
3-
<value n="SolStratCombo" pn="Solution strategy" un="DEMSolStrat" v="" icon="black1" values="" dict="[GetSolutionStrategies]" actualize_tree="1"/>
4-
<!-- <value n="Scheme" pn="Translational scheme" un="DEMScheme" v="" values="" dict="[GetSchemes]" actualize_tree="1"/> -->
3+
<value n="SolStratCombo" pn="Solution strategy" un="DEMSolStrat" v="" icon="black1" values="" dict="[GetSolutionStrategies App DEM]" actualize_tree="1"/>
54
<value n="DEMTranslationalScheme" pn="Translational scheme" un="DEMTranslationalScheme" v="Symplectic_Euler" icon="black1" help="Select translational integration scheme" values="" dict="[GetSchemes type Translational]" actualize_tree="1"/>
65
<value n="DEMRotationalScheme" pn="Rotational scheme" un="DEMRotationalScheme" v="Direct_Integration" icon="black1" help="Select rotational integration scheme" values="" dict="[GetSchemes type Rotational]" actualize_tree="1"/>
76
</container>

kratos.gid/apps/DEM/xml/Strategies.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<StrategyList>
3-
<StrategyItem n="Explicit" pn="Explicit">
3+
<StrategyItem n="Explicit" pn="Explicit" App="DEM">
44
<!-- list of options to be filled type="Translational,Rotational" -->
55
<parameter_list></parameter_list>
66
<linearSolvers></linearSolvers>

kratos.gid/apps/EmbeddedFluid/write/writeProjectParameters.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ proc EmbeddedFluid::write::getDistanceModificationDict { } {
8989
dict set distance_modif_dict "kratos_module" KratosMultiphysics.FluidDynamicsApplication
9090
dict set distance_modif_dict "process_name" ApplyDistanceModificationProcess
9191
set parameters_dict [dict create ]
92-
dict set parameters_dict "model_part_name" [lindex [write::getPartsSubModelPartId] 0]
92+
dict set parameters_dict "model_part_name" "FluidModelPart.[lindex [write::getPartsSubModelPartId] 0]"
9393
dict set parameters_dict "check_at_each_time_step" [write::getValue EMBFLDistanceSettings correct_distance_at_each_step]
9494
dict set distance_modif_dict "Parameters" $parameters_dict
9595
return $distance_modif_dict
@@ -101,7 +101,7 @@ proc EmbeddedFluid::write::getEmbeddedDragProcessDict {} {
101101
dict set pdict "kratos_module" "KratosMultiphysics.FluidDynamicsApplication"
102102
dict set pdict "process_name" "ComputeEmbeddedDragProcess"
103103
set params [dict create]
104-
dict set params "model_part_name" [lindex [write::getPartsSubModelPartId] 0]
104+
dict set params "model_part_name" "FluidModelPart.[lindex [write::getPartsSubModelPartId] 0]"
105105
dict set params "write_drag_output_file" [write::getValue EMBFLEmbeddedDrag write_drag_output_file]
106106
dict set params "print_drag_to_screen" [write::getValue EMBFLEmbeddedDrag print_drag_to_screen]
107107
dict set params "interval" [write::getInterval [write::getValue EMBFLEmbeddedDrag Interval] ]

kratos.gid/apps/EmbeddedFluid/xml/Strategies.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<StrategyList>
33
<StrategyItem n="Monolithic" pn="Embedded Navier Stokes - Monolithic"
4+
Type="monolithic"
45
ImplementedInFile="navier_stokes_embedded_solver.py"
56
ImplementedInApplication="FluidDynamicsApplication"
67
ImplementedInPythonFile="Embedded"
@@ -35,11 +36,13 @@
3536
</linearSolvers>
3637

3738
<schemes>
38-
<scheme n="MN" pn="Monolitic generic scheme" help="FilterElements" ProductionReady="ProductionReady">
39+
<scheme n="bdf2" pn="BDF2" help="2nd order Backward Differenctiation Formula (BDF2) scheme for CFD problems." ProductionReady="ProductionReady">
40+
41+
<!-- <scheme n="MN" pn="Monolitic generic scheme" help="FilterElements" ProductionReady="ProductionReady"> -->
3942
<parameter_list>
4043
</parameter_list>
4144
<element_filters>
42-
<filter field="n" value="Monolithic2D,Monolithic3D"/>
45+
<filter field="FormulationElementType" value="fic,dvms,qsvms"/>
4346
</element_filters>
4447
</scheme>
4548
</schemes>

kratos.gid/apps/Examples/xml/examples.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
<link path="apps/FluidDEM/examples/examples.xml"/>
1616
<link path="apps/Dam/examples/examples.xml"/>
1717
<!-- More -->
18-
<link path="apps/PotentialFluid/examples/examples.xml"/>
1918
<link path="apps/EmbeddedFluid/examples/examples.xml"/>
2019
<link path="apps/MPM/examples/examples.xml"/>
2120
</examples>

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,10 @@ proc Fluid::write::getSolverSettingsDict { } {
178178
dict set solverSettingsDict model_part_name [GetAttribute model_part_name]
179179
set nDim [expr [string range [write::getValue nDim] 0 0]]
180180
dict set solverSettingsDict domain_size $nDim
181-
set currentStrategyId [write::getValue FLSolStrat]
182-
set strategy_write_name [[::Model::GetSolutionStrategy $currentStrategyId] getAttribute "ImplementedInPythonFile"]
181+
set currentStrategyId [write::getValue FLSolStrat "" force]
182+
set strategy [::Model::GetSolutionStrategy $currentStrategyId]
183+
set strategy_write_name [$strategy getAttribute "ImplementedInPythonFile"]
184+
set strategy_type [$strategy getAttribute "Type"]
183185
dict set solverSettingsDict solver_type $strategy_write_name
184186

185187
# model import settings
@@ -207,7 +209,7 @@ proc Fluid::write::getSolverSettingsDict { } {
207209
dict set solverSettingsDict no_skin_parts [getNoSkinConditionMeshId]
208210

209211
# Time scheme settings
210-
if {$currentStrategyId eq "Monolithic"} {
212+
if {$strategy_type eq "monolithic"} {
211213
dict set solverSettingsDict time_scheme [write::getValue FLScheme]
212214
}
213215

@@ -225,23 +227,14 @@ proc Fluid::write::getSolverSettingsDict { } {
225227
dict set solverSettingsDict time_stepping $timeSteppingDict
226228

227229
# For monolithic schemes, set the formulation settings
228-
if {$currentStrategyId eq "Monolithic"} {
230+
if {$strategy_type eq "monolithic"} {
229231
# Create formulation dictionary
230232
set formulationSettingsDict [dict create]
231233

232234
# Set formulation dictionary element type
233235
set elements [Fluid::write::GetUsedElements]
234236
if {[llength $elements] ne 1} {error "You must select 1 element"} {set element_name [lindex $elements 0]}
235-
if {$element_name eq "QSVMS2D" || $element_name eq "QSVMS3D"} {
236-
set element_type "qsvms"
237-
} elseif {$element_name eq "DVMS2D" || $element_name eq "DVMS3D"} {
238-
set element_type "dvms"
239-
} elseif {$element_name eq "FIC2D" || $element_name eq "FIC3D"} {
240-
set element_type "fic"
241-
} else {
242-
set err [concat "Wrong monolithic element type: " $element_name]
243-
error $err
244-
}
237+
set element_type [Fluid::write::GetMonolithicElementTypeFromElementName $element_name]
245238
dict set formulationSettingsDict element_type $element_type
246239

247240
# Set OSS and remove oss_switch from the original dictionary
@@ -252,7 +245,7 @@ proc Fluid::write::getSolverSettingsDict { } {
252245
}
253246

254247
# Set dynamic tau and remove dynamic_tau from the original dictionary
255-
if {$element_name eq "QSVMS2D" || $element_name eq "QSVMS3D"} {
248+
if {$element_type eq "qsvms"} {
256249
dict set formulationSettingsDict dynamic_tau [dict get $solverSettingsDict dynamic_tau]
257250
dict unset solverSettingsDict dynamic_tau
258251
# Include the formulation settings in the solver settings dict
@@ -261,4 +254,11 @@ proc Fluid::write::getSolverSettingsDict { } {
261254
}
262255

263256
return $solverSettingsDict
257+
}
258+
259+
proc Fluid::write::GetMonolithicElementTypeFromElementName {element_name} {
260+
set element [Model::getElement $element_name]
261+
if {![$element hasAttribute FormulationElementType]} {error "Your monolithic element $element_name need to define the FormulationElementType field"}
262+
set formulation_element_type [$element getAttribute FormulationElementType]
263+
return {*}$formulation_element_type
264264
}

kratos.gid/apps/Fluid/xml/Elements.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
</outputs>
4747
</ElementItem>
4848

49-
<ElementItem n="QSVMS2D" pn="Quasi-static VMS" ImplementedInFile="qs_vms.cpp" ImplementedInApplication="FluidDynamicsApplication"
49+
<ElementItem n="QSVMS2D" pn="Quasi-static VMS" ImplementedInFile="qs_vms.cpp" ImplementedInApplication="FluidDynamicsApplication" FormulationElementType="qsvms"
5050
MinimumKratosVersion="9000" ProductionReady="ProductionReady" WorkingSpaceDimension="2D" LocalSpaceDimension="2" RequiresLocalAxes="False"
5151
LargeDeformation="False" ElementType="Fluid" help="This element implements a quasi-static Variational MultiScale (VMS) monolithic element">
5252
<!--here we could add a list of all of the possible geometries-->
@@ -73,7 +73,7 @@
7373
</outputs>
7474
</ElementItem>
7575

76-
<ElementItem n="QSVMS3D" pn="Quasi-static VMS" ImplementedInFile="qs_vms.cpp" ImplementedInApplication="FluidDynamicsApplication"
76+
<ElementItem n="QSVMS3D" pn="Quasi-static VMS" ImplementedInFile="qs_vms.cpp" ImplementedInApplication="FluidDynamicsApplication" FormulationElementType="qsvms"
7777
MinimumKratosVersion="9000" ProductionReady="ProductionReady" WorkingSpaceDimension="3D" LocalSpaceDimension="3" RequiresLocalAxes="False"
7878
LargeDeformation="False" ElementType="Fluid" help="This element implements a quasi-static Variational MultiScale (VMS) monolithic element">
7979
<!--here we could add a list of all of the possible geometries-->
@@ -100,7 +100,7 @@
100100
</outputs>
101101
</ElementItem>
102102

103-
<ElementItem n="DVMS2D" pn="Dynamic VMS" ImplementedInFile="d_vms.cpp" ImplementedInApplication="FluidDynamicsApplication"
103+
<ElementItem n="DVMS2D" pn="Dynamic VMS" ImplementedInFile="d_vms.cpp" ImplementedInApplication="FluidDynamicsApplication" FormulationElementType="dvms"
104104
MinimumKratosVersion="9000" ProductionReady="ProductionReady" WorkingSpaceDimension="2D" LocalSpaceDimension="2" RequiresLocalAxes="False"
105105
LargeDeformation="False" ElementType="Fluid" help="This element implements a dynamic Variational MultiScale (VMS) monolithic element">
106106
<!--here we could add a list of all of the possible geometries-->
@@ -127,7 +127,7 @@
127127
</outputs>
128128
</ElementItem>
129129

130-
<ElementItem n="DVMS3D" pn="Dynamic VMS" ImplementedInFile="d_vms.cpp" ImplementedInApplication="FluidDynamicsApplication"
130+
<ElementItem n="DVMS3D" pn="Dynamic VMS" ImplementedInFile="d_vms.cpp" ImplementedInApplication="FluidDynamicsApplication" FormulationElementType="dvms"
131131
MinimumKratosVersion="9000" ProductionReady="ProductionReady" WorkingSpaceDimension="3D" LocalSpaceDimension="3" RequiresLocalAxes="False"
132132
LargeDeformation="False" ElementType="Fluid" help="This element implements a dynamic Variational MultiScale (VMS) monolithic element">
133133
<!--here we could add a list of all of the possible geometries-->
@@ -154,7 +154,7 @@
154154
</outputs>
155155
</ElementItem>
156156

157-
<ElementItem n="FIC2D" pn="FIC" ImplementedInFile="fic.cpp" ImplementedInApplication="FluidDynamicsApplication"
157+
<ElementItem n="FIC2D" pn="FIC" ImplementedInFile="fic.cpp" ImplementedInApplication="FluidDynamicsApplication" FormulationElementType="fic"
158158
MinimumKratosVersion="9000" ProductionReady="ProductionReady" WorkingSpaceDimension="2D" LocalSpaceDimension="2" RequiresLocalAxes="False"
159159
LargeDeformation="False" ElementType="Fluid" help="This element implements a Finite Increment Calculus (FIC) stabilization monolithic element">
160160
<!--here we could add a list of all of the possible geometries-->
@@ -181,7 +181,7 @@
181181
</outputs>
182182
</ElementItem>
183183

184-
<ElementItem n="FIC3D" pn="FIC" ImplementedInFile="fic.cpp" ImplementedInApplication="FluidDynamicsApplication"
184+
<ElementItem n="FIC3D" pn="FIC" ImplementedInFile="fic.cpp" ImplementedInApplication="FluidDynamicsApplication" FormulationElementType="fic"
185185
MinimumKratosVersion="9000" ProductionReady="ProductionReady" WorkingSpaceDimension="3D" LocalSpaceDimension="3" RequiresLocalAxes="False"
186186
LargeDeformation="False" ElementType="Fluid" help="This element implements a Finite Increment Calculus (FIC) stabilization monolithic element">
187187
<!--here we could add a list of all of the possible geometries-->

kratos.gid/apps/Fluid/xml/Strategies.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<StrategyItem
77
n="Monolithic"
88
pn="Navier Stokes - Monolithic"
9+
Type="monolithic"
910
ImplementedInFile="navier_stokes_solver_vmsmonolithic.py"
1011
ImplementedInApplication="FluidDynamicsApplication"
1112
ImplementedInPythonFile="Monolithic"
@@ -60,6 +61,7 @@
6061
<StrategyItem
6162
n="FractionalStep"
6263
pn="Navier Stokes - Fractional Step"
64+
Type="fractional_step"
6365
ImplementedInFile="navier_stokes_solver_fractionalstep.py"
6466
ImplementedInApplication="FluidDynamicsApplication"
6567
ImplementedInPythonFile="FractionalStep"

kratos.gid/apps/FluidDEM/examples/CylinderInFlow.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ proc FluidDEM::examples::TreeAssignationCylinderInFlow3D {args} {
157157
set fluidParts [spdAux::getRoute "FLParts"]
158158
set fluidNode [customlib::AddConditionGroupOnXPath $fluidParts Fluid]
159159
# set props [list Element Monolithic$nd ConstitutiveLaw Newtonian DENSITY 1.0 DYNAMIC_VISCOSITY 0.002 YIELD_STRESS 0 POWER_LAW_K 1 POWER_LAW_N 1]
160-
set props [list Element Monolithic$nd ConstitutiveLaw Newtonian DENSITY 1.0 DYNAMIC_VISCOSITY 0.002]
160+
set props [list ConstitutiveLaw Newtonian DENSITY 1.0 DYNAMIC_VISCOSITY 0.002]
161161
spdAux::SetValuesOnBaseNode $fluidNode $props
162162

163163
set fluidConditions [spdAux::getRoute "FLBC"]

0 commit comments

Comments
 (0)