From 08b93de8ccd68d1650bc7a6c68d397d94b808dac Mon Sep 17 00:00:00 2001 From: Eduardo Soudah Date: Tue, 19 Nov 2019 21:13:05 +0100 Subject: [PATCH 01/13] add Bingham3DLawand element formulation --- kratos.gid/apps/Fluid/write/writeProjectParameters.tcl | 2 +- kratos.gid/apps/Fluid/xml/ConstitutiveLaws.xml | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/kratos.gid/apps/Fluid/write/writeProjectParameters.tcl b/kratos.gid/apps/Fluid/write/writeProjectParameters.tcl index d938e5ac7..81a3c94f0 100644 --- a/kratos.gid/apps/Fluid/write/writeProjectParameters.tcl +++ b/kratos.gid/apps/Fluid/write/writeProjectParameters.tcl @@ -208,7 +208,7 @@ proc Fluid::write::getSolverSettingsDict { } { if {$currentStrategyId eq "Monolithic"} { set formulationSettingsDict [dict create] # Set element type - dict set formulationSettingsDict element_type "vms" + dict set formulationSettingsDict element_type "qsvms" # Set OSS and remove oss_switch from the original dictionary # It is important to check that there is oss_switch, otherwise the derived apps (e.g. embedded) might crash if {[dict exists $solverSettingsDict oss_switch]} { diff --git a/kratos.gid/apps/Fluid/xml/ConstitutiveLaws.xml b/kratos.gid/apps/Fluid/xml/ConstitutiveLaws.xml index e43c5960f..0e3e517ec 100644 --- a/kratos.gid/apps/Fluid/xml/ConstitutiveLaws.xml +++ b/kratos.gid/apps/Fluid/xml/ConstitutiveLaws.xml @@ -20,18 +20,17 @@ - + From eaac8e5d4d849706da16c68bae21ecb325e9f865 Mon Sep 17 00:00:00 2001 From: Eduardo Soudah Date: Thu, 21 Nov 2019 11:59:47 +0100 Subject: [PATCH 02/13] HerschelBulkleyLaw --- kratos.gid/apps/Fluid/xml/ConstitutiveLaws.xml | 17 ++++++++++++++++- kratos.gid/kratos.win.bat | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/kratos.gid/apps/Fluid/xml/ConstitutiveLaws.xml b/kratos.gid/apps/Fluid/xml/ConstitutiveLaws.xml index 0e3e517ec..ba4231b48 100644 --- a/kratos.gid/apps/Fluid/xml/ConstitutiveLaws.xml +++ b/kratos.gid/apps/Fluid/xml/ConstitutiveLaws.xml @@ -20,7 +20,7 @@ - + @@ -33,4 +33,19 @@ + + + + + + + + + + + + + + + diff --git a/kratos.gid/kratos.win.bat b/kratos.gid/kratos.win.bat index d21c8e32d..028cc422b 100644 --- a/kratos.gid/kratos.win.bat +++ b/kratos.gid/kratos.win.bat @@ -11,7 +11,7 @@ DEL "%2\%1.info" DEL "%2\%1.err" set PATH=%3\\exec\\kratos;%3\\exec\\kratos\\libs;%PATH% -REM set PYTHONPATH=%3\\exec\\kratos +set PYTHONPATH=%3\\exec\\kratos REM Set the number of threads for OpenMP REM export OMP_NUM_THREADS=%5 REM set OMP_NUM_THREADS=%5 From b307a19de9dc7738a73f94c80ea3fbb010c1d9b0 Mon Sep 17 00:00:00 2001 From: Eduardo Soudah Date: Thu, 21 Nov 2019 12:03:04 +0100 Subject: [PATCH 03/13] hB --- kratos.gid/apps/Fluid/xml/ConstitutiveLaws.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kratos.gid/apps/Fluid/xml/ConstitutiveLaws.xml b/kratos.gid/apps/Fluid/xml/ConstitutiveLaws.xml index ba4231b48..956c2860a 100644 --- a/kratos.gid/apps/Fluid/xml/ConstitutiveLaws.xml +++ b/kratos.gid/apps/Fluid/xml/ConstitutiveLaws.xml @@ -20,7 +20,7 @@ - + From 86325fc75fc110d4291b95624cf25a9f73130637 Mon Sep 17 00:00:00 2001 From: Eduardo Soudah Date: Thu, 21 Nov 2019 12:40:36 +0100 Subject: [PATCH 04/13] HB2 --- kratos.gid/apps/Fluid/xml/ConstitutiveLaws.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/kratos.gid/apps/Fluid/xml/ConstitutiveLaws.xml b/kratos.gid/apps/Fluid/xml/ConstitutiveLaws.xml index 956c2860a..99c761e7e 100644 --- a/kratos.gid/apps/Fluid/xml/ConstitutiveLaws.xml +++ b/kratos.gid/apps/Fluid/xml/ConstitutiveLaws.xml @@ -41,6 +41,7 @@ + From 971b24b58dd0d9c23f39069cb28eac854c741104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20G=C3=A1rate?= Date: Thu, 21 Nov 2019 16:03:56 +0100 Subject: [PATCH 05/13] not needed --- kratos.gid/kratos.win.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kratos.gid/kratos.win.bat b/kratos.gid/kratos.win.bat index 028cc422b..d21c8e32d 100644 --- a/kratos.gid/kratos.win.bat +++ b/kratos.gid/kratos.win.bat @@ -11,7 +11,7 @@ DEL "%2\%1.info" DEL "%2\%1.err" set PATH=%3\\exec\\kratos;%3\\exec\\kratos\\libs;%PATH% -set PYTHONPATH=%3\\exec\\kratos +REM set PYTHONPATH=%3\\exec\\kratos REM Set the number of threads for OpenMP REM export OMP_NUM_THREADS=%5 REM set OMP_NUM_THREADS=%5 From 4a3086c1570284ae0d67d07fbb4d76f3ac86d37d Mon Sep 17 00:00:00 2001 From: Eduardo Soudah Date: Thu, 21 Nov 2019 16:45:43 +0100 Subject: [PATCH 06/13] WSS_variables --- kratos.gid/apps/Fluid/xml/Elements.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kratos.gid/apps/Fluid/xml/Elements.xml b/kratos.gid/apps/Fluid/xml/Elements.xml index cd1081b7b..eb7d3ffad 100644 --- a/kratos.gid/apps/Fluid/xml/Elements.xml +++ b/kratos.gid/apps/Fluid/xml/Elements.xml @@ -43,6 +43,10 @@ + + + + @@ -91,6 +95,10 @@ + + + + From 323c61845a2f70167d4138099d8983a36620e1a8 Mon Sep 17 00:00:00 2001 From: Eduardo Soudah Date: Thu, 21 Nov 2019 16:54:23 +0100 Subject: [PATCH 07/13] createvariable --- kratos.gid/apps/Fluid/xml/NodalConditions.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kratos.gid/apps/Fluid/xml/NodalConditions.xml b/kratos.gid/apps/Fluid/xml/NodalConditions.xml index 93ac31730..9acb7e3ca 100644 --- a/kratos.gid/apps/Fluid/xml/NodalConditions.xml +++ b/kratos.gid/apps/Fluid/xml/NodalConditions.xml @@ -14,5 +14,12 @@ + + + + + + + From 1f57ad90984e87d6bed1c2f6d65be855279b2d08 Mon Sep 17 00:00:00 2001 From: Eduardo Soudah Date: Thu, 21 Nov 2019 16:57:45 +0100 Subject: [PATCH 08/13] variable_nodes --- kratos.gid/apps/Fluid/xml/NodalConditions.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kratos.gid/apps/Fluid/xml/NodalConditions.xml b/kratos.gid/apps/Fluid/xml/NodalConditions.xml index 9acb7e3ca..37ba30dd0 100644 --- a/kratos.gid/apps/Fluid/xml/NodalConditions.xml +++ b/kratos.gid/apps/Fluid/xml/NodalConditions.xml @@ -15,7 +15,7 @@ - + From eed9c884112a70c50193699ee856aa8b0f1bb6a6 Mon Sep 17 00:00:00 2001 From: Eduardo Soudah Date: Thu, 21 Nov 2019 17:03:04 +0100 Subject: [PATCH 09/13] Variable_onNodes --- kratos.gid/apps/Fluid/xml/Elements.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kratos.gid/apps/Fluid/xml/Elements.xml b/kratos.gid/apps/Fluid/xml/Elements.xml index eb7d3ffad..b5edfd94f 100644 --- a/kratos.gid/apps/Fluid/xml/Elements.xml +++ b/kratos.gid/apps/Fluid/xml/Elements.xml @@ -38,6 +38,7 @@ + @@ -90,6 +91,7 @@ + From 0008a139141a3ea2edbbdedb741c7885ee179348 Mon Sep 17 00:00:00 2001 From: Eduardo Soudah Date: Thu, 21 Nov 2019 17:19:58 +0100 Subject: [PATCH 10/13] minos changes --- kratos.gid/apps/Fluid/xml/Elements.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kratos.gid/apps/Fluid/xml/Elements.xml b/kratos.gid/apps/Fluid/xml/Elements.xml index b5edfd94f..54e09f796 100644 --- a/kratos.gid/apps/Fluid/xml/Elements.xml +++ b/kratos.gid/apps/Fluid/xml/Elements.xml @@ -104,4 +104,4 @@ - + \ No newline at end of file From dd5196554a5c62a937abcdb021aacd5c6af60bd0 Mon Sep 17 00:00:00 2001 From: Eduardo Soudah Date: Tue, 26 Nov 2019 14:32:40 +0100 Subject: [PATCH 11/13] WSS_variables --- .../Fluid/write/writeProjectParameters.tcl | 36 +++++++++++++++++++ kratos.gid/apps/Fluid/xml/WSS.spd | 6 ++++ 2 files changed, 42 insertions(+) create mode 100644 kratos.gid/apps/Fluid/xml/WSS.spd diff --git a/kratos.gid/apps/Fluid/write/writeProjectParameters.tcl b/kratos.gid/apps/Fluid/write/writeProjectParameters.tcl index 81a3c94f0..7831bf8e0 100644 --- a/kratos.gid/apps/Fluid/write/writeProjectParameters.tcl +++ b/kratos.gid/apps/Fluid/write/writeProjectParameters.tcl @@ -35,10 +35,46 @@ proc Fluid::write::getAuxiliarProcessList {} { set process_list [list ] foreach process [getDragProcessList] {lappend process_list $process} + foreach process [getWSSProcessList] {lappend process_list $process} + return $process_list } +proc Fluid::write::getWSSProcessList {} { + set root [customlib::GetBaseRoot] + + set process_list [list ] + set xp1 "[spdAux::getRoute [GetAttribute drag_un]]/group" + set groups [$root selectNodes $xp1] + foreach group $groups { + set groupName [$group @n] + set groupName [write::GetWriteGroupName $groupName] + set cid [[$group parent] @n] + set submodelpart [::write::getSubModelPartId $cid $groupName] + + set write_output [write::getStringBinaryFromValue [write::getValueByNode [$group selectNodes "./value\[@n='write_drag_output_file'\]"]]] + set print_screen [write::getStringBinaryFromValue [write::getValueByNode [$group selectNodes "./value\[@n='print_drag_to_screen'\]"]]] + set interval_name [write::getValueByNode [$group selectNodes "./value\[@n='Interval'\]"]] + + set pdict [dict create] + dict set pdict "python_module" "compute_wss_statistics_process" + dict set pdict "kratos_module" "KratosMultiphysics.FluidDynamicsBiomedicalApplication" + dict set pdict "process_name" "ComputeWssStatisticsProcess" + set params [dict create] + dict set params "model_part_name" [write::GetModelPartNameWithParent $submodelpart] + dict set params "calculate_wss" true + dict set params "calculate_osi" true + dict set pdict "Parameters" $params + + lappend process_list $pdict + } + + return $process_list +} + + + proc Fluid::write::getDragProcessList {} { set root [customlib::GetBaseRoot] diff --git a/kratos.gid/apps/Fluid/xml/WSS.spd b/kratos.gid/apps/Fluid/xml/WSS.spd new file mode 100644 index 000000000..d0b1b8d36 --- /dev/null +++ b/kratos.gid/apps/Fluid/xml/WSS.spd @@ -0,0 +1,6 @@ + + + + + + From 9a82dad8bc68be775940f0182c7703b6d8ee19d1 Mon Sep 17 00:00:00 2001 From: Eduardo Soudah Date: Tue, 26 Nov 2019 14:33:27 +0100 Subject: [PATCH 12/13] WSS_variables --- kratos.gid/apps/Fluid/write/writeProjectParameters.tcl | 2 -- kratos.gid/apps/Fluid/xml/WSS.spd | 2 +- kratos.gid/apps/Fluid/xml/XmlController.tcl | 7 +++++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/kratos.gid/apps/Fluid/write/writeProjectParameters.tcl b/kratos.gid/apps/Fluid/write/writeProjectParameters.tcl index 7831bf8e0..6ef8e32ca 100644 --- a/kratos.gid/apps/Fluid/write/writeProjectParameters.tcl +++ b/kratos.gid/apps/Fluid/write/writeProjectParameters.tcl @@ -37,7 +37,6 @@ proc Fluid::write::getAuxiliarProcessList {} { foreach process [getDragProcessList] {lappend process_list $process} foreach process [getWSSProcessList] {lappend process_list $process} - return $process_list } @@ -74,7 +73,6 @@ proc Fluid::write::getWSSProcessList {} { } - proc Fluid::write::getDragProcessList {} { set root [customlib::GetBaseRoot] diff --git a/kratos.gid/apps/Fluid/xml/WSS.spd b/kratos.gid/apps/Fluid/xml/WSS.spd index d0b1b8d36..05927a029 100644 --- a/kratos.gid/apps/Fluid/xml/WSS.spd +++ b/kratos.gid/apps/Fluid/xml/WSS.spd @@ -3,4 +3,4 @@ - + \ No newline at end of file diff --git a/kratos.gid/apps/Fluid/xml/XmlController.tcl b/kratos.gid/apps/Fluid/xml/XmlController.tcl index b0bcb4888..e7c9dab24 100644 --- a/kratos.gid/apps/Fluid/xml/XmlController.tcl +++ b/kratos.gid/apps/Fluid/xml/XmlController.tcl @@ -37,6 +37,13 @@ proc Fluid::xml::CustomTree { args } { gid_groups_conds::addF $xpath include [list n Drag active 1 path {apps/Fluid/xml/Drag.spd}] } + # WSS in output settings + set xpath "[spdAux::getRoute FLResults]/container\[@n='GiDOutput'\]" + if {[$root selectNodes "$xpath/condition\[@n='WSS'\]"] eq ""} { + gid_groups_conds::addF $xpath include [list n WSS active 1 path {apps/Fluid/xml/WSS.spd}] + } + + customlib::ProcessIncludes $::Kratos::kratos_private(Path) spdAux::parseRoutes From cdd5651fcca59ebba1b544c76b803551d119ec17 Mon Sep 17 00:00:00 2001 From: Eduardo Soudah Date: Tue, 26 Nov 2019 14:44:20 +0100 Subject: [PATCH 13/13] Wss --- kratos.gid/apps/Fluid/write/write.tcl | 9 +++++++++ kratos.gid/apps/Fluid/write/writeByGiDId.tcl | 8 ++++++++ kratos.gid/apps/Fluid/write/writeProjectParameters.tcl | 10 +++++----- kratos.gid/apps/Fluid/xml/WSS.spd | 8 ++++---- kratos.gid/apps/Fluid/xml/XmlController.tcl | 2 +- 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/kratos.gid/apps/Fluid/write/write.tcl b/kratos.gid/apps/Fluid/write/write.tcl index a2cdbbce2..c4f7b2112 100644 --- a/kratos.gid/apps/Fluid/write/write.tcl +++ b/kratos.gid/apps/Fluid/write/write.tcl @@ -17,6 +17,7 @@ proc Fluid::write::Init { } { SetAttribute materials_un FLMaterials SetAttribute results_un FLResults SetAttribute drag_un FLDrags + SetAttribute wss_un FLWsss SetAttribute time_parameters_un FLTimeParameters SetAttribute writeCoordinatesByGroups 0 SetAttribute validApps [list "Fluid"] @@ -108,6 +109,7 @@ proc Fluid::write::writeProperties { } { proc Fluid::write::writeConditions { } { writeBoundaryConditions writeDrags + writeWsss } proc Fluid::write::getFluidModelPartFilename { } { @@ -158,6 +160,13 @@ proc Fluid::write::writeDrags { } { Model::ForgetNodalCondition Drag } +proc Fluid::write::writeWsss { } { + lappend ::Model::NodalConditions [::Model::NodalCondition new Wss] + write::writeNodalConditions [GetAttribute wss_un] + Model::ForgetNodalCondition Wss +} + + proc Fluid::write::writeMeshes { } { write::writePartSubModelPart write::writeNodalConditions [GetAttribute nodal_conditions_un] diff --git a/kratos.gid/apps/Fluid/write/writeByGiDId.tcl b/kratos.gid/apps/Fluid/write/writeByGiDId.tcl index 9b1bc9546..3712c5bed 100644 --- a/kratos.gid/apps/Fluid/write/writeByGiDId.tcl +++ b/kratos.gid/apps/Fluid/write/writeByGiDId.tcl @@ -14,6 +14,7 @@ proc Fluid::write::Init { } { SetAttribute conditions_un FLBC SetAttribute materials_un FLMaterials SetAttribute drag_un FLDrags + SetAttribute wss_un FLWsss SetAttribute writeCoordinatesByGroups 0 SetAttribute validApps [list "Fluid"] SetAttribute main_script_file "KratosFluid.py" @@ -88,6 +89,7 @@ proc Fluid::write::writeProperties { } { proc Fluid::write::writeConditions { } { writeBoundaryConditions writeDrags + writeWsss } proc Fluid::write::writeBoundaryConditions { } { @@ -104,6 +106,12 @@ proc Fluid::write::writeDrags { } { Model::ForgetNodalCondition Drag } +proc Fluid::write::writeWsss { } { + lappend ::Model::NodalConditions [::Model::NodalCondition new Wss] + write::writeNodalConditions [GetAttribute wss] + Model::ForgetNodalCondition Wss +} + proc Fluid::write::writeMeshes { } { write::writePartSubModelPart write::writeNodalConditions [GetAttribute nodal_conditions_un] diff --git a/kratos.gid/apps/Fluid/write/writeProjectParameters.tcl b/kratos.gid/apps/Fluid/write/writeProjectParameters.tcl index 6ef8e32ca..027ec1e79 100644 --- a/kratos.gid/apps/Fluid/write/writeProjectParameters.tcl +++ b/kratos.gid/apps/Fluid/write/writeProjectParameters.tcl @@ -35,16 +35,16 @@ proc Fluid::write::getAuxiliarProcessList {} { set process_list [list ] foreach process [getDragProcessList] {lappend process_list $process} - foreach process [getWSSProcessList] {lappend process_list $process} + foreach process [getWssProcessList] {lappend process_list $process} return $process_list } -proc Fluid::write::getWSSProcessList {} { +proc Fluid::write::getWssProcessList {} { set root [customlib::GetBaseRoot] set process_list [list ] - set xp1 "[spdAux::getRoute [GetAttribute drag_un]]/group" + set xp1 "[spdAux::getRoute [GetAttribute wss_un]]/group" set groups [$root selectNodes $xp1] foreach group $groups { set groupName [$group @n] @@ -52,8 +52,8 @@ proc Fluid::write::getWSSProcessList {} { set cid [[$group parent] @n] set submodelpart [::write::getSubModelPartId $cid $groupName] - set write_output [write::getStringBinaryFromValue [write::getValueByNode [$group selectNodes "./value\[@n='write_drag_output_file'\]"]]] - set print_screen [write::getStringBinaryFromValue [write::getValueByNode [$group selectNodes "./value\[@n='print_drag_to_screen'\]"]]] + set write_output [write::getStringBinaryFromValue [write::getValueByNode [$group selectNodes "./value\[@n='write_wss_output_file'\]"]]] + set print_screen [write::getStringBinaryFromValue [write::getValueByNode [$group selectNodes "./value\[@n='print_wss_to_screen'\]"]]] set interval_name [write::getValueByNode [$group selectNodes "./value\[@n='Interval'\]"]] set pdict [dict create] diff --git a/kratos.gid/apps/Fluid/xml/WSS.spd b/kratos.gid/apps/Fluid/xml/WSS.spd index 05927a029..658b9c519 100644 --- a/kratos.gid/apps/Fluid/xml/WSS.spd +++ b/kratos.gid/apps/Fluid/xml/WSS.spd @@ -1,6 +1,6 @@ - - - + + + - \ No newline at end of file + diff --git a/kratos.gid/apps/Fluid/xml/XmlController.tcl b/kratos.gid/apps/Fluid/xml/XmlController.tcl index e7c9dab24..7f0b0096e 100644 --- a/kratos.gid/apps/Fluid/xml/XmlController.tcl +++ b/kratos.gid/apps/Fluid/xml/XmlController.tcl @@ -39,7 +39,7 @@ proc Fluid::xml::CustomTree { args } { # WSS in output settings set xpath "[spdAux::getRoute FLResults]/container\[@n='GiDOutput'\]" - if {[$root selectNodes "$xpath/condition\[@n='WSS'\]"] eq ""} { + if {[$root selectNodes "$xpath/condition\[@n='Wss'\]"] eq ""} { gid_groups_conds::addF $xpath include [list n WSS active 1 path {apps/Fluid/xml/WSS.spd}] }