Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.

Commit

Permalink
Nlu dev (#206)
Browse files Browse the repository at this point in the history
* Fix #203

* Up to 2.10.2

* fix bugs in heatflowbcs and add minStrainRate

Co-authored-by: Romain Beucher <romain.beucher@anu.edu.au>
  • Loading branch information
NengLu and rbeucher authored Nov 16, 2020
1 parent a887052 commit bfd68f6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion UWGeodynamics/_boundary_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ def __init__(self, Model, left=None, right=None, top=None, bottom=None,
right = self._get_heat_flux(right[0], right[1])

if top:
top = self._get_heat_flux(top[0], right[1])
top = self._get_heat_flux(top[0], top[1])

if bottom:
bottom = self._get_heat_flux(bottom[0], bottom[1])
Expand Down
10 changes: 8 additions & 2 deletions UWGeodynamics/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ def __init__(self, elementRes=(64, 64),

# Initialise remaining attributes
self.defaultStrainRate = 1e-15 / u.second
self.minStrainRate = 1e-20 / u.second
self._solution_exist = fn.misc.constant(False)
self._temperatureDot = None
self._temperature = None
Expand Down Expand Up @@ -445,6 +446,11 @@ def strainRate_2ndInvariant(self):
condition = [(self._solution_exist, self._strainRate_2ndInvariant),
(True, fn.misc.constant(nd(self.defaultStrainRate)))]
self._strainRate_2ndInvariant = fn.branching.conditional(condition)

condition = [(self._strainRate_2ndInvariant<=nd(self.minStrainRate),nd(self.minStrainRate)),
(True, self._strainRate_2ndInvariant)]
self._strainRate_2ndInvariant = fn.branching.conditional(condition)

return self._strainRate_2ndInvariant

@property
Expand Down Expand Up @@ -632,7 +638,7 @@ def set_temperatureBCs(self, left=None, right=None,

def set_heatFlowBCs(self, left=None, right=None,
top=None, bottom=None,
front=None, back=None):
front=None, back=None,nodeSets=None, materials=None):

""" Define heat flow boundaries condition
Expand Down Expand Up @@ -714,7 +720,7 @@ def set_heatFlowBCs(self, left=None, right=None,

self._heatFlowBCs = HeatFlowBCs(self, left=left, right=right,
top=top, bottom=bottom,
back=back, front=front)
back=back, front=front,nodeSets=nodeSets,materials=materials)
return self._heatFlowBCs.get_conditions()

@property
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

MAJOR = 2
MINOR = 10
MICRO = 1
ISRELEASED = False
MICRO = 2
ISRELEASED = True
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)

here = path.abspath(path.dirname(__file__))
Expand Down

0 comments on commit bfd68f6

Please sign in to comment.