[FEM] fine-tune flow examples

- use a more sensible velocity distribution
- change inlet temperature for 2 examples

- also change step size for nonlinear iterations for more convenience for practical usage
This commit is contained in:
Uwe
2023-03-20 07:03:56 +01:00
parent 866ea2551d
commit f1799f27b0
4 changed files with 11 additions and 9 deletions

View File

@@ -179,7 +179,7 @@ def setup(doc=None, solvertype="elmer"):
# constraint inlet velocity
FlowVelocity_Inlet = ObjectsFem.makeConstraintFlowVelocity(doc, "FlowVelocity_Inlet")
FlowVelocity_Inlet.References = [(BooleanFragments, "Edge5")]
FlowVelocity_Inlet.VelocityXFormula = "Variable Coordinate 2; Real MATC \"-0.01*(tx-1)*(2-tx)\""
FlowVelocity_Inlet.VelocityXFormula = "Variable Coordinate 2; Real MATC \"10*(tx+50e-3)*(50e-3-tx)\""
FlowVelocity_Inlet.VelocityXUnspecified = False
FlowVelocity_Inlet.VelocityXHasFormula = True
FlowVelocity_Inlet.VelocityYUnspecified = False
@@ -214,7 +214,7 @@ def setup(doc=None, solvertype="elmer"):
# constraint inlet temperature
Temperature_Inlet = ObjectsFem.makeConstraintTemperature(doc, "Temperature_Inlet")
Temperature_Inlet.Temperature = 350.0
Temperature_Inlet.Temperature = 300.0
Temperature_Inlet.NormalDirection = Vector(-1, 0, 0)
Temperature_Inlet.References = [(BooleanFragments, "Edge5")]
analysis.addObject(Temperature_Inlet)

View File

@@ -223,7 +223,7 @@ def setup(doc=None, solvertype="elmer"):
# constraint inlet temperature
Temperature_Inlet = ObjectsFem.makeConstraintTemperature(doc, "Temperature_Inlet")
Temperature_Inlet.Temperature = 350.0
Temperature_Inlet.Temperature = 300.0
Temperature_Inlet.NormalDirection = Vector(-1, 0, 0)
Temperature_Inlet.References = [(BooleanFragments, "Edge5")]
analysis.addObject(Temperature_Inlet)

View File

@@ -134,8 +134,8 @@ def setup(doc=None, solvertype="elmer"):
equation_flow.LinearIterativeMethod = "Idrs"
equation_flow.LinearPreconditioning = "ILU1"
equation_flow.setExpression("LinearTolerance", "1e-6")
equation_flow.NonlinearIterations = 30
equation_flow.NonlinearNewtonAfterIterations = 30
equation_flow.NonlinearIterations = 40
equation_flow.NonlinearNewtonAfterIterations = 40
equation_flow.RelaxationFactor = 0.1
equation_flow.setExpression("NonlinearTolerance", "1e-4")
equation_flow.Variable = "Flow Solution[Velocity:2 Pressure:1]"
@@ -144,8 +144,8 @@ def setup(doc=None, solvertype="elmer"):
equation_heat.LinearIterativeMethod = "Idrs"
equation_heat.LinearPreconditioning = "ILU1"
equation_heat.setExpression("LinearTolerance", "1e-6")
equation_heat.NonlinearIterations = 30
equation_heat.NonlinearNewtonAfterIterations = 30
equation_heat.NonlinearIterations = 40
equation_heat.NonlinearNewtonAfterIterations = 40
equation_heat.setExpression("NonlinearTolerance", "1e-4")
equation_heat.Priority = 5
equation_heat.RelaxationFactor = 0.1
@@ -185,8 +185,10 @@ def setup(doc=None, solvertype="elmer"):
# constraint inlet velocity
FlowVelocity_Inlet = ObjectsFem.makeConstraintFlowVelocity(doc, "FlowVelocity_Inlet")
FlowVelocity_Inlet.References = [(BooleanFragments, "Edge5")]
FlowVelocity_Inlet.VelocityX = "20.0 mm/s"
FlowVelocity_Inlet.VelocityXFormula = "Variable Coordinate 2; Real MATC \"10*(tx+50e-3)*(50e-3-tx)\""
FlowVelocity_Inlet.VelocityXUnspecified = False
FlowVelocity_Inlet.VelocityXHasFormula = True
FlowVelocity_Inlet.VelocityYUnspecified = False
analysis.addObject(FlowVelocity_Inlet)
# constraint wall velocity

View File

@@ -76,7 +76,7 @@ class Proxy(linear.Proxy):
)
)
obj.NonlinearIterations = (500, 1, int(1e6), 50)
obj.NonlinearIterations = (500, 1, int(1e6), 10)
obj.NonlinearNewtonAfterIterations = (3, 1, 100, 1)
# for small numbers we must set an expression because we don't have a UI,
# the user has to view and edit the tolerance via the property editor and