/
nonlinear_options.py
1379 lines (1046 loc) · 58.6 KB
/
nonlinear_options.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright (C) 2024 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
class NonLinearOptions:
def arclen(self, key="", maxarc="", minarc="", **kwargs):
"""Activates the arc-length method.
APDL Command: ARCLEN
Parameters
----------
key
Arc-length key:
OFF - Do not use the arc-length method (default).
ON - Use the arc-length method.
maxarc
Maximum multiplier of the reference arc-length radius (default =
25).
minarc
Minimum multiplier of the reference arc-length radius (default =
1/1000).
Notes
-----
Activates the arc-length method and sets the minimum and maximum
multipliers for controlling the arc-length radius based on the initial
arc-length radius.
The initial arc-length radius, t0, is proportional (in absolute value)
to the initial load factor. The initial load factor is given by:
Initial Load Factor = TIME / NSBSTP
where TIME is the time specified by the TIME command for the arc-length
load step, and NSBSTP is the number of substeps specified by the NSUBST
command.
The factors MAXARC and MINARC are used to define the range for the arc-
length radius to expand and shrink during the substep solution:
In each substep, the arc-length radius is kept constant throughout the
equilibrium iterations. After each converged substep, the arc-length
radius for the next substep is modified depending on the convergence
behavior. If the substep converges and the program heuristic predicts
an easy convergence, the arc-length radius is enlarged. If the enlarged
value is greater than tMAX, the arc-length radius is reset to tMAX. If
the substep does not converge, bisection will take place until the arc-
length radius is reduced to tMIN. If further nonconvergence is
encountered, the solution terminates.
The arc-length method predicts the next time increment (that is, load
factor increment). Therefore, the AUTOTS and PRED commands are ignored
when the arc-length method is used.
The STABILIZE and LNSRCH commands are also ignored.
The arc-length method cannot be used in a multiframe restart.
For difficult problems, one suggestion is to increase the initial
number of substeps (NSUBST), and to prevent the arc-length radius from
increasing too rapidly (MAXARC = 1).
ARCLEN cannot be used for any load step that has no applied load or
displacement.
The arc-length method does not support tabular loads. In order to use
the arc-length method, you must replace tabular loads by other load
types and then run the analysis again.
"""
command = f"ARCLEN,{key},{maxarc},{minarc}"
return self.run(command, **kwargs)
def arctrm(self, lab="", val="", node="", dof="", **kwargs):
"""Controls termination of the solution when the arc-length method is
APDL Command: ARCTRM
used.
Parameters
----------
lab
Specifies the basis of solution termination:
OFF - Does not use ARCTRM to terminate analysis (default).
L - Terminates the analysis if the first limit point has been reached. The first
limit point is that point in the response history when the
tangent stiffness matrix becomes singular (i.e., the point at
which the structure becomes unstable). If Lab = L, arguments
VAL, NODE, DOF are ignored.
U - Terminates the analysis when the displacement first equals or exceeds the
maximum desired value.
val
Maximum desired displacement (absolute value). Valid only if Lab =
U. The analysis terminates whenever the calculated displacement
first equals or exceeds this value. For rotational degrees of
freedom, VAL must be in radians (not degrees).
node
Node number corresponding to displacement used to compare with
displacement specified by VAL. If blank, the maximum displacement
will be used. Valid only if Lab = U.
dof
Valid degree of freedom label for nodal displacement specified by
NODE. Valid labels are UX, UY, UZ, ROTX, ROTY, ROTZ. Valid only
if NODE>0 and Lab = U.
Notes
-----
The ARCTRM command is valid only when the arc-length method (ARCLEN,ON)
is used.
It can be convenient to use this command to terminate the analysis when
the first limit point is reached. In addition, the NCNV command should
be used to limit the maximum number of iterations. If the ARCTRM
command is not used, and the applied load is so large that the solution
path can never reach that load, the arc-length solution will continue
to run until a CPU time limit or a "maximum number of iterations" is
reached.
"""
command = f"ARCTRM,{lab},{val},{node},{dof}"
return self.run(command, **kwargs)
def bucopt(self, method="", nmode="", shift="", ldmulte="", rangekey="", **kwargs):
"""Specifies buckling analysis options.
APDL Command: BUCOPT
Parameters
----------
method
Mode extraction method to be used for the buckling analysis:
LANB - Block Lanczos
SUBSP - Subspace iteration
nmode
Number of buckling modes (i.e., eigenvalues or load multipliers) to
extract (defaults to 1).
shift
By default, this value acts as the initial shift point about which
the buckling modes are calculated (defaults to 0.0).
ldmulte
Boundary for the load multiplier range of interest (defaults to ).
rangekey
Key used to control the behavior of the eigenvalue extraction
method (defaults to CENTER):
CENTER - Use the CENTER option control (default); the program computes NMODE buckling
modes centered around SHIFT in the range of (-LDMULTE,
+LDMULTE).
RANGE - Use the RANGE option control; the program computes NMODE buckling modes in the
range of (SHIFT, LDMULTE).
Notes
-----
Eigenvalues from a buckling analysis can be negative and/or positive.
The program sorts the eigenvalues from the most negative to the most
positive values. The minimum buckling load factor may correspond to the
smallest eigenvalue in absolute value, or to an eigenvalue within the
range, depending on your application (i.e., linear perturbation
buckling analysis or purely linear buckling analysis).
It is recommended that you request an additional few buckling modes
beyond what is needed in order to enhance the accuracy of the final
solution. It is also recommended that you input a non zero SHIFT value
and a reasonable LDMULTE value (i.e., a smaller LDMULTE that is closer
to the last buckling mode of interest) when numerical problems are
encountered.
When using the RANGE option, defining a range that spans zero is not
recommended. If you are seeking both negative and positive eigenvalues,
it is recommended that you use the CENTER option.
This command is also valid in PREP7. If used in SOLUTION, this command
is valid only within the first load step.
Distributed ANSYS Restriction: Both extraction methods (LANB and SUBSP)
are supported within Distributed ANSYS. However, the subspace iteration
eigensolver (SUBSP) is the only distributed eigensolver that will run a
fully distributed solution. The Block Lanczos eigensolver (LANB) is not
a distributed eigensolver; therefore, you will not see the full
performance improvements with this method that you would with a fully
distributed solution.
"""
command = f"BUCOPT,{method},{nmode},{shift},{ldmulte},{rangekey}"
return self.run(command, **kwargs)
def cnvtol(self, lab="", value="", toler="", norm="", minref="", **kwargs):
"""Sets convergence values for nonlinear analyses.
APDL Command: CNVTOL
Parameters
----------
lab
Valid convergence labels. If STAT, list the status of the currently
specified criteria.
value
Typical reference value for the specified convergence label (Lab).
toler
Tolerance; defaults to 0.005 (0.5%) for force and moment, 1.0E-4
(0.01%) for DVOL, 0.05 (5%) for displacement when rotational DOFs
are not present, and 0.05 (5%) for HDSP.
norm
Specifies norm selection:
2 - L2 norm (check SRSS value). Default, except for Lab = U.
1 - L1 norm (check absolute value sum).
0 - Infinite norm (check each DOF separately). Default for Lab = U.
minref
The minimum value allowed for the program calculated reference
value. If negative, no minimum is enforced. Used only if VALUE is
blank. Defaults to 0.01 for force, moment, and volume convergence,
1.0E-6 for heat flow, 1.0E-12 for VLTG and CHRG, 1.0E-6 for HDSP,
and 0.0 otherwise.
Notes
-----
This command is usually not needed because the default convergence
criteria are sufficient for most nonlinear analyses. In rare cases, you
may need to use this command to diagnose convergence difficulties.
Values may be set for the degrees of freedom (DOF) and/or the out-of-
balance load for the corresponding forcing quantities.
Issuing CNVTOL to set a convergence criterion for a specific
convergence label (Lab) does not affect the convergence criterion for
any other label. All other convergence criteria will remain at their
default setting or at the value set by a previous CNVTOL command.
When the GUI is on, if a "Delete" operation in a Nonlinear Convergence
Criteria dialog box writes this command to a log file (Jobname.LOG or
Jobname.LGW), you will observe that Lab is blank, VALUE = -1, and TOLER
is an integer number. In this case, the GUI has assigned a value of
TOLER that corresponds to the location of a chosen convergence label in
the dialog box's list. It is not intended that you type in such a
location value for TOLER in an ANSYS session. However, a file that
contains a GUI-generated CNVTOL command of this form can be used for
batch input or with the /INPUT command.
Convergence norms specified with CNVTOL may be graphically tracked
while the solution is in process using the ANSYS program's Graphical
Solution Tracking (GST) feature. Use the /GST command to turn GST on
or off. By default, GST is ON for interactive sessions and OFF for
batch runs.
This command is also valid in PREP7.
"""
command = f"CNVTOL,{lab},{value},{toler},{norm},{minref}"
return self.run(command, **kwargs)
def crplim(self, crcr="", option="", **kwargs):
"""Specifies the creep criterion for automatic time stepping.
APDL Command: CRPLIM
Parameters
----------
crcr
Value of creep criteria for the creep limit ratio control.
option
Type of creep analysis for which the creep limit ratio is
specified:
1 (or ON) - Implicit creep analysis.
0 (or OFF) - Explicit creep analysis.
Notes
-----
The CUTCONTROL command can also be used to set the creep criterion and
is preferred over this command for setting automatic time step
controls.
The creep ratio control can be used at the same time for implicit creep
and explicit creep analyses. For implicit creep (Option = 1), the
default value of CRCR is zero (i.e., no creep limit control), and you
can specify any value. For explicit creep (Option = 0), the default
value of CRCR is 0.1, and the maximum value allowed is 0.25.
This command is also valid in PREP7.
"""
command = f"CRPLIM,{crcr},{option}"
return self.run(command, **kwargs)
def gst(self, lab="", lab2="", **kwargs):
"""Turns Graphical Solution Tracking (GST) on or off.
APDL Command: /GST
Parameters
----------
lab
Determines whether the Graphical Solution Tracking feature is
active. Specify ON to activate GST, or OFF to deactivate the
feature.
lab2
Activates generation of interface and field convergence files
(ANSYS MFX analyses only).
Notes
-----
For interactive runs using GUI [/MENU,ON] or graphics [/MENU,GRPH]
mode, ANSYS directs GST graphics to the screen. For interactive
sessions not using GUI or graphics mode, or for batch sessions, GST
graphics are saved in the ANSYS graphics file Jobname.GST when Lab2 is
unspecified. The file Jobname.GST can be viewed with the DISPLAY
program in this case. You must select All File Types to access it. For
more information on the DISPLAY program see Getting Started with the
DISPLAY Program in the Basic Analysis Guide. For MFX runs (when
Lab2=ON), the Jobname.GST file is in XML format, and it can be viewed
with the Results Tracker Utility, accessed from within the Tools menu
of the Mechanical APDL Product Launcher.
The GST feature is available only for nonlinear structural, thermal,
electric, magnetic, fluid, or CFD simulations. For more information
about this feature and illustrations of the GST graphics for each
analysis type, see the ANSYS Analysis Guide for the appropriate
discipline. See also the CNVTOL command description.
When running an ANSYS MFX analysis, specify /GST,ON,ON to generate both
the interface (Jobname.NLH) and field convergence (Fieldname.GST) files
for monitoring the analysis. This field is not available on the GUI.
"""
command = f"/GST,{lab},{lab2}"
return self.run(command, **kwargs)
def lnsrch(self, key="", **kwargs):
"""Activates a line search to be used with Newton-Raphson.
APDL Command: LNSRCH
Parameters
----------
key
Line search key:
OFF - Do not use a line search.
ON - Use a line search. Note, adaptive descent is suppressed when LNSRCH is on
unless explicitly requested on the NROPT command. Having
line search on and adaptive descent on at the same time is not
recommended.
AUTO - The program automatically switches line searching ON and OFF between substeps
of a load step as needed. This option is recommended.
Notes
-----
Activates a line search to be used with the Newton-Raphson method
[NROPT]. Line search is an alternative to adaptive descent (see Line
Search in the Mechanical APDL Theory Reference).
LNSRCH,AUTO can be very efficient for problems in which LNSRCH is
needed at only certain substeps.
You cannot use line search [LNSRCH], automatic time stepping [AUTOTS],
or the DOF solution predictor [PRED] with the arc-length method
[ARCLEN, ARCTRM]. If you activate the arc-length method after you set
LNSRCH, AUTOTS, or PRED, a warning message appears. If you choose to
proceed with the arc-length method, the program disables your line
search, automatic time stepping, and DOF predictor settings, and the
time step size is controlled by the arc-length method internally.
This command is also valid in PREP7.
"""
command = f"LNSRCH,{key}"
return self.run(command, **kwargs)
def ncnv(self, kstop="", dlim="", itlim="", etlim="", cplim="", **kwargs):
"""Sets the key to terminate an analysis.
APDL Command: NCNV
Parameters
----------
kstop
Program behavior upon nonconvergence:
0 - Do not terminate the analysis if the solution fails to converge.
1 - Terminate the analysis and the program execution if the solution fails to
converge (default).
2 - Terminate the analysis, but not the program execution, if the solution fails to
converge.
dlim
Terminates program execution if the largest nodal DOF solution
value (displacement, temperature, etc.) exceeds this limit.
Defaults to 1.0E6 for all DOF except MAG and A. Defaults to 1.0E10
for MAG and A.
itlim
Terminates program execution if the cumulative iteration number
exceeds this limit (defaults to infinity).
etlim
Terminates program execution if the elapsed time (seconds) exceeds
this limit (defaults to infinity).
cplim
Terminates program execution if the CPU time (seconds) exceeds this
limit (defaults to infinity).
Notes
-----
Sets the key to terminate an analysis if not converged, or if any of
the following limits are exceeded for nonlinear and full transient
analyses: DOF (displacement), cumulative iteration, elapsed time, or
CPU time limit. Applies only to static and transient analyses
(ANTYPE,STATIC and ANTYPE,TRANS). Time limit checks are made at the end
of each equilibrium iteration.
This command is also valid in PREP7.
"""
command = f"NCNV,{kstop},{dlim},{itlim},{etlim},{cplim}"
return self.run(command, **kwargs)
def neqit(self, neqit="", forcekey="", **kwargs):
"""Specifies the maximum number of equilibrium iterations for nonlinear
APDL Command: NEQIT
analyses.
Parameters
----------
neqit
Maximum number of equilibrium iterations allowed each substep.
forcekey
One iteration forcing key:
FORCE - Forces one iteration per substep. Leave this field blank otherwise.
Notes
-----
This command is also valid in PREP7.
"""
command = f"NEQIT,{neqit},{forcekey}"
return self.run(command, **kwargs)
def nladaptive(
self,
component="",
action="",
criterion="",
option="",
val1="",
val2="",
val3="",
val4="",
**kwargs,
):
"""Defines the criteria under which the mesh is refined or
modified during a nonlinear solution.
APDL Command: NLADAPTIVE
Parameters
----------
component : str
Specifies the element component upon which this command should
act. One of the following:
- ``"ALL"`` : All selected components, or all selected
elements if no component is selected (default).
- ``"Name"`` : Component name.
action : str
The action to perform on the selected component(s). One of
the following:
- ``"ADD"`` : Add a criterion to the database.
- ``"LIST"`` : List the criteria defined for the specified
component(s).
- ``"DELETE"`` : Delete the criteria defined for the specified
component(s).
- ``"ON"`` : Enable the defined criteria for the specified
component(s) and specify how frequently and when to check
them (via ON,,,VAL1,VAL2,VAL3):
- ``"VAL1"`` : Checking frequency. If > 0, check criteria
at every VAL1 substeps. If < 0, check criteria at each
of the VAL1 points (approximately equally spaced)
between VAL2 and VAL3. (Default = -1.)
- ``"VAL2"`` : Checking start time, where VAL2 <
VAL3. (Default is the start time of the load step.)
- ``"VAL3"`` : Checking end time, where VAL3 >
VAL2. (Default is the end time of the load step.)
- ``"VAL4"`` : SOLID187 element type ID (defined prior to
issuing this command). Valid only for SOLID185 or
SOLID186 components in a NLAD-ETCHG analysis.
- ``"OFF"`` : Disable the defined criteria for the specified
component(s).
criterion
The type of criterion to apply to the selected component(s):
- ``"CONTACT"`` : Contact-based. (Valid only for Action = ADD,
Action = LIST, or Action = DELETE.)
- ``"ENERGY"`` : Energy-based. (Valid only for Action = ADD,
Action = LIST, or Action = DELETE.)
- ``"BOX"`` : A position-based criterion, defined by a
box. (Valid only for Action = ADD, Action = LIST, or Action
= DELETE.)
- ``"MESH"`` : A mesh-quality-based criterion. (Valid only for
Action = LIST, or Action = DELETE.)
- ``"ALL"`` : All criteria and options. (Valid only for Action
= LIST or Action = DELETE. Option and all subsequent
arguments are ignored.)
option : str
Criterion option to apply to the selected component(s):
- ``"NUMELEM"`` : For target elements only, define the minimum
number of contact elements to contact with each target
element. If this criterion is not satisfied, the program
refines the contact elements and the associated solid
elements. For this option, VAL1 must be a positive
integer. (Valid only for Action = ADD, Action = LIST, or
Action = DELETE. )
- ``"MEAN"`` : Check the strain energy of any element that is
part of the defined component for the condition Ee ≥ c1 *
Etotal / NUME (where c1 = VAL1, Etotal is the total strain
energy of the component, and NUME is the number of elements
of the component). If this criterion is satisfied at an
element, the program refines the element. For this option,
VAL1 must be non-negative and defaults to 1. (Valid only for
Action = ADD, Action = LIST, or Action = DELETE.)
- ``"XYZRANGE"`` : Define the location box in which all
elements within are to be split or refined. Up to six values
following the Option argument (representing the x1, x2, y1,
y2, z1, and z2 coordinates) are allowed. An unspecified
coordinate is not checked. (Valid only for Action = ADD,
Action = LIST, or Action = DELETE.)
- ``"SKEWNESS"`` : Mesh-quality control threshold for element
SOLID285. Valid values (VAL1) are 0.0 through 1.0. Default =
0.9. (Valid only for Action = ADD, Action = LIST, or Action
= DELETE.)
- ``"WEAR"`` : This option is valid only for contact elements
having surface wear specified (TB,WEAR). Define VAL1 as a
critical ratio of magnitude of wear to the average depth of
the solid element underlying the contact element. Once this
critical ratio is reached for any element, the program
morphs the mesh to improve the quality of the elements. VAL1
must be a positive integer. (Valid only for Action = ADD,
Action = LIST, or Action = DELETE.) The WEAR criterion
cannot be combined with any other criterion.
- ``"ALL"`` : All options. (Valid only for Action = LIST or
Action = DELETE. All subsequent arguments are ignored.)
Notes
-----
If a specified component (Component) is an assembly, the defined
criterion applies to all element components included in the
assembly.
All components must be defined and selected before the first solve
(SOLVE), although their nonlinear adaptivity criteria can be
modified from load step to load step, and upon restart. For
nonlinear adaptivity to work properly, ensure that all components
are selected before each solve.
After using this command to define a new criterion, the new
criterion becomes active and is checked one time during each load
step, roughly in mid-loading (unless this behavior is changed via
Action = ON).
When a criterion is defined, it overwrites a previously defined
criterion (if one exists) through the same component, or through
the component assembly that includes the specified component.
During solution, the same criteria defined for an element through
different components are combined, and the tightest criteria and
action control (Action,ON,,,VAL1) are used. If an ON action is
defined by a positive VAL1 value through one component and a
negative VAL1 value through another, the program uses the positive
value.
For ``action="ON"``, if VAL2 (start time) and/or VAL3 (end time)
are unspecified or invalid, the program uses the start and/or end
time (respectively) of the load step. If VAL1 < 0, the program
checks VAL1 points between VAL2 and VAL3. The time interval
between each check points is determined by (VAL3 - VAL2) / (VAL1 +
1), with the first check point as close to VAL2 + (VAL3 - VAL2) /
(VAL1 + 1) as possible. Fewer check points can be used if the
number of substeps during solution is insufficient (as the program
can only check at the end of a substep).
Option = SKEWNESS applies to linear tetrahedral element SOLID285
only. When the skewness of a SOLID285 element is >= the defined
value, the element is used as the core (seed) element of the
remeshed region(s). If this criterion is used together with any
other criteria for the same component, the other criteria defined
for the component are ignored. The most desirable skewness value
is 0, applicable when the element is a standard tetrahedral
element; the highest value is 1, applicable when the element
becomes flat with zero volume. For more information about skewness
and remeshing, see Mesh Nonlinear Adaptivity in the Advanced
Analysis Guide.
For more granular control of the source mesh geometry, see NLMESH.
"""
command = f"NLADAPTIVE,{component},{action},{criterion},{option},{val1},{val2},{val3},{val4}"
return self.run(command, **kwargs)
def nldiag(self, label="", key="", maxfile="", **kwargs):
"""Sets nonlinear diagnostics functionality.
APDL Command: NLDIAG
Parameters
----------
label
Diagnostic function:
NRRE - Store the Newton-Raphson residuals information.
EFLG - Identify or display elements or nodes that violate the criteria.
CONT - Write contact information to a single Jobname.cnd diagnostic text file during
solution.
key
Diagnostic function characteristics:
OFF or 0 - Suppresses writing of diagnostic information (default).
ON or 1 - Writes diagnostic information to the Jobname.ndxxx, Jobname.nrxxx, or
Jobname.cnd file. (If Label = CONT, this option is the
same as the SUBS option described below.)
ITER - Writes contact diagnostic information at each iteration. Valid only when Label
= CONT.
SUBS - Writes contact diagnostic information at each substep. Valid only when Label =
CONT.
LSTP - Writes contact diagnostic information at each load step. Valid only when Label
= CONT.
STAT - Lists information about the diagnostic files in the current working directory.
DEL - Deletes all diagnostic files in the current working directory.
maxfile
Maximum number of diagnostic files to create. Valid values are 1
through 999. Default = 4. Valid only when Label = NRRE or EFLG.
Notes
-----
The NLDIAG command is a nonlinear diagnostics tool valid for nonlinear
structural analyses. It is a debugging tool for use when you must
restart after an unconverged solution. The command creates
Jobname.ndxxx, Jobname.nrxxx, or Jobname.cnd files in the working
directory to store the information you specify.
For more information, see Performing Nonlinear Diagnostics.
Issue the NLDIAG,NRRE,ON command to create Jobname.nrxxx diagnostic
files (for each equilibrium iteration after the first) in which to
store the relevant Newton-Raphson residual information of
forces/moments Fx, Fy, Fz, Mx, My and Mz for the last MAXFILE
equilibrium iterations.
Issue a NLDPOST,NRRE,STAT command to list the load step, substep, time,
and equilibrium iteration corresponding to each of the Jobname.nrxxx
diagnostic files in the working directory, then issue a
PLNSOL,NRRES,,,,FileID command to point to the file from which you want
to create a contour plot of your Newton-Raphson residuals.
If you restart or issue a new SOLVE command, any Jobname.nrxxx
diagnostic files in the current (working) directory are overwritten.
Issue a NLDIAG,EFLG,ON command to create Jobname.ndxxx diagnostic
files which store IDs for elements violating the following criteria:
Too large a distortion (HDST)
Elements contain nodes that have near zero pivots (PIVT) for nonlinear
analyses
Too large a plastic/creep (EPPL/EPCR) strain increment (CUTCONTROL)
Elements for which mixed u-P constraints are not satisfied (mixed U-P
option of 18x solid elements only) (MXUP)
Hyperelastic element (EPHY), cohesive zone material (EPCZ), or damage
strain (EPDM) not converged
Radial displacement (RDSP) not converged
MPC184 multipoint constraint elements using KEYOPT(1) = 6 through 16
with the Lagrange multiplier option fail to satisfy constraint
conditions (184J)
For NLDIAG,EFLG,ON, all Jobname.ndxxx diagnostic files (for each
equilibrium iteration after the first) in the current (working)
directory are deleted when you issue a new SOLVE command (or restart).
In the solution processor (/SOLU), use the STAT option to list the
active status of this command. In the postprocessor (/POST1), issue a
NLDPOST,EFLG,STAT command to list the load step, substep, time, and
equilibrium iteration corresponding to each of the Jobname.ndxxx
diagnostic files in the working directory, then issue a
NLDPOST,EFLG,CM,FileID command to create element components that
violate the criteria.
Issue the NLDIAG,CONT,ON command to create a Jobname.cnd diagnostic
file which stores contact information for all defined contact pairs at
all substeps. Alternatively, you may issue one of the following
commands to store contact information at a specific frequency:
NLDIAG,CONT,ITER to write at each iteration
NLDIAG,CONT,SUBS to write at each substep (default)
NLDIAG,CONT,LSTP to write at each load step
Contact diagnostic information is available for elements CONTA171
through CONTA177; it is not available for CONTA178.
Diagnostic file Jobname.cnd is written during solution and lists, on a
pair-base, the following contact information:
Contact pair ID[1]
Number of contact elements in contact[2]
Number of contact elements in "sticking" contact status
Maximum chattering level
Maximum contact penetration/Minimum gap[3]
Maximum closed gap
Maximum normal contact stiffness
Minimum normal contact stiffness
Maximum resulting pinball
Maximum elastic slip distance
Maximum tangential contact stiffness
Minimum tangential contact stiffness
Maximum sliding distance
Maximum contact pressure
Maximum friction stress
Average contact depth
Maximum closed penetration
Number of contact points having too much penetration
Contacting area
Maximum contact damping pressure
Maximum tangential contact damping stress
Maximum total sliding distance (GSLID), including near-field
Minimum total sliding distance (GSLID), including near-field
Maximum fluid penetration pressure on contact surface
Maximum fluid penetration pressure on target surface
Total volume lost due to wear for the contact pair
Total strain energy due to contact constraint
Total frictional dissipation energy
Total contact stabilization energy
ANSYS Workbench contact pair ID[4]
"""
command = f"NLDIAG,{label},{key},{maxfile}"
return self.run(command, **kwargs)
def nlgeom(self, key="", **kwargs):
"""Includes large-deflection effects in a static or full transient
APDL Command: NLGEOM
analysis.
Parameters
----------
key
Large-deflection key:
OFF - Ignores large-deflection effects (that is, a small-deflection analysis is
specified). This option is the default.
ON - Includes large-deflection (large rotation) effects or large strain effects,
according to the element type.
Notes
-----
Large-deflection effects are categorized as either large deflection (or
large rotation) or large strain, depending on the element type. These
are listed (if available) under Special Features in the input data
table for each element in the Element Reference. When large deflection
effects are included (NLGEOM,ON), stress stiffening effects are also
included automatically.
If used during the solution (/SOLU), this command is valid only within
the first load step.
In a large-deflection analysis, pressure loads behave differently than
other load types. For more information, see Load Direction in a Large-
Deflection Analysis.
The gyroscopic matrix (that occurs due to rotational angular velocity)
does not support large-deflection effects. The theoretical formulations
for the gyroscopic matrix support small deflection (linear formulation)
only.
When large-deflection effects are included in a substructure or CMS
transient analysis use pass, the OUTRES command ignores DSUBres = ALL.
This command is also valid in PREP7.
In ANSYS Professional NLT, large deflection effects should not be
turned on if 2-D solid (PLANEn) or 3-D solid (SOLIDn) elements are
defined. ANSYS Professional NLS supports NLGEOM,ON for plane and solid
elements.
"""
command = f"NLGEOM,{key}"
return self.run(command, **kwargs)
def nlhist(
self,
key="",
name="",
item="",
comp="",
node="",
elem="",
shell="",
layer="",
stop_value="",
stop_cond="",
**kwargs,
):
"""Specify result items to track during solution.
APDL Command: NLHIST
Parameters
----------
key
Specifies the command operation:
NSOL - Nodal solution data.
ESOL - Element nodal data.
PAIR - Contact data (for pair-based contact).
GCN - Contact data (for general contact).
STAT - Displays a list of items to track.
OFF or 0 - Deactivates tracking of all variables. This value is the default.
ON or 1 - Activates tracking of all variables. Tracking also activates whenever any
specification changes.
DEL - Removes the specified variable from the set of result items to track. If Name =
ALL (default), all specifications are removed.
name
The 32-character user-specified name.
item, comp
Predetermined output item and component label for valid elements.
See the Element Reference for more information.
node
Number identifying one of the following:
elem
Valid element number for element results. Used for ESOL items. If
ELEM is specified, then a node number that belongs to the element
must also be specified in the NODE field.
shell
Valid labels are TOP, MID or BOT. This field can specify the
location on shell elements for which to retrieve data. Used only
for element nodal data (ESOL).
layer
Layer number (for layered elements only). Used only for element
nodal data (ESOL).
stop_value
Critical value of the tracked variable. This value is used to
determine if the analysis should be terminated. This field is only
valid for contact data (Key = PAIR or GCN).
stop_cond
Specifies the conditional relationship between the variable being
tracked and the STOP_VALUE upon which the analysis will be
terminated:
-1 - Terminate the analysis when the tracked variable is less than or equal to
STOP_VALUE.
0 - Terminate the analysis when the tracked variable equals STOP_VALUE.
1 - Terminate the analysis when the tracked variable is greater than or equal to
STOP_VALUE.
Notes
-----
The NLHIST command is a nonlinear diagnostics tool that enables you to
monitor diagnostics results of interest in real time during a solution.
You can track a maximum of 50 variables during solution. The specified
result quantities are written to the file Jobname.nlh. Nodal results
and contact results are written for every converged substep
(irrespective of the OUTRES command setting) while element results are
written only at time points specified via the OUTRES command. For time
points where element results data is not available, a very small number
is written instead. If the conditions for contact to be established are
not satisfied, 0.0 will be written for contact results.
Results tracking is available only for a nonlinear structural analysis
(static or transient), a nonlinear steady-state thermal analysis, or a
transient thermal analysis (linear or nonlinear). All results are
tracked in the Solution Coordinate System (that is, nodal results are
in the nodal coordinate system and element results are in the element
coordinate system).
Contact results can be tracked for elements CONTA171 through CONTA177;
they cannot be tracked for CONTA178.
When contact results are tracked (Key = PAIR or GCN), the user-
specified name (Name argument) is used to create a user-defined