From fa7cffcc9cd6f495d05b485bf00d8d638fac9cca Mon Sep 17 00:00:00 2001 From: Javi Garate Date: Fri, 11 Feb 2022 19:56:34 +0100 Subject: [PATCH] Update to time stepping in fsi --- .../xml/TimeParametersWithSubstepping.spd | 4 ++-- .../apps/FSI/examples/HighRiseBuilding.tcl | 16 ++++++++-------- .../examples/MokChannelWithFlexibleWall.tcl | 4 +++- .../apps/FSI/examples/TurekBenchmark.tcl | 4 +++- .../apps/FSI/write/writeProjectParameters.tcl | 2 +- .../FSI/xml/SolutionStrategyStructural.spd | 19 +++++++------------ 6 files changed, 24 insertions(+), 25 deletions(-) diff --git a/kratos.gid/apps/Common/xml/TimeParametersWithSubstepping.spd b/kratos.gid/apps/Common/xml/TimeParametersWithSubstepping.spd index 723304ff0..ae629bdd6 100644 --- a/kratos.gid/apps/Common/xml/TimeParametersWithSubstepping.spd +++ b/kratos.gid/apps/Common/xml/TimeParametersWithSubstepping.spd @@ -2,8 +2,8 @@ - - + + diff --git a/kratos.gid/apps/FSI/examples/HighRiseBuilding.tcl b/kratos.gid/apps/FSI/examples/HighRiseBuilding.tcl index ef9b33c36..de178e66d 100644 --- a/kratos.gid/apps/FSI/examples/HighRiseBuilding.tcl +++ b/kratos.gid/apps/FSI/examples/HighRiseBuilding.tcl @@ -55,7 +55,7 @@ proc ::FSI::examples::HighRiseBuilding::AssignGroups2D {args} { GiD_Groups create Structure GiD_Groups create Ground GiD_Groups create InterfaceStructure - + GiD_EntitiesGroups assign Structure surfaces 2 GiD_EntitiesGroups assign Ground lines 12 GiD_EntitiesGroups assign InterfaceStructure lines {9 10 11} @@ -91,7 +91,7 @@ proc ::FSI::examples::HighRiseBuilding::TreeAssignation {args} { # Fluid Inlet Fluid::xml::CreateNewInlet Inlet {new true name inlet1 ini 0 end 10.0} true "25.0*t/10.0" Fluid::xml::CreateNewInlet Inlet {new true name inlet2 ini 10.0 end End} false 25.0 - + # Fluid Outlet set fluidOutlet "$fluidConditions/condition\[@n='Outlet$nd'\]" set outletNode [customlib::AddConditionGroupOnXPath $fluidOutlet Outlet] @@ -115,33 +115,31 @@ proc ::FSI::examples::HighRiseBuilding::TreeAssignation {args} { set fluidDisplacementNode [customlib::AddConditionGroupOnXPath $fluidDisplacement "FluidALEMeshBC//Total"] $fluidDisplacementNode setAttribute ov line set props [list selector_component_X ByValue value_component_X 0.0 selector_component_Y ByValue value_component_Y 0.0 selector_component_Z ByValue value_component_Z 0.0 Interval Total] - + spdAux::SetValuesOnBaseNode $fluidDisplacementNode $props } # Time parameters set parameters [list EndTime 40.0 DeltaTime 0.05] set xpath [spdAux::getRoute "FLTimeParameters"] - spdAux::SetValuesOnBasePath $xpath $parameters # Output set parameters [list OutputControlType time OutputDeltaTime 1.0] set xpath "[spdAux::getRoute FLResults]/container\[@n='GiDOutput'\]/container\[@n='GiDOptions'\]" - spdAux::SetValuesOnBasePath $xpath $parameters # Fluid domain strategy settings set parameters [list relative_velocity_tolerance "1e-8" absolute_velocity_tolerance "1e-10" relative_pressure_tolerance "1e-8" absolute_pressure_tolerance "1e-10" maximum_iterations "20"] set xpath [spdAux::getRoute FLStratParams] - + spdAux::SetValuesOnBasePath $xpath $parameters # Structural gid_groups_conds::setAttributesF {container[@n='FSI']/container[@n='Structural']/container[@n='StageInfo']/value[@n='SolutionType']} {v Dynamic} # Structural Parts - + set structParts [spdAux::getRoute "STParts"]/condition\[@n='Parts_Solid'\] set structPartsNode [customlib::AddConditionGroupOnXPath $structParts Structure] $structPartsNode setAttribute ov surface @@ -161,9 +159,11 @@ proc ::FSI::examples::HighRiseBuilding::TreeAssignation {args} { spdAux::SetValuesOnBaseNode $structDisplacementNode $props # Structure domain time parameters - set parameters [list EndTime 40.0 DeltaTime 0.05] + set parameters [list EndTime 40.0] set xpath [spdAux::getRoute STTimeParameters] spdAux::SetValuesOnBasePath $xpath $parameters + set xpath "[spdAux::getRoute STTimeParameters]/container\[@n='TimeStep'\]/blockdata/value\[@n='DeltaTime'\]" + [[customlib::GetBaseRoot] selectNodes $xpath] setAttribute v 0.05 # Structural Interface customlib::AddConditionGroupOnXPath "container\[@n='FSI'\]/container\[@n='Structural'\]/container\[@n='Loads'\]/condition\[@n='StructureInterface$nd'\]" InterfaceStructure diff --git a/kratos.gid/apps/FSI/examples/MokChannelWithFlexibleWall.tcl b/kratos.gid/apps/FSI/examples/MokChannelWithFlexibleWall.tcl index fe80b35ce..9a1505f8e 100644 --- a/kratos.gid/apps/FSI/examples/MokChannelWithFlexibleWall.tcl +++ b/kratos.gid/apps/FSI/examples/MokChannelWithFlexibleWall.tcl @@ -278,9 +278,11 @@ proc ::FSI::examples::MokChannelFlexibleWall::TreeAssignation {args} { customlib::AddConditionGroupOnXPath "container\[@n='FSI'\]/container\[@n='Structural'\]/container\[@n='Loads'\]/condition\[@n='StructureInterface$nd'\]" StructureInterface # Structure domain time parameters - set parameters [list EndTime 25.0 DeltaTime 0.1] + set parameters [list EndTime 25.0] set xpath [spdAux::getRoute STTimeParameters] spdAux::SetValuesOnBasePath $xpath $parameters + set xpath "[spdAux::getRoute STTimeParameters]/container\[@n='TimeStep'\]/blockdata/value\[@n='DeltaTime'\]" + [[customlib::GetBaseRoot] selectNodes $xpath] setAttribute v 0.1 # Structure domain output parameters set parameters [list OutputControlType step] diff --git a/kratos.gid/apps/FSI/examples/TurekBenchmark.tcl b/kratos.gid/apps/FSI/examples/TurekBenchmark.tcl index 6b9599e42..3d80c6514 100644 --- a/kratos.gid/apps/FSI/examples/TurekBenchmark.tcl +++ b/kratos.gid/apps/FSI/examples/TurekBenchmark.tcl @@ -278,9 +278,11 @@ proc ::FSI::examples::TurekBenchmark::TreeAssignation {args} { customlib::AddConditionGroupOnXPath "container\[@n='FSI'\]/container\[@n='Structural'\]/container\[@n='Loads'\]/condition\[@n='StructureInterface$nd'\]" StructureInterface # Structure domain time parameters - set parameters [list EndTime 20.0 DeltaTime 0.002] + set parameters [list EndTime 20.0] set xpath [spdAux::getRoute STTimeParameters] spdAux::SetValuesOnBasePath $xpath $parameters + set xpath "[spdAux::getRoute STTimeParameters]/container\[@n='TimeStep'\]/blockdata/value\[@n='DeltaTime'\]" + [[customlib::GetBaseRoot] selectNodes $xpath] setAttribute v 0.002 # Structure domain output parameters set parameters [list OutputControlType time OutputDeltaTime 0.01] diff --git a/kratos.gid/apps/FSI/write/writeProjectParameters.tcl b/kratos.gid/apps/FSI/write/writeProjectParameters.tcl index 4f20cf496..1a6f4f530 100644 --- a/kratos.gid/apps/FSI/write/writeProjectParameters.tcl +++ b/kratos.gid/apps/FSI/write/writeProjectParameters.tcl @@ -179,7 +179,7 @@ proc ::FSI::write::InitExternalProjectParameters { } { # Structure section UpdateUniqueNames Structure apps::setActiveAppSoft Structure - Structural::write::SetAttribute time_parameters_un FLTimeParameters + # Structural::write::SetAttribute time_parameters_un FLTimeParameters write::initWriteConfiguration [Structural::write::GetAttributes] set FSI::write::structure_project_parameters [Structural::write::getParametersDict] diff --git a/kratos.gid/apps/FSI/xml/SolutionStrategyStructural.spd b/kratos.gid/apps/FSI/xml/SolutionStrategyStructural.spd index 953421764..3c384b9ae 100644 --- a/kratos.gid/apps/FSI/xml/SolutionStrategyStructural.spd +++ b/kratos.gid/apps/FSI/xml/SolutionStrategyStructural.spd @@ -1,19 +1,14 @@ - + - + - - + + - - - - - - - - + + +