[FEM] Elmer: fix mistake with transient solving

- there is proper info, just in another Elmer manual. This unveiled my mistake - the timestepping parameters are a list
This commit is contained in:
Uwe
2022-08-06 16:01:55 +02:00
parent 43dcbe4a31
commit b5a34817db
2 changed files with 14 additions and 17 deletions

View File

@@ -83,26 +83,21 @@ class Proxy(solverbase.Proxy):
obj.BDFOrder = (2, 1, 5, 1)
obj.addProperty(
"App::PropertyIntegerConstraint",
"App::PropertyIntegerList",
"TimestepIntervals",
"Timestepping",
"Maximum optimization rounds if 'Simulation Type'\nis either 'Scanning' or 'Transient'"
"List of maximum optimization rounds if 'Simulation Type'\nis either 'Scanning' or 'Transient'"
)
obj.addProperty(
"App::PropertyFloatConstraint",
"App::PropertyFloatList",
"TimestepSizes",
"Timestepping",
"Time step of optimization if 'Simulation Type'\nis either 'Scanning' or 'Transient'"
"List of time steps of optimization if 'Simulation Type'\nis either 'Scanning' or 'Transient'"
)
# there is no universal default, it all depends on the analysis, however
# we have to set something and set 10 seconds in steps of 0.1s
# since the Emler manual lacks proper info, here a link to a forum thread:
# http://www.elmerfem.org/forum/viewtopic.php?p=18057&sid=73169c4ec544fd7f181f85178bbc8ffe#p18057
# -----
# Set maximum to 1e8 because on Win the max int is always 32bit (4.29e9)
# for TimestepSizes also 1e8 just to set something
obj.TimestepIntervals = (100, 1, int(1e8), 10)
obj.TimestepSizes = (0.1, 1e-8, 1e8, 0.1)
obj.TimestepIntervals = [100]
obj.TimestepSizes = [0.1]
obj.addProperty(
"App::PropertyEnumeration",

View File

@@ -341,6 +341,8 @@ class Writer(object):
):
self._simulation("Timestep Intervals", self.solver.TimestepIntervals)
self._simulation("Timestep Sizes", self.solver.TimestepSizes)
# Output Intervals must be equal to Timestep Intervals
self._simulation("Output Intervals", self.solver.TimestepIntervals)
if hasHeat:
self._simulation("Timestepping Method", "BDF")
self._simulation("Use Mesh Names", True)
@@ -366,26 +368,26 @@ class Writer(object):
solver.SimulationType = "Steady State"
if not hasattr(self.solver, "TimestepIntervals"):
solver.addProperty(
"App::PropertyIntegerConstraint",
"App::PropertyIntegerList",
"TimestepIntervals",
"Timestepping",
(
"Maximum optimization rounds if 'Simulation Type'\n"
"List of maximum optimization rounds if 'Simulation Type'\n"
"is either 'Scanning' or 'Transient'"
)
)
solver.TimestepIntervals = (100, 1, int(1e8), 10)
solver.TimestepIntervals = [100]
if not hasattr(self.solver, "TimestepSizes"):
solver.addProperty(
"App::PropertyFloatConstraint",
"App::PropertyFloatList",
"TimestepSizes",
"Timestepping",
(
"Time step of optimization if 'Simulation Type'\n"
"List of time steps of optimization if 'Simulation Type'\n"
"is either 'Scanning' or 'Transient'"
)
)
solver.TimestepSizes = (0.1, 1e-8, 1e8, 0.1)
solver.TimestepSizes = [0.1]
def _handleHeat(self):
activeIn = []