/
special.py
2523 lines (1919 loc) · 95.5 KB
/
special.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 Special:
def bfint(
self,
fname1="",
ext1="",
fname2="",
ext2="",
kpos="",
clab="",
kshs="",
tolout="",
tolhgt="",
**kwargs,
):
"""Activates the body force interpolation operation.
APDL Command: BFINT
Parameters
----------
fname1
File name and directory path (248 characters maximum,
including directory) from which to read data for
interpolation. If you do not specify a directory path, it
will default to your working directory and you can use all
248 characters for the file name.
ext1
Filename extension (eight-character maximum).
fname2
File name and directory path (248 characters maximum,
including directory) to which BF commands are written. If
you do not specify a directory path, it will default to
your working directory and you can use all 248 characters
for the file name.
ext2
Filename extension (eight-character maximum).
kpos
Position on Fname2 to write block of BF commands:
0 - Beginning of file (overwrite existing file).
1 - End of file (append to existing file).
clab
Label (8 characters maximum, including the colon) for this
block of BF commands in Fname2. This label is appended to
the colon (:). Defaults to BFn, where n is the cumulative
iteration number for the data set currently in the
database.
kshs
Shell-to-solid submodeling key:
0 - Solid-to-solid or shell-to-shell submodel.
1 - Shell-to-solid submodel.
tolout
Extrapolation tolerance about elements, based on a
fraction of the element dimension. Submodel nodes outside
the element by more than TOLOUT are not accepted as
candidates for DOF extrapolation. Defaults to 0.5 (50%).
tolhgt
Height tolerance above or below shell elements, in units
of length. Used only for shell-to-shell submodeling (KSHS
= 0). Submodel nodes off the element surface by more than
TOLHGT are not accepted as candidates for DOF
interpolation or extrapolation. Defaults to 0.0001 times
the maximum element dimension.
Notes
-----
File Fname1 should contain a node list for which body forces are to be
interpolated [NWRITE]. File Fname2 is created, and contains
interpolated body forces written as a block of nodal BF commands.
Body forces are interpolated from elements having TEMP as a valid body
force or degree of freedom, and only the label TEMP is written on the
nodal BF commands. Interpolation is performed for all nodes on file
Fname1 using the results data currently in the database. For layered
elements, use the LAYER command to select the locations of the
temperatures to be used for interpolation. Default locations are the
bottom of the bottom layer and the top of the top layer.
The block of BF commands begins with an identifying colon label command
and ends with a /EOF command. The colon label command is of the form
:Clab, where Clab is described above. Interpolation from multiple
results sets can be performed by looping through the results file in a
user-defined macro. Additional blocks can be appended to Fname2 by
using KPOS and unique colon labels. A /INPUT command, with the
appropriate colon label, may be used to read the block of commands.
If the model has coincident (or very close) nodes, BFINT must be
applied to each part of the model separately to ensure that the mapping
of the nodes is correct. For example, if nodes belonging to two
adjacent parts linked by springs are coincident, the operation should
be performed on each part of the model separately.
"""
command = f"BFINT,{fname1},{ext1},,{fname2},{ext2},,{kpos},{clab},{kshs},{tolout},{tolhgt}"
return self.run(command, **kwargs)
def cbdof(
self,
fname1="",
ext1="",
fname2="",
ext2="",
kpos="",
clab="",
kshs="",
tolout="",
tolhgt="",
tolthk="",
**kwargs,
):
"""Activates cut-boundary interpolation (for submodeling).
APDL Command: CBDOF
Parameters
----------
fname1
File name and directory path (248 characters maximum,
including directory) from which to read boundary node
data. If no specified directory path exists, the path
defaults to your working directory and you can use all 248
characters for the file name.
ext1
Filename extension (eight-character maximum).
fname2
File name and directory path (248 characters maximum,
including directory) to which cut-boundary D commands are
written. If no specified directory path exists, the path
defaults to your working directory and you can use all 248
characters for the file name.
ext2
Filename extension (eight-character maximum).
kpos
Position on Fname2 to write block of D commands:
0 - Beginning of file (overwrite existing file).
1 - End of file (append to existing file).
clab
Label (eight characters maximum, including the colon) for
this block of D commands on Fname2. his label is appended
to the colon (:). Defaults to CBn, where n is the
cumulative iteration number for the data set currently in
the database. For imaginary data (see KIMG on the ``*SET``
command), Clab defaults to CIn.
kshs
Shell-to-solid submodeling key:
0 - Solid-to-solid or shell-to-shell submodel.
1 - Shell-to-solid submodel.
tolout
Extrapolation tolerance about elements, based on a
fraction of the element dimension. Submodel nodes outside
the element by more than TOLOUT are not accepted as
candidates for DOF extrapolation. Defaults to 0.5 (50
percent).
tolhgt
Height tolerance above or below shell elements, in units
of length. Used only for shell-to-shell submodeling (KSHS
= 0). Submodel nodes off the element surface by more than
TOLHGT are not accepted as candidates for
degree-of-freedom interpolation or extrapolation.
Defaults to 0.0001 times the maximum element dimension.
tolthk
Height tolerance above or below shell elements, based on a
fraction of the shell element thickness. Used only for
shell-to-solid submodeling (KSHS = 1). Submodel nodes off
the element surface by more than TOLTHK are not accepted
as candidates for DOF interpolation or
extrapolation. Defaults to 0.1 times the average shell
thickness.
Notes
-----
File Fname1 should contain a node list for which boundary
conditions are to be interpolated (NWRITE). File Fname2 is
created to contain interpolated boundary conditions written as
a block of D commands.
Boundary conditions are written for the active
degree-of-freedom set for the element from which interpolation
is performed. Interpolation occurs on the selected set of
elements. The block of D commands begins with an identifying
colon label and ends with a /EOF command. The colon label is
of the form :Clab (described above).
Interpolation from multiple results sets can be performed by
looping through the results file in a user-defined macro.
Additional blocks can be appended to Fname2 by using KPOS and
unique colon labels. To read the block of commands, issue the
/INPUT command with the appropriate colon label.
If the model has coincident (or very close) nodes, the CBDOF
must be applied to each part of the model separately to ensure
that the mapping of the nodes is correct. For example, if
nodes belonging to two adjacent parts linked by springs are
coincident, the operation should be performed on each part of
the model separately.
Resume the coarse model database at the beginning of the
cut-boundary procedure. The database should have been saved
after the first coarse model solution, as the number of nodes
in the database and the results file must match, and internal
nodes are sometimes created during the solution.
Caution: Relaxing the TOLHGT or TOLTHK tolerances to allow
submodel nodes to be "found" can produce poor submodel
results.
"""
command = f"CBDOF,{fname1},{ext1},,{fname2},{ext2},,{kpos},{clab},{kshs},{tolout},{tolhgt},{tolthk}"
return self.run(command, **kwargs)
def cmsfile(self, option="", fname="", ext="", cmskey="", **kwargs):
"""Specifies a list of component mode synthesis (CMS) results files for
APDL Command: CMSFILE
plotting results on the assembly.
Parameters
----------
option
Specifies the command operation:
ADD - Add the specified component results file (Fname) to the list of files to plot.
This option is the default.
DELETE - Remove the specified component results file (Fname) from the list of files to
plot.
LIST - List all specified component results files.
CLEAR - Clear all previous files added.
ALL - Add all component results (.rst) files from the working directory to the list
of files to plot.
fname
The file name (with full directory path) of the component results
file. The default file name is the Jobname (specified via the
/FILNAME command).
ext
The file name (Fname) extension. The default extension is .rst.
cmskey
Valid only when adding a results file (Option = ADD or ALL), this
key specifies whether or not to check the specified .rst file to
determine if it was created via a CMS expansion pass:
ON - Check (default).
OFF - Do not check.
Notes
-----
The CMSFILE command specifies the list of component mode synthesis
(CMS) results files to include when plotting the mode shape of an
assembly.
During postprocessing (/POST1) of a CMS analysis, issue the CMSFILE
command to point to component results files of interest. (You can issue
the command as often as needed to include all or some of the component
results files.) Issue the SET command to acquire the frequencies and
mode shapes from substeps for all specified results files. Execute a
plot (PLNSOL) or print (PRNSOL) operation to display the mode shape of
the entire assembly.
When you specify a results file to add to the plot list, the default
behavior of the command (CmsKey = ON) is to first verify that the file
is from a CMS analysis and that the frequencies of the result sets on
the file match the frequencies on the first file in the list. If CmsKey
= OFF, you can add any .rst file to the list of files to plot, even if
the file was not expanded via a CMS expansion pass.
If CmsKey = ON (default), output from the command appears as: ADD CMS
FILE = filename.rst. : If CmsKey = OFF, output from the command appears
as: ADD FILE = filename.rst.
If Option = DELETE or CLEAR, you must clear the database (/CLEAR), then
re-enter the postprocessor (/POST1) and issue a SET command for the
change to take effect on subsequent plots.
Clearing the database does not clear the list of files specified via
the CMSFILE command. Specify Option = CLEAR to clear the list of files.
"""
command = f"CMSFILE,{option},{fname},{ext},{cmskey}"
return self.run(command, **kwargs)
def cyccalc(self, fileprefix="", fileformat="", **kwargs):
"""Calculates results from a cyclic harmonic mode-superposition analysis
APDL Command: CYCCALC
using the specifications defined by CYCSPEC.
Parameters
----------
fileprefix
Each result table (corresponding to each CYCSPEC specification) is
written to a file beginning with FilePrefix. If blank (default),
the result tables are written to the output file.
fileformat
If FilePrefix is specified, then use FileFormat to specify the
format of the file to be written:
FORM - Formatted file (default)
CSV - Comma-separated value file
Notes
-----
CYCCALC loops through the specification given by CYCSPEC and computes
the requested outputs. The outputs are given in a table format, with
the rows corresponding to each frequency solution from the harmonic
analysis, and the columns corresponding to each sector. The table
entries are the maximum value of the specified quantity at the
specified location in the sector. In addition, columns containing the
maximum value at the frequency, the sector in which it occurs, and the
node in the sector at which it occurs are output.
If FilePrefix is specified, a file is created for each output table
with the name FilePrefix_node_type.ext, where node is the node number
or component name, type is the item/component requested, and the file
extension .ext is either .txt or .csv, depending on FileFormat.
A SET command must precede the CYCCALC command.
The CYCCALC results are based on the currently active RSYS, SHELL,
LAYER, and AVPRIN settings.
"""
command = f"CYCCALC,{fileprefix},{fileformat}"
return self.run(command, **kwargs)
def cycfiles(self, fnamerst="", extrst="", fnamerfrq="", extrfrq="", **kwargs):
"""Specifies the data files where results are to be found for a cyclic
APDL Command: CYCFILES
symmetry mode-superposition harmonic analysis.
Parameters
----------
fnamerst
The file name and directory path of the results file from the
cyclic modal solution. Defaults to Jobname.
extrst
File name extension for FnameRst. Defaults to rst.
fnamerfrq
The file name and directory path of the results file from the
cyclic mode-superposition harmonic solution. Defaults to the value
of the FnameRst argument.
extrfrq
File name extension for FnameRfrq. Defaults to rfrq.
"""
command = f"CYCFILES,{fnamerst},{extrst},{fnamerfrq},{extrfrq}"
return self.run(command, **kwargs)
def cycphase(self, type_="", option="", **kwargs):
"""Provides tools for determining minimum and maximum possible result
APDL Command: CYCPHASE
values from frequency couplets produced in a modal cyclic symmetry
analysis.
Parameters
----------
type\\_
The type of operation requested:
DISP - Calculate the maximum and minimum possible displacement at each node in the
original sector model. Store the values and the phase angle
at which they occurred.
STRESS - Calculate the maximum and minimum possible stresses at each node in the
original sector model. Store the values and the phase
angle at which they occurred.
STRAIN - Calculate the maximum and minimum possible strains at each node in the original
sector model. Store the values and the phase angle at
which they occurred.
ALL - Calculate the maximum and minimum possible displacement, stress and strain at
each node in the original sector model. Store the values and
the phase angle at which they occurred.
GET - Places the value of a MAX or MIN item into the _CYCVALUE parameter, the node
for that value in the _CYCNODE parameter, and the phase angle
for the value in the _CYCPHASE parameter.
PUT - Put resulting sweep values for printing (via the PRNSOL command ) or plotting
(via the PLNSOL command).
LIST - List the current minimum/maximum displacement, stress and strain nodal values.
STAT - Summarize the results of the last phase sweep.
CLEAR - Clear phase-sweep information from the database.
option
If TYPE = DISP, STRAIN, STRESS or ALL, controls the sweep angle
increment to use in the search:
Angle - The sweep angle increment in degrees, greater than 0.1 and less than 10. The
default is 1.
Notes
-----
When you expand the results of a modal cyclic symmetry analysis (via
the /CYCEXPAND or EXPAND command), ANSYS combines the real and
imaginary results for a given nodal diameter, assuming no phase shift
between them; however, the modal response can occur at any phase shift.
CYCPHASE response results are valid only for the first cyclic sector.
To obtain the response at any part of the expanded model, ANSYS, Inc.
recommends using cyclic symmetry results expansion at the phase angle
obtained via CYCPHASE.
The phase angles returned by CYCPHASE contain the minimum and maximum
values for USUM, SEQV and other scalar principal stress and strain
quantities; however, they do not always return the true minimum and
maximum values for directional quantities like UX or SX unless the
values fall in the first sector.
CYCPHASE does not consider midside node values when evaluating maximum
and minimum values, which may affect DISPLAY quantities but no others.
(Typically, ANSYS ignores midside node stresses and strains during
postprocessing.)
Issuing CYCPHASE,PUT clears the result values for midside nodes on high
order elements; therefore, this option sets element faceting (/EFACET)
to 1. The command reports that midside nodal values are set to zero and
indicates that element faceting is set to 1.
If the sweep values are available after issuing a CYCPHASE,PUT command,
the PRNSOL or PLNSOL command will print or plot (respectively) the
sweep values of structure displacement Ux, Uy, Uz, component
stress/strain X, Y, Z, XY, YZ, ZX, principal stress/strain 1, 2, 3 and
equivalent stress/strain EQV. The vector sum of displacement (USUM)
and stress/strain intensity (SINT) are not valid phase-sweep results.
You can specify any coordinate system via the RSYS command for
displaying or printing CYCPHASE results. However, after CYCPHASE
results have been extracted, you cannot then transform them via the
RSYS command. If you try to do so, ANSYS issues a warning message.
The CYCPHASE command is valid in /POST1 and for cyclically symmetric
models only.
To learn more about analyzing a cyclically symmetric structure, see the
Cyclic Symmetry Analysis Guide.
"""
command = f"CYCPHASE,{type_},{option}"
return self.run(command, **kwargs)
def cycspec(self, label="", node="", item="", comp="", **kwargs):
"""Defines the set of result items for a subsequent CYCCALC command in
APDL Command: CYCSPEC
postprocessing a cyclic harmonic mode-superposition analysis.
Parameters
----------
label
One of the following labels:
ADD - Adds a new specification to the set (default). The maximum number of
specifications that can be defined is 50.
LIST - Lists the current set of specifications. Node, Item, Comp are ignored.
ERASE - Erases the current set of specifications. Node, Item, Comp are ignored.
DELETE - Deletes an existing specification. Item, Comp are ignored.
node
The node at which to evaluate the results. If Node is a nodal
component, then all nodes in the component are included. All
sectors containing this node (or set of nodes) are evaluated.
item
Specifies the type of values to evaluate:
U - Displacement
S - Stress
EPEL - Elastic strain
comp
Specifies the specific component of displacement, stress, or strain
to evaluate:
X,Y,Z - Direct components
XY,YZ,XZ - Shear components (stress and strain only)
1,2,3 - Principal values (stress and strain only)
EQV - Equivalent value (stress and strain only)
SUM - Vector sum (displacement only)
NORM - L2 norm for the set of nodes (displacement only)
Notes
-----
Up to 50 specifications can be defined for use in a subsequent CYCCALC
command. If more than 50 specifications are desired, erase the table
after the CYCCALC operation and add new specifications and repeat the
CYCCALC command. All the specified nodes, items, and components are
evaluated for all sectors and the maximum amplitude value output. For
combined stresses and strains (Comp = 1,2,3 or EQV) or displacement
vector sum (Comp = SUM), a 360 degree phase sweep is performed at each
location to determine the maximum.
Additional POST1 controls are used to refine the specification. For
component values, components are in the RSYS direction. For shell
elements, the results are at the SHELL location. For EPEL,EQV, the
results are based on the EFFNU value on the AVPRIN command. The
controls active when the CYCCALC command is issued determine the result
values. If results at another SHELL location are desired, issue the new
SHELL command and then re-issue the CYCCALC command.
If a single node is input, the Item/Comp value at that location in each
sector is output. If a node component is given, then the maximum
Item/Comp value within the set of nodes of each sector is output, one
value for each sector (the node of the maximum may vary from sector to
sector). For stress and strain items, only corner nodes are valid.
For the displacement norm option (Item = U, Comp = NORM), the L2 norm
computed from all the nodes in the component is output, one per sector.
"""
command = f"CYCSPEC,{label},{node},{item},{comp}"
return self.run(command, **kwargs)
def exoption(self, ldtype="", option="", value="", **kwargs):
"""Specifies the EXPROFILE options for the Mechanical APDL to ANSYS CFX profile file transfer.
APDL Command: EXOPTION
Parameters
----------
ldtype
Load type:
* ``"SURF"`` : Surface load
* ``"VOLU"`` : Volume load
option
Surface options:
* ``"Precision"`` : Number of significant digits for the
fractional part of real data
* ``"Connectivity"`` : Key to include face connectivity in the
exported profile file
* ``"Precision"`` : Number of significant digits after the
decimal for real data
value
Specify the value for either Precision or Connectivity.
For Precision, specify the number of significant digits. Can
be any value between 1 to 20, default 8. When 0 or an invalid
value is specified, the program will use the default value of
8 and issue a warning message.
For Connectivity, specify the key to include the element face
connectivity data for surface loads (does not support volume
loads):
* ``"OFF"`` : Do not include the connectivity data in the exported file (default)
* ``"ON"`` : Include the connectivity data in the exported file
Notes
-----
This command is not supported in Distributed ANSYS.
"""
return self.run(f"EXOPTION,{ldtype},{option},{value}", **kwargs)
def expand(self, nrepeat="", hindex="", icsys="", sctang="", phase="", **kwargs):
"""Displays the results of a modal cyclic symmetry analysis.
APDL Command: EXPAND
Parameters
----------
nrepeat
Number of sector repetitions for expansion. The default is 0 (no
expansion).
modal
Specifies that the expansion is for a modal cyclic symmetry
analysis.
hindex
The harmonic index ID for the results to expand.
icsys
The coordinate system number used in the modal cyclic symmetry
solution. The default is the global cylindrical coordinate system
(specified via the CSYS command where KCN = 1).
sctang
The sector angle in degrees, equal to 360 divided by the number of
cyclic sectors.
--
This field is reserved for future use.
phase
The phase angle in degrees to use for the expansion. The default is
0. Typically, the value is the peak displacement (or stress/strain)
phase angle obtained via the CYCPHASE command.
Notes
-----
Issue this command to display the results of a modal cyclic symmetry
analysis.
When you issue the EXPAND,Nrepeat command, subsequent SET commands read
data from the results file and expand them to Nrepeat sectors. As long
as no entities have been modified, this expansion can be negated (that
is, reverted to single sector) by issuing EXPAND with no arguments. If
you modify entities and wish to return to the partial model, use the
Session Editor (see Restoring Database Contents in the Operations
Guide).
EXPAND displays the results and allows you to print them, as if for a
full model. The harmonic index (automatically retrieved from the
results file) appears in the legend column.
When plotting or printing element strain energy (SENE), the EXPAND
command works with brick or tet models only. Element kinetic energy
(KENE) plotting or printing is not supported.
EXPAND is a specification command valid only in POST1. It is
significantly different from the /CYCEXPAND command in several
respects, (although you can use either command to display the results
of a modal cyclic symmetry analysis):
EXPAND has none of the limitations of the /CYCEXPAND command.
EXPAND changes the database by modifying the geometry, the nodal
displacements, and element stresses as they are read from the results
file, whereas the /CYCEXPAND command does not change the database.
Caution:: : The EXPAND command creates new nodes and elements;
therefore, saving (or issuing the /EXIT, ALL command) after issuing the
EXPAND command can result in large databases.
Distributed ANSYS Restriction: This command is not supported in
Distributed ANSYS.
"""
command = f"EXPAND,{nrepeat},{hindex},{icsys},{sctang},{phase}"
return self.run(command, **kwargs)
def exprofile(
self,
ldtype="",
load="",
value="",
pname="",
fname="",
fext="",
fdir="",
**kwargs,
):
"""Exports interface loads or loads on selected nodes to an ANSYS CFX
APDL Command: EXPROFILE
Profile file.
Parameters
----------
ldtype
Load type:
SURF - Surface load.
VOLU - Volumetric load.
load
Surface loads:
DISP - Displacement (in a static analysis) or mode shape and global parameters (in a
modal analysis).
MODE - Normalized mode shape and global parameters (in a modal analysis only).
TEMP - Temperature.
HFLU - Heat flux.
value
If a positive integer, specifies the number of the surface or
volume interface. If 0 (zero), the selected nodes or Named
Selection are used.
pname
Field name in CFX Profile file (32-character maximum). Defaults to
jobname_bcploadnumber for a surface load and jobname_subdloadnumber
for volumetric load.
fname
The CFX Profile filename (248-character maximum). Defaults to
jobname_bcploadnumber for a surface load and jobname_subdloadnumber
for a volumetric load.
fext
The Profile file extension (8-character maximum). Defaults to.csv.
fdir
The Profile file directory (8-character maximum). Defaults to
current directory.
Notes
-----
By default, the EXPROFILE command assumes the data it writes to the
Profile file are in SI units. For models not described in SI units,
issue the EXUNIT command as needed to write the correct unit labels on
the Profile file.
For a modal analysis, if Load = DISP or MODE, global parameters
including mass, frequency, and maximum displacement are also written to
the ANSYS CFX Profile file. You should therefore issue the EXUNIT
command for DISP, TIME, and MASS.
Verify that the coordinate system is set to the global Cartesian
(RSYS,0) before using this command.
To transfer multiple loads across an interface, specify a unique file
name and extension for each load.
Force (FORC) and heat generation (HGEN) are per-unit volume.
For modal analysis, this command does not support the following mode-
extraction methods (MODOPT): unsymmetric matrix (UNSYM), the damped
system (DAMP), or the QR-damped system (QRDAMP).
To write the normalized (instead of non-normalized) mode shapes from a
modal analysis to the file:
Use Load = MODE.
Verify that the mode shapes are normalized to the mass matrix
(MODOPT,,,,,,OFF), the default behavior.
Verify that the scale factor is set to 1.0 (SET,,,1.0), the default
value.
For loads not specified directly via commands (such as SF and BF),
loads must first be read into the database (SET or LCASE).
Distributed ANSYS Restriction: This command is not supported in
Distributed ANSYS.
"""
command = f"EXPROFILE,{ldtype},{load},{value},{pname},{fname},{fext},{fdir}"
return self.run(command, **kwargs)
def exunit(self, ldtype="", load="", untype="", name="", **kwargs):
"""Specifies the interface load unit labels to be written to the export
APDL Command: EXUNIT
file for ANSYS to CFX transfer.
Parameters
----------
ldtype
Load type:
SURF - Surface load.
VOLU - Volumetric load.
load
Surface loads:
DISP - Displacement in a static analysis. Mode shape in a modal analysis.
TIME - Time. The unit for frequency is the inverse of the unit for time.
MASS - Mass.
TEMP - Temperature.
HFLU - Heat flux.
untype
Unit type:
COMM - Predefined unit
USER - User-specified unit
name
Commonly used predefined unit name or user-specified unit name.
SI - International System of units (meter-kilogram-second) (default)
FT - English System of units (feet-pound-second)
Notes
-----
This command only specifies which unit labels are to be written to the
file when the EXPROFILE is issued. It does not perform unit
conversions.
Distributed ANSYS Restriction: This command is not supported in
Distributed ANSYS.
"""
command = f"EXUNIT,{ldtype},{load},{untype},{name}"
return self.run(command, **kwargs)
def fssparm(self, port1="", port2="", **kwargs):
"""Calculates reflection and transmission properties of a frequency
APDL Command: FSSPARM
selective surface.
Parameters
----------
port1
Port number of input port. Defaults to 1.
port2
Port number of output port. Defaults to 1.
Notes
-----
FSSPARM calculates reflection and transmission coefficients, power
reflection and transmission coefficients, and return and insertion
losses of a frequency selective surface.
"""
command = f"FSSPARM,{port1},{port2}"
return self.run(command, **kwargs)
def fsum(self, lab="", item="", **kwargs):
"""Sums the nodal force and moment contributions of elements.
APDL Command: FSUM
Parameters
----------
lab
Coordinate system in which to perform summation.
(blank) - Sum all nodal forces in global Cartesian coordinate system (default).
RSYS - Sum all nodal forces in the currently active RSYS coordinate system.
item
Selected set of nodes.
(blank) - Sum all nodal forces for all selected nodes (default), excluding contact
elements.
CONT - Sum all nodal forces for contact nodes only.
BOTH - Sum all nodal forces for all selected nodes, including contact elements.
Notes
-----
Sums and prints, in each component direction for the total selected
node set, the nodal force and moment contributions of the selected
elements attached to the node set. Selecting a subset of nodes [NSEL]
and then issuing this command will give the total force acting on that
set of nodes (default), excluding surface-to-surface, node-to-surface,
line-to-line, and line-to-surface contact elements (TARGE169, TARGE170,
CONTA171, CONTA172, CONTA173, CONTA174, CONTA175, CONTA176, and
CONTA177).
Setting ITEM = CONT sums the nodal forces and moment contributions of
the selected contact elements (CONTA171, CONTA172, CONTA173, CONTA174,
CONTA175, CONTA176, and CONTA177). Setting ITEM = BOTH sums the nodal
forces for all selected nodes, including contact elements.
Nodal forces associated with surface loads are not included. The
effects of nodal coupling and constraint equations are ignored. Moment
summations are about the global origin unless another point is
specified with the SPOINT command. This vector sum is printed in the
global Cartesian system unless it is transformed [RSYS] and a point is
specified with the SPOINT command. By default, the sum is done in
global Cartesian, and the resulting vector is transformed to the
requested system.
The LAB = RSYS option transforms each of the nodal forces into the
active coordinate system before summing and printing. The FORCE command
can be used to specify which component (static, damping, inertia, or
total) of the nodal load is to be used. This command output is included
in the NFORCE command.
The command should not be used with axisymmetric elements because it
might calculate a moment where none exists. Consider, for example, the
axial load on a pipe modeled with an axisymmetric shell element. The
reaction force on the end of the pipe is the total force (for the full
360 degrees) at that location. The net moment about the centerline of
the pipe would be zero, but the program would incorrectly calculate a
moment at the end of the element as the force multiplied by the radius.
The command is not valid for elements that operate solely within the
nodal coordinate system with 1-D option activated and rotated nodes
(NROTAT).
"""
command = f"FSUM,{lab},{item}"
return self.run(command, **kwargs)
def hfang(self, lab="", phi1="", phi2="", theta1="", theta2="", **kwargs):
"""Defines or displays spatial angles of a spherical radiation surface for
APDL Command: HFANG
sound radiation parameter calculations.
Parameters
----------
lab
Spatial angle label.
ANGLE - Define spatial angles (default).
STATE - Display spatial angles. PHI1, PHI2, THETA1, and THETA2 are ignored.
phi1, phi2
Starting and ending ϕ angles (degrees) in the spherical coordinate
system. Defaults to 0.
theta1, theta2
Starting and ending θ angles (degrees) in the spherical coordinate
system. Defaults to 0.
Notes
-----
Defines or displays spatial angles of a spherical radiation surface.
Use this command only with PLFAR,Lab = PRES, or PRFAR,Lab = PRES.
"""
command = f"HFANG,{lab},{phi1},{phi2},{theta1},{theta2}"
return self.run(command, **kwargs)
def hfsym(self, kcn="", xkey="", ykey="", zkey="", **kwargs):
"""Indicates the presence of symmetry planes for the computation of
APDL Command: HFSYM
acoustic fields in the near and far field domains (beyond the finite
element region).
Parameters
----------
kcn
Coordinate system reference number. KCN may be 0 (Cartesian), or
any previously defined local Cartesian coordinate system number
(>10). Defaults to 0.