From bbc21b336a2e14bdff53751371fcbc030e2b92ea Mon Sep 17 00:00:00 2001 From: Uwe Date: Wed, 3 Aug 2022 02:32:01 +0200 Subject: [PATCH] [FEM] Elmer: fix solver stabilize settings - according to https://www.nic.funet.fi/index/elmer/doc/ElmerModelsManual.pdf the stabilization methods are equation-specific and only available for some solvers This commits changes these settings according to the manual --- src/Mod/Fem/femsolver/elmer/equations/flow.py | 9 +++++++++ src/Mod/Fem/femsolver/elmer/equations/heat.py | 17 +++++++++++++++++ src/Mod/Fem/femsolver/elmer/equations/linear.py | 14 -------------- src/Mod/Fem/femsolver/elmer/writer.py | 8 +------- 4 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/Mod/Fem/femsolver/elmer/equations/flow.py b/src/Mod/Fem/femsolver/elmer/equations/flow.py index 2e9db83796..ae63df7ae4 100644 --- a/src/Mod/Fem/femsolver/elmer/equations/flow.py +++ b/src/Mod/Fem/femsolver/elmer/equations/flow.py @@ -44,6 +44,15 @@ class Proxy(nonlinear.Proxy, equationbase.FlowProxy): def __init__(self, obj): super(Proxy, self).__init__(obj) + + obj.addProperty( + "App::PropertyBool", + "Stabilize", + "Flow", + "" + ) + obj.Stabilize = True + obj.Priority = 10 diff --git a/src/Mod/Fem/femsolver/elmer/equations/heat.py b/src/Mod/Fem/femsolver/elmer/equations/heat.py index 7775cf3a4a..4be7c27541 100644 --- a/src/Mod/Fem/femsolver/elmer/equations/heat.py +++ b/src/Mod/Fem/femsolver/elmer/equations/heat.py @@ -44,6 +44,23 @@ class Proxy(nonlinear.Proxy, equationbase.HeatProxy): def __init__(self, obj): super(Proxy, self).__init__(obj) + + # according to the Elmer models manual Bubbles is by default True + # Stabilize is False + obj.addProperty( + "App::PropertyBool", + "Stabilize", + "Heat", + "" + ) + obj.addProperty( + "App::PropertyBool", + "Bubbles", + "Heat", + "" + ) + obj.Bubbles = True + obj.Priority = 20 diff --git a/src/Mod/Fem/femsolver/elmer/equations/linear.py b/src/Mod/Fem/femsolver/elmer/equations/linear.py index 40b937038e..f6e1fc523a 100644 --- a/src/Mod/Fem/femsolver/elmer/equations/linear.py +++ b/src/Mod/Fem/femsolver/elmer/equations/linear.py @@ -126,20 +126,6 @@ class Proxy(equation.Proxy): ) # same as with LinearTolerance obj.setExpression('SteadyStateTolerance', "1e-5") - obj.addProperty( - "App::PropertyBool", - "Stabilize", - "Base", - "" - ) - obj.Stabilize = True - obj.addProperty( - "App::PropertyBool", - "Bubbles", - "Base", - "" - ) - obj.Bubbles = False class ViewProxy(equation.ViewProxy): diff --git a/src/Mod/Fem/femsolver/elmer/writer.py b/src/Mod/Fem/femsolver/elmer/writer.py index 1b43b108e7..3bb2ea6767 100644 --- a/src/Mod/Fem/femsolver/elmer/writer.py +++ b/src/Mod/Fem/femsolver/elmer/writer.py @@ -474,8 +474,6 @@ class Writer(object): s["Calculate Capacitance Matrix"] = equation.CalculateCapacitanceMatrix s["Displace mesh"] = False s["Exec Solver"] = "Always" - s["Stabilize"] = equation.Stabilize - s["Bubbles"] = equation.Bubbles s["Optimize Bandwidth"] = True return s @@ -585,7 +583,7 @@ class Writer(object): def _getElasticitySolver(self, equation): s = self._createLinearSolver(equation) - s["Equation"] = equation.Name + s["Equation"] = "Stress Solver" # equation.Name s["Procedure"] = sifio.FileAttr("StressSolve/StressSolver") s["Variable"] = self._getUniqueVarName("Displacement") s["Variable DOFs"] = 3 @@ -597,8 +595,6 @@ class Writer(object): s["Calculate Pangle"] = equation.CalculatePangle s["Displace mesh"] = False s["Exec Solver"] = "Always" - s["Stabilize"] = equation.Stabilize - s["Bubbles"] = equation.Bubbles s["Optimize Bandwidth"] = True return s @@ -771,11 +767,9 @@ class Writer(object): def _getFlowSolver(self, equation): s = self._createNonlinearSolver(equation) s["Equation"] = "Navier-Stokes" - # s["Equation"] = equation.Name s["Procedure"] = sifio.FileAttr("FlowSolve/FlowSolver") s["Exec Solver"] = "Always" s["Stabilize"] = equation.Stabilize - s["Bubbles"] = equation.Bubbles s["Optimize Bandwidth"] = True return s