@@ -1271,9 +1271,18 @@ def __init__(self, pid):
1271
1271
self .des_nsid = 0
1272
1272
self .des_rsf = 1
1273
1273
1274
- def set_hourglass (self , type = HourglassType .STANDARD_LSDYNA_VISCOUS ):
1275
- """Set the hourglass type, which identifies the bulk viscosity."""
1274
+ def set_hourglass (self , type = HourglassType .STANDARD_LSDYNA_VISCOUS , coefficient = 0.1 ):
1275
+ """Set the hourglass type, which identifies the bulk viscosity.
1276
+
1277
+ Parameters
1278
+ ----------
1279
+ type : enum
1280
+ Default hourglass control type.
1281
+ coefficient : float, optional
1282
+ Default hourglass coefficient. The default is ``0.``.
1283
+ """
1276
1284
self .hourglasstype = type .value
1285
+ self .coefficient = coefficient
1277
1286
1278
1287
def set_shear_factor (self , factor ):
1279
1288
"""Set the shear correction factor, which scales the transverse shear stress."""
@@ -1344,7 +1353,9 @@ def set_property(self):
1344
1353
)
1345
1354
self .secid = sec .id
1346
1355
if self .hourglasstype > 0 :
1347
- ret = self .stub .CreateHourglass (HourglassRequest (ihq = self .hourglasstype , qm = 1 , q1 = 0 , q2 = 0 , qb = 0 , qw = 0 ))
1356
+ ret = self .stub .CreateHourglass (
1357
+ HourglassRequest (ihq = self .hourglasstype , qm = self .coefficient , q1 = 0 , q2 = 0 , qb = 0 , qw = 0 )
1358
+ )
1348
1359
self .hgid = ret .id
1349
1360
else :
1350
1361
self .hgid = 0
@@ -1423,16 +1434,27 @@ def __init__(self, pid):
1423
1434
self .type = "SOLID"
1424
1435
self .hourglasstype = - 1
1425
1436
1426
- def set_hourglass (self , type = HourglassType .STANDARD_LSDYNA_VISCOUS ):
1427
- """Set the hourglass type, which identifies the bulk viscosity."""
1437
+ def set_hourglass (self , type = HourglassType .STANDARD_LSDYNA_VISCOUS , coefficient = 0.1 ):
1438
+ """Set the hourglass type, which identifies the bulk viscosity.
1439
+
1440
+ Parameters
1441
+ ----------
1442
+ type : enum
1443
+ Default hourglass control type.
1444
+ coefficient : float, optional
1445
+ Default hourglass coefficient. The default is ``0.``.
1446
+ """
1428
1447
self .hourglasstype = type .value
1448
+ self .coefficient = coefficient
1429
1449
1430
1450
def set_property (self ):
1431
1451
"""Set the properties for the solid part."""
1432
1452
ret = self .stub .CreateSectionSolid (SectionSolidRequest (elform = self .formulation ))
1433
1453
self .secid = ret .id
1434
1454
if self .hourglasstype > 0 :
1435
- ret = self .stub .CreateHourglass (HourglassRequest (ihq = self .hourglasstype , qm = 1 , q1 = 0 , q2 = 0 , qb = 0 , qw = 0 ))
1455
+ ret = self .stub .CreateHourglass (
1456
+ HourglassRequest (ihq = self .hourglasstype , qm = self .coefficient , q1 = 0 , q2 = 0 , qb = 0 , qw = 0 )
1457
+ )
1436
1458
self .hgid = ret .id
1437
1459
else :
1438
1460
self .hgid = 0
@@ -1741,6 +1763,7 @@ class ThermalAnalysis:
1741
1763
def __init__ (self ):
1742
1764
self .defined_solver = False
1743
1765
self .defined_timestep = False
1766
+ self .defined_nonlinear = False
1744
1767
self .stub = DynaBase .get_stub ()
1745
1768
1746
1769
def set_timestep (self , timestep_control = ThermalAnalysisTimestep .FIXED , initial_timestep = 0 ):
@@ -1768,6 +1791,20 @@ def set_solver(self, analysis_type=ThermalAnalysisType.STEADY_STATE):
1768
1791
self .defined_solver = True
1769
1792
self .atype = analysis_type .value
1770
1793
1794
+ def set_nonlinear (self , convergence_tol = 1e-4 , divergence = 0.5 ):
1795
+ """Set parameters for a nonlinear thermal or coupled structural/thermal analysis.
1796
+
1797
+ Parameters
1798
+ ----------
1799
+ convergence_tol : float
1800
+ Convergence tolerance for temperature.
1801
+ divergence : float
1802
+ Divergence control parameter.
1803
+ """
1804
+ self .defined_nonlinear = True
1805
+ self .tol = convergence_tol
1806
+ self .dcp = divergence
1807
+
1771
1808
def create (self ):
1772
1809
"""Create a thermal analysis."""
1773
1810
if self .defined_timestep :
@@ -1776,6 +1813,8 @@ def create(self):
1776
1813
self .stub .CreateControlThermalSolver (ControlThermalSolverRequest (atype = self .atype ))
1777
1814
if self .defined_timestep or self .defined_solver :
1778
1815
self .stub .CreateControlSolution (ControlSolutionRequest (soln = 2 ))
1816
+ if self .defined_nonlinear :
1817
+ self .stub .CreateControlThermalNonlinear (ControlThermalNonlinearRequest (tol = self .tol , dcp = self .dcp ))
1779
1818
1780
1819
1781
1820
class ContactCategory (Enum ):
0 commit comments