Skip to content

Commit

Permalink
[FEM] Elmer: fix heat flux handling
Browse files Browse the repository at this point in the history
- the heat flux in the temperature constraint is not the heat flux from the heatflux constraint. The latter is in W/m² while the first one is W/mesh node
  • Loading branch information
donovaly committed Aug 13, 2022
1 parent 2edf6ab commit 08af39c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/Mod/Fem/femsolver/elmer/writer.py
Expand Up @@ -44,6 +44,7 @@
from . import solver as solverClass
from .. import settings
from femmesh import gmshtools
from femmesh import meshtools
from femtools import constants
from femtools import femutils
from femtools import membertools
Expand Down Expand Up @@ -461,14 +462,26 @@ def _updateHeatSolver(self, equation):
equation.PhaseChangeModel = "None"

def _handleHeatBndConditions(self):
i = -1
for obj in self._getMember("Fem::ConstraintTemperature"):
i = i + 1
femobjects = membertools.get_several_member(self.analysis, "Fem::ConstraintTemperature")
femobjects[i]["Nodes"] = meshtools.get_femnodes_by_femobj_with_references(
self._getSingleMember("Fem::FemMeshObject").FemMesh,
femobjects[i]
)
NumberOfNodes = len(femobjects[i]["Nodes"])
if obj.References:
for name in obj.References[0][1]:
if obj.ConstraintType == "Temperature":
temp = self._getFromUi(obj.Temperature, "K", "O")
self._boundary(name, "Temperature", temp)
elif obj.ConstraintType == "CFlux":
flux = self._getFromUi(obj.CFlux, "kg*mm^2*s^-3", "M*L^2*T^-3")
# the CFLUX property stores the value in µW
# but the unit system is not aware of µW, only of mW
flux = 0.001 * self._getFromUi(obj.CFlux, "mW", "M*L^2*T^-3")
# CFLUX is the flux per mesh node
flux = flux / NumberOfNodes
self._boundary(name, "Temperature Load", flux)
self._handled(obj)
for obj in self._getMember("Fem::ConstraintHeatflux"):
Expand Down

0 comments on commit 08af39c

Please sign in to comment.