Skip to content

Commit 12ed098

Browse files
Working on cdem
1 parent 6f6d75b commit 12ed098

21 files changed

Lines changed: 114 additions & 206 deletions

kratos.gid/apps/CDEM/examples/ContSpheresDrop3D.tcl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ proc ::CDEM::examples::AssignToTreeContSpheres { } {
3939
# Material
4040
set DEMmaterials [spdAux::getRoute "DEMMaterials"]
4141
set props [list PARTICLE_DENSITY 2500.0 YOUNG_MODULUS 1.0e7 ]
42-
set material_node [[customlib::GetBaseRoot] selectNodes "$DEMmaterials/blockdata\[@name = 'DEMCont-DefaultMaterial' \]"]
42+
set material_node [[customlib::GetBaseRoot] selectNodes "$DEMmaterials/blockdata\[@name = 'DEM-DefaultMaterial' \]"]
4343
spdAux::SetValuesOnBaseNode $material_node $props
4444

4545
# Parts
4646
set DEMParts [spdAux::getRoute "DEMParts"]
4747
set DEMPartsNode [customlib::AddConditionGroupOnXPath $DEMParts Body]
4848
$DEMPartsNode setAttribute ov volume
49-
set props [list Material "DEMCont-DefaultMaterial"]
49+
set props [list Material "DEM-DefaultMaterial"]
5050
spdAux::SetValuesOnBaseNode $DEMPartsNode $props
5151

5252
# DEM FEM Walls
@@ -59,7 +59,7 @@ proc ::CDEM::examples::AssignToTreeContSpheres { } {
5959
set DEMInlet "$DEMConditions/condition\[@n='Inlet'\]"
6060
set inletNode [customlib::AddConditionGroupOnXPath $DEMInlet "Inlet"]
6161
$inletNode setAttribute ov surface
62-
set props [list Material "DEMCont-DefaultMaterial" ParticleDiameter 0.13 InVelocityModulus 2.3 InDirectionVector "0.0,0.0,-1.0"]
62+
set props [list Material "DEM-DefaultMaterial" ParticleDiameter 0.13 InVelocityModulus 2.3 InDirectionVector "0.0,0.0,-1.0"]
6363
spdAux::SetValuesOnBaseNode $inletNode $props
6464

6565
# DEM custom submodelpart

kratos.gid/apps/CDEM/examples/ContinuumDrop2D.tcl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,35 +54,35 @@ proc ::CDEM::examples::AssignToTreeContinuumDrop { } {
5454
# Material
5555
set DEMmaterials [spdAux::getRoute "DEMMaterials"]
5656
set props [list PARTICLE_DENSITY 2500.0 YOUNG_MODULUS 1.0e7 ]
57-
set material_node [[customlib::GetBaseRoot] selectNodes "$DEMmaterials/blockdata\[@name = 'DEMCont-DefaultMaterial' \]"]
57+
set material_node [[customlib::GetBaseRoot] selectNodes "$DEMmaterials/blockdata\[@name = 'DEM-DefaultMaterial' \]"]
5858
spdAux::SetValuesOnBaseNode $material_node $props
5959

6060
# Parts
6161
set DEMParts [spdAux::getRoute "DEMParts"]
6262
set DEMPartsNode [customlib::AddConditionGroupOnXPath $DEMParts LowPart]
6363
$DEMPartsNode setAttribute ov surface
64-
set props [list Material "DEMCont-DefaultMaterial"]
64+
set props [list Material "DEM-DefaultMaterial"]
6565
spdAux::SetValuesOnBaseNode $DEMPartsNode $props
6666

6767
# Parts
6868
set DEMParts [spdAux::getRoute "DEMParts"]
6969
set DEMPartsNode [customlib::AddConditionGroupOnXPath $DEMParts MidPart]
7070
$DEMPartsNode setAttribute ov surface
71-
set props [list Material "DEMCont-DefaultMaterial"]
71+
set props [list Material "DEM-DefaultMaterial"]
7272
spdAux::SetValuesOnBaseNode $DEMPartsNode $props
7373

7474
# Parts
7575
set DEMParts [spdAux::getRoute "DEMParts"]
7676
set DEMPartsNode [customlib::AddConditionGroupOnXPath $DEMParts TopPart]
7777
$DEMPartsNode setAttribute ov surface
78-
set props [list Material "DEMCont-DefaultMaterial"]
78+
set props [list Material "DEM-DefaultMaterial"]
7979
spdAux::SetValuesOnBaseNode $DEMPartsNode $props
8080

8181
# Parts
8282
set DEMParts [spdAux::getRoute "DEMParts"]
8383
set DEMPartsNode [customlib::AddConditionGroupOnXPath $DEMParts Sand]
8484
$DEMPartsNode setAttribute ov surface
85-
set props [list Material "DEMCont-DefaultMaterial"]
85+
set props [list Material "DEM-DefaultMaterial"]
8686
spdAux::SetValuesOnBaseNode $DEMPartsNode $props
8787

8888
# DEM FEM Walls

kratos.gid/apps/CDEM/start.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ proc ::CDEM::LoadMyFiles { } {
4040
uplevel #0 [list source [file join $dir write write.tcl]]
4141
uplevel #0 [list source [file join $dir write writeMDPA_Parts.tcl]]
4242
uplevel #0 [list source [file join $dir write writeMDPA_Walls.tcl]]
43-
uplevel #0 [list source [file join $dir write writeMDPA_Inlet.tcl]]
43+
# uplevel #0 [list source [file join $dir write writeMDPA_Inlet.tcl]]
4444
uplevel #0 [list source [file join $dir write writeProjectParameters.tcl]]
4545
uplevel #0 [list source [file join $dir examples examples.tcl]]
4646
}

kratos.gid/apps/CDEM/write/writeMDPA_Inlet.tcl

Lines changed: 0 additions & 39 deletions
This file was deleted.

kratos.gid/apps/CDEM/write/writeMDPA_Parts.tcl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
proc DEM::write::WriteMDPAParts { } {
1+
proc CDEM::write::WriteMDPAParts { } {
22
variable last_property_id
33

44
# Prepare properties
@@ -63,11 +63,11 @@ proc CDEM::write::GetDEMGroupsCustomSubmodelpart { } {
6363
set groups [list ]
6464
set xp2 "[spdAux::getRoute [GetAttribute conditions_un]]/condition\[@n = 'DEM-CustomSmp'\]/group"
6565
foreach group [[customlib::GetBaseRoot] selectNodes $xp2] {
66-
set destination_mdpa [write::getValueByNode [$group selectNodes "./value\[@n='WhatMdpa'\]"]]
67-
if {$destination_mdpa == "DEM"} {
68-
set groupid [$group @n]
69-
lappend groups [write::GetWriteGroupName $groupid]
70-
}
66+
set destination_mdpa [write::getValueByNode [$group selectNodes "./value\[@n='WhatMdpa'\]"]]
67+
if {$destination_mdpa == "DEM"} {
68+
set groupid [$group @n]
69+
lappend groups [write::GetWriteGroupName $groupid]
70+
}
7171
}
7272
return $groups
7373
}
@@ -76,12 +76,12 @@ proc CDEM::write::writeSphereRadius { } {
7676
set root [customlib::GetBaseRoot]
7777
set xp1 "[spdAux::getRoute [GetAttribute partscont_un]]/group"
7878
foreach group [$root selectNodes $xp1] {
79-
set groupid [$group @n]
80-
set grouppid [write::GetWriteGroupName $groupid]
81-
write::WriteString "Begin NodalData RADIUS // GUI group identifier: $grouppid"
82-
GiD_WriteCalculationFile connectivities [dict create $groupid "%.0s %10d 0 %10g\n"]
83-
write::WriteString "End NodalData"
84-
write::WriteString ""
79+
set groupid [$group @n]
80+
set grouppid [write::GetWriteGroupName $groupid]
81+
write::WriteString "Begin NodalData RADIUS // GUI group identifier: $grouppid"
82+
GiD_WriteCalculationFile connectivities [dict create $groupid "%.0s %10d 0 %10g\n"]
83+
write::WriteString "End NodalData"
84+
write::WriteString ""
8585
}
8686
}
8787

Lines changed: 13 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,29 @@
1-
proc DEM::write::WriteMDPAWalls { } {
2-
# Headers
3-
write::writeModelPartData
41

5-
# Material
6-
set wall_properties [WriteRigidWallProperties]
72

8-
# Nodal coordinates (only for Walls <inefficient> )
9-
write::writeNodalCoordinatesOnGroups [DEM::write::GetRigidWallsGroups]
10-
write::writeNodalCoordinatesOnGroups [GetWallsGroupsSmp]
113

12-
# Nodal conditions and conditions
13-
DEM::write::writeConditions $wall_properties
14-
15-
# SubmodelParts
16-
DEM::write::writeWallConditionMeshes
17-
18-
# CustomSubmodelParts
19-
WriteWallCustomSmp
20-
}
21-
22-
23-
proc CDEM::write::WriteWallCustomSmp { } {
24-
set xp1 "[spdAux::getRoute [GetAttribute conditions_un]]/condition\[@n = 'DEM-CustomSmp'\]/group"
25-
set i $DEM::write::last_property_id
26-
foreach group [[customlib::GetBaseRoot] selectNodes $xp1] {
27-
incr i
28-
set groupid [$group @n]
29-
set destination_mdpa [write::getValueByNode [$group selectNodes "./value\[@n='WhatMdpa'\]"]]
30-
if {$destination_mdpa == "FEM"} {
31-
write::WriteString "Begin SubModelPart $groupid \/\/ Custom SubModelPart. Group name: $groupid"
32-
write::WriteString "Begin SubModelPartData // DEM-FEM-Wall. Group name: $groupid"
33-
write::WriteString "End SubModelPartData"
34-
write::WriteString "Begin SubModelPartNodes"
35-
GiD_WriteCalculationFile nodes -sorted [dict create [write::GetWriteGroupName $groupid] [subst "%10i\n"]]
36-
write::WriteString "End SubModelPartNodes"
37-
write::WriteString "End SubModelPart"
38-
write::WriteString ""
39-
}
40-
}
41-
}
42-
43-
proc DEM::write::DefineFEMExtraConditions {group_node} {
4+
proc DEM::write::DefineFEMExtraConditions {props} {
445
set material_analysis [write::getValue DEMTestMaterial Active]
456
if {$material_analysis == "true"} {
46-
set is_material_test [write::getValueByNode [$group_node selectNodes "./value\[@n='MaterialTest'\]"]]
7+
set is_material_test [dict get $props Material Variables MaterialTest]
478
if {$is_material_test == "true"} {
48-
set as_condition [write::getValueByNode [$group_node selectNodes "./value\[@n='DefineTopBot'\]"]]
9+
set as_condition [dict get $props Material Variables DefineTopBot]
4910
if {$as_condition eq "top"} {
5011
write::WriteString " TOP 1"
5112
write::WriteString " BOTTOM 0"
5213
} else {
5314
write::WriteString " TOP 0"
54-
write::WriteString " BOTTOM 1"}
15+
write::WriteString " BOTTOM 1"
16+
}
5517
}
5618
} else {
57-
write::WriteString " TOP 0"
58-
write::WriteString " BOTTOM 0"}
59-
set GraphPrint [write::getValueByNode [$group_node selectNodes "./value\[@n='GraphPrint'\]"]]
60-
if {$GraphPrint == "true" || $material_analysis == "true"} {
61-
set GraphPrintval 1
62-
} else {
63-
set GraphPrintval 0
19+
write::WriteString " TOP 0"
20+
write::WriteString " BOTTOM 0"
6421
}
22+
23+
set GraphPrint [dict get $props Material Variables GraphPrint]
24+
set GraphPrintval 0
25+
if {[write::isBooleanTrue $GraphPrint]} {
26+
set GraphPrintval 1
27+
}
6528
write::WriteString " FORCE_INTEGRATION_GROUP $GraphPrintval"
6629
}

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

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,6 @@
44
proc CDEM::write::getParametersDict { } {
55
set project_parameters_dict [DEM::write::getParametersDict]
66

7-
set ElementType SphericContPartDEMElement3D
8-
if {$ElementType eq "SphericPartDEMElement3D" || $ElementType eq "CylinderPartDEMElement2D"} {
9-
set dem_strategy "sphere_strategy"
10-
} elseif {$ElementType eq "SphericContPartDEMElement3D" || $ElementType eq "CylinderContPartDEMElement3D"} {
11-
set dem_strategy "continuum_sphere_strategy"
12-
} elseif {$ElementType eq "ThermalSphericPartDEMElement3D"} {
13-
set dem_strategy "thermal_sphere_strategy"
14-
} elseif {$ElementType eq "ThermalSphericContPartDEMElement3D"} {
15-
set dem_strategy "thermal_continuum_sphere_strategy"
16-
} elseif {$ElementType eq "SinteringSphericConPartDEMElement3D"} {
17-
set dem_strategy "thermal_continuum_sphere_strategy"
18-
} elseif {$ElementType eq "IceContPartDEMElement3D"} {
19-
set dem_strategy "ice_continuum_sphere_strategy"
20-
}
21-
22-
dict set project_parameters_dict "solver_settings" "strategy" $dem_strategy
23-
dict set project_parameters_dict "ElementType" $ElementType
24-
257
dict set project_parameters_dict "DeltaOption" [write::getValue AdvOptions DeltaOption]
268
dict set project_parameters_dict "SearchTolerance" [write::getValue AdvOptions TangencyAbsoluteTolerance]
279
dict set project_parameters_dict "CoordinationNumber" [write::getValue AdvOptions TangencyCoordinationNumber]
@@ -51,6 +33,11 @@ proc CDEM::write::getParametersDict { } {
5133
return $project_parameters_dict
5234
}
5335

36+
37+
proc DEM::write::GetDemStrategyName { } {
38+
return continuum_sphere_strategy
39+
}
40+
5441
proc CDEM::write::GetTimeSettings { } {
5542
return [DEM::write::GetTimeSettings]
5643
}
@@ -61,5 +48,6 @@ proc CDEM::write::GetGravity { } {
6148

6249
proc CDEM::write::writeParametersEvent { } {
6350
write::SetParallelismConfiguration
64-
write::WriteJSON [CDEM::write::getParametersDict]
51+
set cdem_parameters [CDEM::write::getParametersDict]
52+
write::WriteJSON $cdem_parameters
6553
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<container n="AdvOptions" un="AdvOptions" pn="Advanced settings" help="Extra settings for particle problems" icon="solver">
3+
<value n="DeltaOption" type="bool" pn="Bond creation method" values="Absolute,Coordination_Number" v="Absolute" icon="black1" help="Absolute method: create bonds between particles closer than a fixed a distance value. Coordination number method: The program will iterate until an average number of contacts per particle is achieved."/>
4+
<value n="TangencyAbsoluteTolerance" v="0.0001" pn="Tangency tolerance value" icon="black1" help="Fixed a distance value" state="[getStateFromXPathValue {string(../value[@n='DeltaOption']/@v)} Absolute]" update_proc="spdAux::RequestRefresh" />
5+
<value n="TangencyCoordinationNumber" v="10" pn="Coordination number" icon="black1" help="Average number of expected bonds." state="[getStateFromXPathValue {string(../value[@n='DeltaOption']/@v)} Coordination_Number]" update_proc="spdAux::RequestRefresh" />
6+
<value n="PoissonEffect" type="bool" pn="Poisson effect" values="true,false" v="false" icon="black1" help="Activate to accurately simulate Poisson deformations"/>
7+
<value n="ShearStrainParallelToBondEffect" type="bool" pn="Shear strain parallel effect" values="true,false" v="false" icon="black1" help="Activate to consider strain caused by shear"/>
8+
<value n="ComputeStressTensorOption" type="bool" pn="Compute stress tensor" values="true,false" v="false" icon="black1" help="Activate to calculate the stress tensor on particles"/>
9+
<value n="CleanIndentations" type="bool" pn="Clean initial indentations:particles" values="true,false" v="false" icon="black1" help="Activate to avoid instability caused by initially indented particles"/>
10+
<value n="RemoveParticlesInWalls" type="bool" pn="Clean initial indentations:walls" values="true,false" v="false" icon="black1" help="Activate to avoid instability caused by initially indented particles against finite elements"/>
11+
<value n="CalculateRotations" type="bool" pn="Calculate rotations" values="true,false" v="true" icon="black1" help="Activate to consider torques and rotations on the particles. This option will slightly increase computation times."/>
12+
<value n="RollingFriction" type="bool" pn="Rolling friction" values="true,false" v="false" icon="black1" help="Activate to consider the rolling friction parameter set in the properties. Otherwise it will be ignored."/>
13+
<value n="VirtualMassCoef" v="1.0" pn="Virtual mass coefficient" icon="black1" help="Alterate particle mass set in the simulation"/>
14+
<value n="GlobalDamping" v="0.0" pn="Global damping" icon="black1" help="Choose the value for the damping. Set it to 1.0 for maximum energy dissipation."/>
15+
<value n="AmplifiedSearchRadius" v="1.1" pn="AmplifiedSearchRadius" icon="black1" state="hidden" />
16+
<!-- <value n="NeighbourSearchAcceptedGap" v="1.0" pn="NeighbourSearchAcceptedGap" icon="black1"/> -->
17+
<value n="SearchTolerance" v="0.001" pn="Search tolerance" icon="black1" help="Minimum tolerance to avoid initial overlaps"/>
18+
</container>

kratos.gid/apps/CDEM/xml/ConstitutiveLawsC.xml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,5 @@
7575
<outputs></outputs>
7676
</CLaw>
7777

78-
<!-- <CLaw n="LinearElasticPlaneStrain2DLaw" pn="Linear Elastic Plane Strain" ProductionReady="ProductionReady" Type="PlaneStrain" Behaviour="Elastic" StrainSize="3" ImplementedInApplication="StructuralMechanicsApplication" help="Linear elastic behaviour in 2D plane strain" Dimension="2D" LargeDeformation="False" RequiresLocalAxes="False" HybridType="False">
79-
<inputs>
80-
<parameter n="DENSITY" pn="Density" unit_magnitude="Density" units="kg/m^3" v="7850"/>
81-
<parameter n="YOUNG_MODULUS" pn="Young Modulus" unit_magnitude="P" units="Pa" v="206.9e9" />
82-
<parameter n="POISSON_RATIO" pn="Poisson Ratio" v="0.29"/>
83-
</inputs>
84-
<outputs>
85-
</outputs>
86-
</CLaw> -->
8778

8879
</ConstitutiveLaws>

kratos.gid/apps/CDEM/xml/ElementsC.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
<filter field="App" value="CDEM"/>
1313
</ConstitutiveLaw_FilterFeatures>
1414
<NodalConditions></NodalConditions>
15-
<inputs></inputs>
15+
<inputs>
16+
<parameter n="Material" pn="Material" v="" type="combo" combotype="material" help="Material"/>
17+
</inputs>
1618
<outputs></outputs>
1719
</ElementItem>
1820

@@ -26,7 +28,9 @@
2628
<filter field="App" value="CDEM"/>
2729
</ConstitutiveLaw_FilterFeatures>
2830
<NodalConditions></NodalConditions>
29-
<inputs></inputs>
31+
<inputs>
32+
<parameter n="Material" pn="Material" v="" type="combo" combotype="material" help="Material"/>
33+
</inputs>
3034
<outputs></outputs>
3135
</ElementItem>
3236
</ElementList>

0 commit comments

Comments
 (0)