Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEM] Change to process #856

Draft
wants to merge 90 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
1fa6a58
base idea
farrufat-cimne Oct 27, 2021
763fe8c
building the gid tree
farrufat-cimne Nov 8, 2021
65df0da
update
farrufat-cimne Nov 8, 2021
d62d828
update
farrufat-cimne Nov 9, 2021
544ff45
select groups for conditions
farrufat-cimne Nov 16, 2021
32ec1ea
update
farrufat-cimne Nov 17, 2021
5eeafc3
testing
farrufat-cimne Nov 17, 2021
8e00fca
Filter example
jginternational Nov 18, 2021
34cabf7
fix python modules in processes
farrufat-cimne Nov 18, 2021
e7d329a
moved advancing mesh features inside DEM parts
farrufat-cimne Nov 18, 2021
8c1848c
Unified conditions file
farrufat-cimne Nov 22, 2021
af4b296
example for test new interface
farrufat-cimne Nov 23, 2021
916c8d3
missing
farrufat-cimne Nov 23, 2021
01ddd09
missing tree refresh
jginternational Nov 23, 2021
3bf311a
inlet for test example
farrufat-cimne Nov 24, 2021
75d498a
assign mesh size
farrufat-cimne Nov 24, 2021
97efff1
test dbg
farrufat-cimne Nov 25, 2021
c96ea80
update
farrufat-cimne Nov 25, 2021
44e483d
minor change
farrufat-cimne Nov 26, 2021
8152e5f
json
farrufat-cimne Nov 29, 2021
60c0d76
updated tree with injectors
farrufat-cimne Dec 1, 2021
8ee6bd0
final tree form
farrufat-cimne Dec 2, 2021
5dcc536
changes in example test
farrufat-cimne Dec 2, 2021
f32dfed
added inlet condition to the example test
farrufat-cimne Dec 3, 2021
429dc55
minor
farrufat-cimne Dec 9, 2021
e209d1d
writes process in json
farrufat-cimne Dec 13, 2021
1d76a43
update write conditions
farrufat-cimne Dec 14, 2021
0043537
fix
farrufat-cimne Dec 14, 2021
ffa6f9c
incorrect dict
farrufat-cimne Dec 15, 2021
514432c
partial updated wall mdpa write
farrufat-cimne Dec 15, 2021
26a5ed9
get kinematic condition name
farrufat-cimne Dec 16, 2021
3365d1a
test
farrufat-cimne Dec 16, 2021
8a0f859
fix loads process write
farrufat-cimne Dec 21, 2021
2d9add3
Merge branch 'master' into dem/add_processes
jginternational Jan 13, 2022
20004c1
improved wall print in mdpa
jginternational Jan 13, 2022
362a8e8
update
farrufat-cimne Jan 17, 2022
d524cc5
update
farrufat-cimne Jan 20, 2022
458d3a2
updated and added some inlet writing
farrufat-cimne Feb 4, 2022
6227e77
removed ghost and material from inlet tab
farrufat-cimne Feb 7, 2022
f722985
updated example test
farrufat-cimne Feb 8, 2022
0d37bb9
hide in tree
farrufat-cimne Feb 8, 2022
ba01e16
fix missing typos
farrufat-cimne Feb 8, 2022
82fa025
whitespaces
jginternational Feb 8, 2022
c67be89
get groups to mesh in parts
jginternational Feb 8, 2022
ab47a1e
Merge branch 'master' into dem/add_processes
jginternational Feb 8, 2022
f261583
Added Ghost flag in smp
farrufat-cimne Feb 9, 2022
5da6c87
Merge branch 'master' into dem/add_processes
jginternational Feb 9, 2022
6a4152d
updated write dem mdpa
farrufat-cimne Feb 9, 2022
b1c68b4
Merge remote-tracking branch 'origin/dem/add_processes' into dem/add_…
farrufat-cimne Feb 9, 2022
4038bf8
now it writes all DEMParts correctly
farrufat-cimne Feb 10, 2022
24706de
clean
farrufat-cimne Feb 10, 2022
56e42be
Merge branch 'master' into dem/add_processes
jginternational Feb 10, 2022
439d866
minor
jginternational Feb 10, 2022
d453d37
set new unique names for parts groups
jginternational Feb 10, 2022
e99e896
print only dems
jginternational Feb 10, 2022
600c3f1
allow change parts_un in element connectivities write
jginternational Feb 10, 2022
365a794
print only dems
jginternational Feb 10, 2022
46d58d9
printing json element correctly
farrufat-cimne Feb 11, 2022
335d328
looking for model part names
jginternational Feb 11, 2022
09ece4e
update to process modelpart name
farrufat-cimne Feb 14, 2022
0d07cb1
writing update
farrufat-cimne Feb 14, 2022
a73053f
dem parts dependencies
jginternational Feb 15, 2022
a63f1f4
model part for processes
jginternational Feb 15, 2022
8fcf8f7
Use of AssignVectorVariableProcess
jginternational Feb 15, 2022
31fa736
Merge branch 'master' into dem/add_processes
jginternational Feb 16, 2022
dba102c
update
farrufat-cimne Mar 14, 2022
975fe32
fix
farrufat-cimne Mar 14, 2022
0441231
added app in kratos module
farrufat-cimne Mar 14, 2022
8a25222
Merge branch 'master' into dem/add_processes
jginternational Mar 14, 2022
93eb233
missing GetPartsGroupsList
farrufat-cimne Mar 15, 2022
168c61b
remove deprecated and changed default inertia
farrufat-cimne Mar 17, 2022
c177cf7
Merge branch 'master' into dem/add_processes
jginternational Mar 30, 2022
259c0e8
getConditionsParametersDict adds forced_parent_cond_name
jginternational Mar 31, 2022
b1fec77
Dem uses optional parameter @farrufat
jginternational Mar 31, 2022
b9880d6
update test and loads
farrufat-cimne Apr 1, 2022
7472699
deprecated stuff
farrufat-cimne Apr 1, 2022
c3eb8dd
updated AfterMeshGeneration
farrufat-cimne Apr 4, 2022
fd0804e
missing conditions 2D & advancedmeshing
farrufat-cimne Apr 4, 2022
df274b4
ForceTheMeshingOfDEMFEMWallGroups
farrufat-cimne Apr 4, 2022
d528444
update forcemeshing
farrufat-cimne Apr 5, 2022
6f666a4
documentation added
farrufat-cimne Apr 5, 2022
922c01b
updated parts_MDPA
farrufat-cimne Apr 5, 2022
7e0b7d5
added advancedmeshing part to the example
farrufat-cimne Apr 5, 2022
31f9dd4
added quaternion transform
farrufat-cimne Apr 6, 2022
cdd9327
normalize vector and inlet spd
farrufat-cimne Apr 6, 2022
d0bfd0e
added base inlet structure and writing
farrufat-cimne Apr 7, 2022
9096cf5
activated inlet as process
farrufat-cimne Apr 7, 2022
2877ea4
custom injector condition
farrufat-cimne Apr 8, 2022
cf7d7e0
update to inlet process
farrufat-cimne Apr 11, 2022
529f77d
remove movement from inlet process
farrufat-cimne Apr 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion kratos.gid/apps/DEM/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"write/write_utils.tcl",
"examples/examples.tcl",
"examples/SpheresDrop.tcl",
"examples/SpheresDropForTest.tcl",
"examples/CirclesDrop.tcl"
],
"start_script": "::DEM::Init",
Expand All @@ -42,8 +43,10 @@
},
"unique_names": {
"parts": "DEMParts",
"nodal_conditions": "DEMNodalConditions",
"init_conditions": "DEMInitialConditions",
"conditions": "DEMConditions",
"loads": "DEMFEMLoads",
"injectors": "DEMInlet",
"materials": "DEMMaterials"
},
"write": {
Expand Down
2 changes: 2 additions & 0 deletions kratos.gid/apps/DEM/examples/CirclesDrop.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ namespace eval ::DEM::examples::CirclesDrop {
}

proc ::DEM::examples::CirclesDrop::Init {args} {
W "This example requires to be updated to the new version of the interface."

if {![Kratos::IsModelEmpty]} {
set txt "We are going to draw the example geometry.\nDo you want to discard your previous work?"
set retval [tk_messageBox -default ok -icon question -message $txt -type okcancel]
Expand Down
3 changes: 2 additions & 1 deletion kratos.gid/apps/DEM/examples/SpheresDrop.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace eval ::DEM::examples::SpheresDrop {
}

proc ::DEM::examples::SpheresDrop::Init {args} {
W "This example requires to be updated to the new version of the interface."
if {![Kratos::IsModelEmpty]} {
set txt "We are going to draw the example geometry.\nDo you want to discard your previous work?"
set retval [tk_messageBox -default ok -icon question -message $txt -type okcancel]
Expand Down Expand Up @@ -64,7 +65,7 @@ proc ::DEM::examples::SpheresDrop::AssignToTree { } {
set walls "$DEMConditions/condition\[@n='DEM-FEM-Wall'\]"
set wallsNode [customlib::AddConditionGroupOnXPath $walls Floor]
$wallsNode setAttribute ov surface

# Inlet
set DEMInlet "$DEMConditions/condition\[@n='Inlet'\]"
set inletNode [customlib::AddConditionGroupOnXPath $DEMInlet "Inlet"]
Expand Down
249 changes: 249 additions & 0 deletions kratos.gid/apps/DEM/examples/SpheresDropForTest.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
namespace eval ::DEM::examples::SpheresDropForTest {
namespace path ::DEM::examples
Kratos::AddNamespace [namespace current]

}

proc ::DEM::examples::SpheresDropForTest::Init {args} {
if {![Kratos::IsModelEmpty]} {
set txt "We are going to draw the example geometry.\nDo you want to discard your previous work?"
set retval [tk_messageBox -default ok -icon question -message $txt -type okcancel]
if { $retval == "cancel" } { return }
}

DrawGeometry
AssignToTree
AssignMeshSize

GiD_Process 'Redraw
GidUtils::UpdateWindow GROUPS
GidUtils::UpdateWindow LAYER
}

proc ::DEM::examples::SpheresDropForTest::DrawGeometry { } {
Kratos::ResetModel

# Draw floor surface
GiD_Process Mescape Geometry Create Object Rectangle -2 -2 5 2 2 5 escape
GiD_Process Mescape Geometry Create Object Rectangle -2 -2 6 2 2 6 escape
GiD_Process Mescape Geometry Create Object Rectangle -12 -2 5 -8 2 5 escape
GiD_Process Mescape Geometry Create Object Rectangle -12 -2 6 -8 2 6 escape

GiD_Process Mescape Geometry Create Object Rectangle -7 10 6 -2 4 6 escape


# Draw the volumes meshed with spheres
GiD_Process Mescape Geometry Create Object Sphere 0 0 2 1 escape escape
GiD_Process Mescape Geometry Create Object Sphere -3 2 2 1 escape escape
GiD_Process Mescape Geometry Create Object Sphere -7 -2 2 1 escape escape
GiD_Process Mescape Geometry Create Object Sphere -11 -2 2 1 escape escape


# Group creation
GiD_Groups create "f1"
GiD_Groups create "f2"
GiD_Groups create "f3"
GiD_Groups create "f4"

GiD_Groups create "d1"
GiD_Groups create "d2"
GiD_Groups create "d3"
GiD_Groups create "d4"
GiD_Groups create "f2d"

# Group assignation
GiD_EntitiesGroups assign "f1" surfaces 1
GiD_EntitiesGroups assign "f2" surfaces 2
GiD_EntitiesGroups assign "f3" surfaces 3
GiD_EntitiesGroups assign "f4" surfaces 4
GiD_EntitiesGroups assign "f2d" surfaces 5

#GiD_EntitiesGroups assign "ClusterInlet" surfaces 3
GiD_EntitiesGroups assign "d1" volumes 1
GiD_EntitiesGroups assign "d2" volumes 2
GiD_EntitiesGroups assign "d3" volumes 3
GiD_EntitiesGroups assign "d4" volumes 4
}

proc ::DEM::examples::SpheresDropForTest::AssignToTree { } {
# Material
set DEMmaterials [spdAux::getRoute "DEMMaterials"]
set props [list PARTICLE_DENSITY 2500.0 YOUNG_MODULUS 1.0e6]
set material_node [[customlib::GetBaseRoot] selectNodes "$DEMmaterials/blockdata\[@name = 'DEM-DefaultMaterial' \]"]
spdAux::SetValuesOnBaseNode $material_node $props

####### DEM-Parts
set DEMParts [spdAux::getRoute "DEMParts"]/condition\[@n='Parts_DEM'\]
set DEMPartsNode [customlib::AddConditionGroupOnXPath $DEMParts d1]
$DEMPartsNode setAttribute ov volume
set props [list Material "DEM-DefaultMaterial"]
spdAux::SetValuesOnBaseNode $DEMPartsNode $props

set DEMParts [spdAux::getRoute "DEMParts"]/condition\[@n='Parts_DEM'\]
set DEMPartsNode [customlib::AddConditionGroupOnXPath $DEMParts d2]
$DEMPartsNode setAttribute ov volume
set props [list Material "DEM-DefaultMaterial"]
spdAux::SetValuesOnBaseNode $DEMPartsNode $props

set DEMParts [spdAux::getRoute "DEMParts"]/condition\[@n='Parts_DEM'\]
set DEMPartsNode [customlib::AddConditionGroupOnXPath $DEMParts d3]
$DEMPartsNode setAttribute ov volume
set props [list Material "DEM-DefaultMaterial"]
spdAux::SetValuesOnBaseNode $DEMPartsNode $props

set DEMParts [spdAux::getRoute "DEMParts"]/condition\[@n='Parts_DEM'\]
set DEMPartsNode [customlib::AddConditionGroupOnXPath $DEMParts d4]
$DEMPartsNode setAttribute ov volume
set props [list Material "DEM-DefaultMaterial"]
spdAux::SetValuesOnBaseNode $DEMPartsNode $props


set DEMParts [spdAux::getRoute "DEMParts"]/condition\[@n='Parts_DEM'\]
set DEMPartsNode [customlib::AddConditionGroupOnXPath $DEMParts f2d]
$DEMPartsNode setAttribute ov volume
set props [list Material "DEM-DefaultMaterial"]
spdAux::SetValuesOnBaseNode $DEMPartsNode $props
set props_extra [list AdvancedMeshingFeatures Yes AdvancedMeshingFeaturesAlgorithmType FEMtoDEM FEMtoDEM AttheNodes Diameter 0.5 ProbabilityDistribution NormalDistribution StandardDeviation 0.1]
spdAux::SetValuesOnBaseNode $DEMPartsNode $props_extra



###### FEM-Parts
set FEMParts [spdAux::getRoute "DEMParts"]/condition\[@n='Parts_FEM'\]
set FEMPartsNode [customlib::AddConditionGroupOnXPath $FEMParts f1]
$FEMPartsNode setAttribute ov surface
set props [list Material "DEM-DefaultMaterial"]
spdAux::SetValuesOnBaseNode $FEMPartsNode $props

set FEMParts [spdAux::getRoute "DEMParts"]/condition\[@n='Parts_FEM'\]
set FEMPartsNode [customlib::AddConditionGroupOnXPath $FEMParts f2]
$FEMPartsNode setAttribute ov surface
set props [list Material "DEM-DefaultMaterial"]
spdAux::SetValuesOnBaseNode $FEMPartsNode $props

set FEMParts [spdAux::getRoute "DEMParts"]/condition\[@n='Parts_FEM'\]
set FEMPartsNode [customlib::AddConditionGroupOnXPath $FEMParts f3]
$FEMPartsNode setAttribute ov surface
set props [list Material "DEM-DefaultMaterial"]
spdAux::SetValuesOnBaseNode $FEMPartsNode $props

set FEMParts [spdAux::getRoute "DEMParts"]/condition\[@n='Parts_FEM'\]
set FEMPartsNode [customlib::AddConditionGroupOnXPath $FEMParts f4]
$FEMPartsNode setAttribute ov surface
set props [list Material "DEM-DefaultMaterial"]
spdAux::SetValuesOnBaseNode $FEMPartsNode $props





# Velocity over particles
set object_BC {container[@n='DEM']/container[@n='BoundaryConditions']/condition[@n='DEMVelocity']}
set object_BCNode [customlib::AddConditionGroupOnXPath $object_BC d1]
$object_BCNode setAttribute ov volume
set props [list Constraints true,true,true selector_component_X ByValue value_component_X 1.0 selector_component_Y ByValue value_component_Y 0.0 selector_component_Z ByValue value_component_Z 0.0 Interval Total]
spdAux::SetValuesOnBaseNode $object_BCNode $props

# angular Velocity over particles
set object_BC {container[@n='DEM']/container[@n='BoundaryConditions']/condition[@n='DEMAngular']}
set object_BCNode [customlib::AddConditionGroupOnXPath $object_BC d2]
$object_BCNode setAttribute ov volume
set props [list Constraints true,true,true selector_component_X ByValue value_component_X 1.0 selector_component_Y ByValue value_component_Y 1.0 selector_component_Z ByValue value_component_Z 0.0 Interval Total]
spdAux::SetValuesOnBaseNode $object_BCNode $props


# Velocity over fem
set femBC {container[@n='DEM']/container[@n='BoundaryConditions']/condition[@n='FEMVelocity']}
set femBCNode [customlib::AddConditionGroupOnXPath $femBC f1]
$femBCNode setAttribute ov surface
set props [list selector_component_X ByValue value_component_X 1.0 selector_component_Y ByValue value_component_Y 1.0 selector_component_Z ByValue value_component_Z 0.0 Interval Total]
spdAux::SetValuesOnBaseNode $femBCNode $props


# Angular Velocity over fem
set femBC {container[@n='DEM']/container[@n='BoundaryConditions']/condition[@n='FEMAngular']}
set femBCNode [customlib::AddConditionGroupOnXPath $femBC f2]
$femBCNode setAttribute ov surface
set props [list selector_component_X ByValue value_component_X 1.0 selector_component_Y ByValue value_component_Y 0.0 selector_component_Z ByValue value_component_Z 1.0 Interval Total]
spdAux::SetValuesOnBaseNode $femBCNode $props



# force over particles
set object_BC {container[@n='DEM']/container[@n='Loads']/condition[@n='DEMForce']}
set object_BCNode [customlib::AddConditionGroupOnXPath $object_BC d3]
$object_BCNode setAttribute ov volume
set props [list Constraints true,true,true selector_component_X ByValue value_component_X 1.0 selector_component_Y ByValue value_component_Y 2.0 selector_component_Z ByValue value_component_Z 0.0 Interval Total]
spdAux::SetValuesOnBaseNode $object_BCNode $props

# torque over particles
set object_BC {container[@n='DEM']/container[@n='Loads']/condition[@n='DEMTorque']}
set object_BCNode [customlib::AddConditionGroupOnXPath $object_BC d4]
$object_BCNode setAttribute ov volume
set props [list Constraints true,true,true selector_component_X ByValue value_component_X 1.0 selector_component_Y ByValue value_component_Y 0.0 selector_component_Z ByValue value_component_Z 2.0 Interval Total]
spdAux::SetValuesOnBaseNode $object_BCNode $props


# force over particles
set object_BC {container[@n='DEM']/container[@n='Loads']/condition[@n='FEMForce']}
set object_BCNode [customlib::AddConditionGroupOnXPath $object_BC f3]
$object_BCNode setAttribute ov volume
set props [list Constraints true,true,true selector_component_X ByValue value_component_X 1.0 selector_component_Y ByValue value_component_Y 2.0 selector_component_Z ByValue value_component_Z 0.0 Interval Total]
spdAux::SetValuesOnBaseNode $object_BCNode $props

# torque over particles
set object_BC {container[@n='DEM']/container[@n='Loads']/condition[@n='FEMTorque']}
set object_BCNode [customlib::AddConditionGroupOnXPath $object_BC f4]
$object_BCNode setAttribute ov volume
set props [list Constraints true,true,true selector_component_X ByValue value_component_X 1.0 selector_component_Y ByValue value_component_Y 0.0 selector_component_Z ByValue value_component_Z 2.0 Interval Total]
spdAux::SetValuesOnBaseNode $object_BCNode $props



# # InletPart - No inlets de moment
# set FEMParts_inlet [spdAux::getRoute "DEMParts"]/condition\[@n='Parts_Inlet-FEM'\]
# set FEMParts_inletNode [customlib::AddConditionGroupOnXPath $FEMParts_inlet Inlet]
# $FEMParts_inletNode setAttribute ov surface
# set props [list Material "DEM-DefaultMaterial"]
# spdAux::SetValuesOnBaseNode $FEMParts_inletNode $props

# BC over Inlet
# set InletBC {container[@n='DEM']/container[@n='BoundaryConditions']/condition[@n='FEMVelocity']}
# #Velocity over walls is the name on the tree (pn)
# set InletBCNode [customlib::AddConditionGroupOnXPath $InletBC Inlet]
# $InletBCNode setAttribute ov surface
# set props [list selector_component_X ByValue value_component_X 2.0 selector_component_Y ByValue value_component_Y 0.0 selector_component_Z ByValue value_component_Z 0.0 Interval Total]
# spdAux::SetValuesOnBaseNode $InletBCNode $props

# # Inlet
# set InletVars {container[@n='DEM']/container[@n='Injectors']/condition[@n='DEMInlet']}
# set InletVarsNode [customlib::AddConditionGroupOnXPath $InletVars Inlet]
# $InletVarsNode setAttribute ov surface
# set props [list Material "DEM-DefaultMaterial" ParticleDiameter 0.13 InVelocityModulus 2.3 InDirectionVector "0.0,0.0,-1.0"]
# spdAux::SetValuesOnBaseNode $InletVarsNode $props




# spdAux::SetValuesOnBaseNode $inletNode $props

# # DEM custom submodelpart
# set custom_dem "$DEMConditions/condition\[@n='DEM-CustomSmp'\]"
# set customNode [customlib::AddConditionGroupOnXPath $custom_dem Object_1]
# $customNode setAttribute ov volume

# # General data
# # Time parameters
# set change_list [list EndTime 5 DeltaTime 1e-5 NeighbourSearchFrequency 50]
# set xpath [spdAux::getRoute DEMTimeParameters]
# spdAux::SetValuesOnBasePath $xpath $change_list

spdAux::RequestRefresh
}

proc ::DEM::examples::SpheresDropForTest::AssignMeshSize { } {
GiD_Process Mescape Meshing ElemType Sphere Volumes 1 escape
GiD_Process Mescape Meshing AssignSizes Volumes 1 1:end escape escape escape
GiD_Process Mescape Meshing AssignSizes Surfaces 1 1:end escape escape escape
GiD_Process Mescape Meshing AssignSizes Lines 1 1:end escape escape escape
}
3 changes: 3 additions & 0 deletions kratos.gid/apps/DEM/examples/examples.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
<Example id="DEMDrop3D" app="DEM" logo="SpheresDrop.png" name="DEM spheres drop 3D" dim="3D" cmd="::DEM::examples::SpheresDrop::Init">
<Description></Description>
</Example>
<Example id="DEMDrop3DTest" app="DEM" logo="SpheresDrop.png" name="Test new interface" dim="3D" cmd="::DEM::examples::SpheresDropForTest::Init">
<Description></Description>
</Example>
</Group>
Loading