ANSYS命令流提交指令

ANSYS命令流简介

ANSYS命令流可以写为.mac格式的文件,并且可以在mac文件中调用其它mac文件,调用时不需要在文件名后加.mac后缀,文件名就表示函数名。

命令流十分方便(貌似比ABAQUS要简单一点),因为它的文件读写,函数调用以及建模都有一些间的命令来实现,只是目前不清楚命令流会不会跟ABAQUS一样要求严格的格式。

在CMD中调用ANSYS并输入命令流计算

如果没有添加ANSYS只领到系统的环境变量PATH中,则无法直接调用ANSYS计算所输入的命令流,这时候可以直接在CMD中调用目标exe程序:

"~PATH_TO_ANSYS\Ansys Inc\v170\ansys\Bin\winx64\ansys170.exe” -b -i myinput.inp -o myoutput.out

需注意,电脑中版本是17.0,如果更换版本上述代码也要更换。

当然,想必我也可以将上述路径添加到PATH中,然后MATLAB直接调用所引用的函数名即可。然后就剩下一个问题,调用的参数是些什么?这里就要引用网上的资料了。

-acc device  

 Enables the use of GPU hardware to accelerate the analysis. See "GPU Accelerator

Capability" in the Parallel Processing Guide for more information.  

 -ansexe  

 In the ANSYS Workbench environment, activates a custom ANSYS executable.  

 -b list or nolist

  Activates the ANSYS program in batch mode. The options -b list or -b by itself

cause the input listing to be included in the output. The -b nolist option causes the

input listing not to be included. For more information about running ANSYS in batch

mode, see Batch Mode.  

 -custom  

 Calls a custom ANSYS executable. See Running Your Custom Executable in the

Guide to ANSYS User Programmable Features for more information.  

 -d device  

 Specifies the type of graphics device. This option applies only to interactive mode.

For Linux systems, graphics device choices are X11, X11C, or 3D. For Windows

systems, graphics device options are WIN32 or WIN32C, or 3D.  

 -db value  

 Defines the portion of workspace (memory) to be used as the initial allocation for the

database. The default is 512 MB for 64-bit machines, 256 MB for 32-bit machines.

Specify a negative number (-value) to force a fixed size throughout the run; useful on

small memory systems.  

 -dir  

 Defines the initial working directory. Using the -dir option overrides the

ANSYS140_WORKING_DIRECTORY environment variable.  

 -dis  

 Enables Distributed ANSYS. See the Parallel Processing Guide for more

information.  

 -dvt  

 Enables ANSYS DesignXplorer advanced task (add-on).  

 -dyn  

 Enables LS-DYNA. Applicable only for ANSYS Structural and higher license levels.  

 -g  

 Launches the ANSYS program with the Graphical User Interface (GUI) on. If you

select this option, an X11 graphics device is assumed for Linux unless the -d option

specifies a different device. This option is not used on Windows systems. To activate

the GUI once ANSYS has started, you need to enter two commands in the ANSYS

input window: /SHOW to define the graphics device, and /MENU,ON to activate the

GUI. The -g option is valid only for interactive mode. Note: If you start ANSYS via

the -g option, the program ignores any /SHOW command in the start140.ans file and

displays a splash screen briefly before opening the GUI windows.  

 -i inputname  

 Specifies the name of the file to read input into ANSYS for batch processing. On

Linux, the preferred method to indicate an input file is <.  

 -j Jobname  

 Specifies the initial jobname, a name assigned to all files generated by the program

for a specific model. If you omit the -j option, the jobname is assumed to be file.  

 -l language  

 Specifies a language file to use other than US English. This option is valid only if

you have a translated message file in an appropriately named subdirectory in

/ansys_inc/v140/ansys/docu (or Program Files\Ansys Inc\V140\ANSYS\docu on

Windows systems).  

 -m workspace  

 Specifies the total size of the workspace (memory) in megabytes used for the initial

allocation. If you omit the -m option, the default is 1 GB (1024 MB) for 64-bit

machines, 512 MB for 32-bit machines. Specify a negative number (-value) to force a

fixed size throughout the run.  

 -machines  

 Specifies the machines on which to run a Distributed ANSYS analysis. See Starting

Distributed ANSYS in the Parallel Processing Guide for more information.  

 -mfm  

 Specifies the master field name in an ANSYS Multi-field solver - MFX analysis. See

Starting and Stopping an MFX Analysis in the Coupled-Field Analysis Guide for more

information.  

 -mpi  

 Specifies the type of MPI to use. See the Parallel Processing Guide for more

information.  

 -mpifile  

 Specifies an existing MPI file (appfile) to be used in a Distributed ANSYS run. See

Using MPI appfiles in the Parallel Processing Guide for more information.  

 -name value  

 Defines ANSYS parameters at program start-up. The parameter name must be at

least two characters long. For details about parameters, see the ANSYS Parametric

Design Language Guide.  

 -np  

 Specifies the number of processors to use when running Distributed ANSYS or

Shared-memory ANSYS. See the Parallel Processing Guide or the Advanced Analysis

Techniques Guide for more information.  

 -o outputname  

 Specifies the name of the file to store the output from a batch execution of ANSYS.

On Linux, the preferred method to indicate an output file is >.  

 -p productname  

 Defines which ANSYS product will run during the session (ANSYS Multiphysics,

ANSYS Structural, etc.). For more detailed information about the -p option, see

Choosing an ANSYS Product via Command Line.  

 -s read or noread  

 Specifies whether the program reads the start140.ans file at start-up. If you omit the

-s option, ANSYS reads the start140.ans file in interactive mode and not in batch

mode.  

 -schost host name  

 Specifies the host machine on which the coupling service is running (to which the

co-simulation participant/solver must connect) in a System Coupling analysis.  

 -scname name of the solver  

 Specifies the unique name used by the co-simulation participant to identify itself to

the coupling service in a System Coupling analysis. For Linux systems, you need to

escape the quotes or escape the space to have the name recognized with a space:

ansys140.exe-scname=\”Solution 1\” or ansys140.exe-scname=”Solution\ 1”  

 -scport port number  

 Specifies the port on the host machine upon which the coupling service is listening

for connections from co-simulation participants in a System Coupling analysis.  

 -ser  

 Specifies the communication port number between ANSYS and CFX in an MFX

analysis.  

 -v  

 Returns the ANSYS release number, update number, copyright date, customer

number, and license manager version number.  

与此同时,官方的帮助文档中有关于Batch Mode的解释,对windows系统,前端运行采用指令:

"<drive>:\Program Files\ANSYS Inc\V170\ANSYS\bin\<platform>\ansys170" -b -i 
 inputname -o outputname

即刚才所写的指令,而后台运行采用:

start /min "<drive>:\Program Files\ANSYS Inc\V170\ANSYS\bin\<platform>\ansys170" -b -i 
 inputname -o outputname

更多关于linux等的运行方法可以参考ANSYS帮助文档中的Batch Mode词条。而如果需要运行多个任务,可以采用如下格式(To run multiple consecutive jobs on Windows systems, create and run a batch file containing commands similar to the example below:):

set ANSYS170_PRODUCT=ANSYS
set ANS_CONSEC=YES
"C:\Program Files\ANSYS Inc\V170\ANSYS\bin\<platform>\ansys170" -b -i vm1.dat -o vm1.out
"C:\Program Files\ANSYS Inc\V170\ANSYS\bin\platform\ansys170" -b -i vm2.dat -o vm2.out
"C:\Program Files\ANSYS Inc\V170\ANSYS\bin\platform\ansys170" -b -i vm3.dat -o vm3.out

ANSYS Product variables

上面表格中提到了-p的指令,该指令可以让我们选择使用那种Product进行分析(当然前提是你的Ansys包含此Product的License)。

这个指令在某些时候比较有用,应为不同的Product之间可能存在一些不兼容的单元类型,这里可以参考连接 Link here。链接中的楼主貌似就是因此而导致的问题。

Product

Feature Names

ANSYS Multiphysics Products

ANSYS AIM Pro

aim_mp1

ANSYS Mechanical CFD-Flo

ancfx*

ANSYS Mechanical Emag

ane3*

ANSYS Multiphysics

ane3fl*

ANSYS Multiphysics Solver

mpba*

ANSYS nCode DesignLife Products

ANSYS nCode DesignLife Standard

ancode_standard

ANSYS nCode DesignLife Vibration

ancode_vibration

ANSYS nCode DesignLife Accelerated Testing

ancode_acc_testing

ANSYS nCode DesignLife Welds

ancode_welds

 ANSYS nCode DesignLife Parallel

ancode_hpc

ANSYS nCode DesignLife Thermo-Mechanical Module

ancode_thermo_mech

ANSYS nCode DesignLife Composites

ancode_composite

ANSYS Structural Mechanics Products

ANSYS Composite Cure Simulation

a_lmat

ANSYS Customization Suite

ans_act

ANSYS DesignSpace

caewbpl3

ANSYS DesignXplorer

dsdxm

ANSYS Fatigue Module

dfatigue

ANSYS Mechanical Pro

mech_1*

ANSYS Mechanical Premium

mech_2*

ANSYS Mechanical Enterprise

ansys*

ANSYS Mechanical Enterprise Solver

meba*

ANSYS Professional NLS

prfnls

ANSYS Professional NLT

prf*

ANSYS Rigid Body Dynamics

kinemat, dynamics

ANSYS Structural

struct*

ANSYS Structural Solver

stba*

ANSYS Explicit Dynamics Products

ANSYS Autodyn

acdi_ad3dfull, acdi_adhpc, acdi_adprepost, int4nas

ANSYS Explicit STR

acdi_explprof

ANSYS LS-DYNA

dyna*

ANSYS Fluid Dynamics Products

ANSYS BladeModeler

acfx_bldmdlr

ANSYS CFD

acfd

ANSYS CFD MHD

acfd_mhd

ANSYS CFD Solver

acfd_solver

ANSYS CFD-Flo

acfd_flo

ANSYS CFD-Flo Solver

acfx_pre, acfx_solver, acfx_nolimit, acfx_parallel

ANSYS CFX

acfd_cfx

ANSYS CFX Advanced Turbulence Models

acfx_advanced_turbulence, acfx_turbulence_transition

ANSYS CFX Multiple Frames of Reference

acfx_mfr

ANSYS CFX Multi-Phase Flows

acfx_multiphase

ANSYS CFX Radiation Models

acfx_radiation

ANSYS CFX Reacting and Combusting Species

acfx_combustion

ANSYS CFX Solver

acfd_cfx_solver, acfx_pre

ANSYS CFX-RIF Flamelet Library Generator

acfd_rif

ANSYS Fluent

acfd_fluent

ANSYS Fluent Immersed Boundary Module

acfd_ib

ANSYS Fluent PEM Fuel Cell Module

acfd_fcell

ANSYS Fluent SOFC Fuell Cell Module

acfd_fcell

ANSYS Fluent Solver

acfd_fluent_solver

ANSYS Fluent V2F Module

acfd_v2f

ANSYS Fluent for CATIA V5

acfd_ffc, acfd_ffc_pre

ANSYS Fluent for CATIA V5 Pre

acfd_ffc_pre

ANSYS Fluent for CATIA V5 Analyst

acfd_ffc, acfd_ffc_pre, acfd_fluent_solver

ANSYS Polyflow

acfd_polyflow

ANSYS Polyflow BlowMolding

acfd_polyflow_blowmolding

ANSYS Polyflow Extrusion

acfd_polyflow_extrusion

ANSYS Polyflow Solver

acfd_polyflow_solver

ANSYS TurboGrid

acfx_turbogrid

ANSYS CFX Turbo

acfd_cfx_turbo

ANSYS Vista TF

acfd_vista_tf

Combustion and Chemical Reactions Products

ANSYS CHEMKIN-PRO

rd_ckgraph, rd_ckpost, rd_ckpreproc, rd_ckui, rd_ckcompute

ANSYS CHEMKIM-PRO HPC

rd_ckcompute

ANSYS Collaborator License

rd_ckgraph, rd_ckpost, rd_ckpreproc, rd_ckui, rd_ckcompute

ANSYS ENERGICO

rd_ckgraph, rd_ckpost, rd_ckpreproc, rd_ckui, rd_ckcompute, rd_energico, rd_kineticsapi

ANSYS ENERGICO Add-on

rd_energico, rd_kineticsapi

ANSYS Forte CFD

rd_fortejob, rd_forteui, rd_forteviz, rd_fortemesh, rd_mechforte, rd_mechsoot

ANSYS MFL Encrypted Member

rd_mechmfc

ANSYS MFL Encrypted Non-Member

rd_mechmfc

ANSYS Reaction Workbench Add-on

rd_mechwb, rd_reactionwbui

ANSYS HPC Products

ANSYS HPC

anshpc

ANSYS HPC Pack

anshpc_pack

ANSYS HPC Parametric Pack

ans_dp_pack

ANSYS LS-DYNA HPC

dysmp

ANSYS Pre/Post Processing and Geometry Interface Products

ANSYS Autodyn PrepPost

acdi_adprepost

ANSYS Geometry Interface for CATIA V6

a_catv6_reader

ANSYS CFD-Post

acfx_post

ANSYS CFD PrepPost

acfd_preppost

ANSYS Composite PrepPost

acpreppost

ANSYS DesignModeler

agppi

ANSYS Extended Meshing

amesh_extended

ANSYS Geometry Interfaces

a_geometry

ANSYS ICEM CFD Hexa

aimed, aihexa, aimshcrt, aibfcart, aiiges, aiacis, aioutput, aioutcfd, aidxf, aiquad, aimshcrt

ANSYS ICEM CFD Tetra/Prism

aimed, aitetra, aiprism, aiiges, aiacis, aioutput, aioutcfd, aidxf, aiquad

ANSYS Interface for Team Center Engineering

pdmiman

ANSYS Geometry Interface for JT

a_jt_reader

ANSYS LS-DYNA PrepPost

dynapp*

ANSYS Mechanical Enterprise PrepPost

preppost*

ANSYS Meshing

amesh

ANSYS Mesh Morpher

paramesh

ANSYS RBF Morph Module

rbfmorph

ANSYS SpaceClaim CATIA V5 Interface

a_spaceclaim_catv5

ANSYS SpaceClaim Direct Modeler

a_spaceclaim_dirmod

GD&T Module for SpaceClaim

a_spaceclaim_gdt

JT Open Reader for SpaceClaim

a_spaceclaim_jt

Faceted Data Toolkit for SpaceClaim

a_spaceclaim_faceteddata

3D PDF Reader for SpaceClaim

a_spaceclaim_3dpdf

CADNexus/CAPRI CAE Gateway for CATIA V5

capricatv5

Geometry Interface for Autodesk

piautoin

Geometry Interface for CATIA V5

picatv5

Geometry Interface for CATIA V5 Linux

linux_catiav5

Geometry Interface for Creo Elements/Direct Modeling

1spacdes

Geometry Interface for Creo Parametric

piproe

Geometry Interface for NX

piug

Geometry Interface for Parasolid

rdpara

Geometry Interface for SAT

rdacis

Geometry Interface for Solid Edge

pisoledg

Geometry Interface for SolidWorks

pisolwor

ANSYS Academic Products

ANSYS Academic Associate Mechanical and CFD

aa_a*, aa_mcad

ANSYS Academic Associate CFD

aa_a_cfd, aa_mcad

ANSYS Academic Associate HPC

aa_a_hpc

ANSYS Academic Fuel Cell Tools

aa_fcell

ANSYS Academic Meshing Tools

aa_mesh, aa_mcad

ANSYS Academic Research Mechanical and CFD

aa_r*, aa_mcad

ANSYS Academic Research CFD

aa_r_cfd, aa_mcad

ANSYS Academic Research Electronics Thermal

aa_r_et, aa_mcad

ANSYS Academic Research HPC

aa_r_hpc

ANSYS Academic Research LS-DYNA

aa_r_dy*, aa_mcad

ANSYS Academic Research LS-DYNA HPC

aa_dy_p

ANSYS Academic Research Mechanical

aa_r_me, aa_mcad

ANSYS Academic Research Polyflow

aa_r_pf, aa_mcad

ANSYS Academic Teaching CFD

aa_t_cfd, aa_mcad

ANSYS Academic Teaching Mechanical

aa_t_me*, aa_mcad, aa_ds

ANSYS Academic Student

aa_t_i*, aa_mcad, aa_ds

ANSYS AIM Student

aa_s_aim

ANSYS EKM Products

ANSYS EKM Analyst

ekm_desktop, ekm_md

ANSYS EKM Basic

ekm_basic

ANSYS EKM Shared

ekm_user, ekm_md

ANSYS Offshore Products

ANSYS AQWA DIFFRACTION

acdi_aqwags, acdi_aqwaline, acdi_aqwawave, acdi_hydrodiff

ANSYS AQWA SUITE

acdi_aqwadrft, acdi_aqwafer, acdi_aqwags, acdi_aqwalbrm, acdi_aqwaline, acdi_aqwanaut, acdi_aqwawave, acdi_hydrodiff

ANSYS AQWA SUITE with Coupled Cable Dynamics

acdi_aqwaline, acdi_aqwawave, acdi_cd-ags, acdi_cd-drift, acdi_cd-fer, acdi_cd-libr, acdi_cd-naut, acdi_hydrodiff

ANSYS ASAS-OFFSHORE

acdi_asas, acdi_asaslink, acdi_asasnl, acdi_asas-vis, acdi_beamst, acdi_comped, acdi_fatjack, acdi_loco, acdi_mass, acdi_maxmin, acdi_post, acdi_postnl, acdi_prebeam, acdi_prenl, acdi_response, acdi_splinter, acdi_wave, acdi_windspec, acdi_xtract, preppost

ANSYS BEAMCHECK

acdi_asas-vis, acdi_beamst

ANSYS FATJACK

acdi_fatjack

ANSYS Electronic Thermal Management Products

ANSYS Iceopt

aice_opt

ANSYS Icepak

aice_pak, aiiges, aice_mesher, aice_solv

ANSYS Icepak Solver

aice_solv

ANSYS Electromagnetics Products

ANSYS ALinks for EDA

al4allegro, al4ansoft, al4apd, al4boardstation, al4encore, al4expedition, al4generic, al4powerpcb, al4virtuoso, al4zuken, alinks_gui (2 per seat), al4cadvance, al4cds, al4gem, al4first

ANSYS ALinks for MCAD

xlate_iges, xlate_proe, xlate_step, xlate_inventor, xlate_solidworks

ANSYS ALinks for MCAD CATIA

xlate_catia4, xlate_catia5

ANSYS ALinks for MCAD NX

xlate_unigraphics

ANSYS ALinks for MCAD Parasolid

xlate_parasolid

ANSYS Designer Pre/Post Processor

al4ansoft, al4generic, designer_desktop, ensemble_gui, nexxim_gui, nexxim_netlist, serenade_gui, symphony_gui, nexxim_dc, serenade_linear

ANSYS Distributed Solve (DSO)

ansoft_distrib, ansoft_distrib_engine, ansoft_distrib_engine_mp

ANSYS Electronics HPC

hfsshpc

ANSYS Electronics HPC Pack

hfsshpc_pack

ANSYS HFSS

ensemble_gui, hfss_desktop, hfss_gui, hfss_solve, nexxim_gui

ANSYS HFSS Pre/Post Processor

ensemble_gui, hfss_desktop, hfss_gui, nexxim_gui

ANSYS HFSS Solver

hfss_solve

ANSYS HFSS-IE Solver

hfssie_solve, hfssie_gui

ANSYS HFSS-TR Solver

hfss_transient_solve

ANSYS Maxwell 2D

m2dfs_ac, m2dfs_ax, m2dfs_ckt, m2dfs_cn, m2dfs_ed, m2dfs_es, m2dfs_gui (5 per seat), m2dfs_ms, m2dfs_par, m2dfs_post (2 per seat), m2dfs_solve, maxwell_desktop (5 per seat), maxwlspc, schem_gui, m2dfs_th, m2dfs_tran, m2dfs_qs_solve (5 per seat)

ANSYS Maxwell 3D

m2dfs_ac, m2dfs_ax, m2dfs_ckt, m2dfs_cn, m2dfs_ed, m2dfs_es, m2dfs_gui' m2dfs_ms, m2dfs_par, m2dfs_post (2 per seat), m2dfs_solve, m3dfs_gui (5 per seat), m3dfs_solve, maxwell_desktop (5 per seat), maxwlspc, schem_gui, m2dfs_th, m2dfs_tran, m2dfs_qs_solve (5 per seat), m3dfs_qs_solve

ANSYS Maxwell 3D Pre/Post Processor

m2dfs_gui (5 per seat), m3dfs_gui, maxwell_desktop (5 per seat)

ANSYS Maxwell 3D QS

m2dfs_gui (5 per seat), m3dfs_gui, maxwell_desktop (5 per seat), m2dfs_qs_solve (5 per seat), m3dfs_qs_solve

ANSYS Optimetrics (For HFSS, Q3D Extractor, Maxwell)

optimetrics, ansoft_distrib_engine (2 per seat)

ANSYS PExprt

m2dfs_gui, maxwell_desktop, maxwlspc, pemag, pexprt, m2dfs_qs_solve

ANSYS Q3D Extractor

q3d_desktop, si2d_gui, si2d_solve, si3d_gui, si3d_solve

ANSYS Q3D Extractor 3D Solver

si3d_solve

ANSYS Q3D Extractor Pre/Post Processor

q3d_desktop, si2d_gui, si3d_gui

ANSYS RF Option

ensemble_25_sim, symphony_dt_sim, symphony_fd_sim, nexxim_dc, nexxim_tran, nexxim_hb, nexxim_osc, nexxim_tvnoise, filter_synthesis

ANSYS RMxprt

maxwell_desktop, rmxprt_bcm, rmxprt_ecm, rmxprt_gui, rmxprt_im, rmxprt_sym

ANSYS SI Option

nexxim_dc, nexxim_eye, nexxim_tran, nexxim_ami, hfss_transient_solve, designer_hspice

ANSYS Simplorer

simplorer_desktop, simplorer_gui, simplorer_sim, mspc_fws, DayBasic, DayIEEEDataInterface, SimplorerBasic, SimplorerKernel, SimplorerSchematic, SimplorerLibPower, SimplorerLibMechanics, SimplorerLibAutomotive, SimplorerLibHydraulic, SimplorerLibSensor

ANSYS Simplorer Advanced

simplorer_advanced, simplorer_CProgrInterface, simplorer_desktop, simplorer_gui, simplorer_sim, mspc_fws, DayBasic, DayIEEEDataInterface, SimplorerBasic. SimplorerCProgrInterface, SimplorerFrequencyStepResp, SimplorerKernel, SimplorerMaxwellTr2D, SimplorerOptimizer, SimplorerSchematic, SimplorerSIMULINK, SimplorerLibPower, SimplorerLibMechanics, SimplorerLibAutomotive, SimplorerLibHydraulic, SimplorerLibSensor, simplorer_vhdlams, simplorer_control

ANSYS Simplorer Basic

simplorer_CProgrInterface, simplorer_desktop, simplorer_gui, simplorer_sim, mspc_fws, DayBasic, DayIEEEDataInterface, SimplorerBasic, SimplorerKernel, SimplorerSchematic

ANSYS Simplorer Control Option

simplorer_control

ANSYS Simplorer ML

simplorer_CProgrInterface, simplorer_desktop, simplorer_gui, simplorer_sim, mspc_fws, DayBasic, DayIEEEDataInterface, SimplorerBasic, SimplorerKernel, SimplorerSchematic, simplorer_vhdlams

ANSYS SIwave

al4generic, designer_desktop, ensemble_gui, nexxim_gui, nexxim_netlist, siwave_gui, siwave_reporter, siwave_solver, nexxim_dc, nexxim_eye, nexxim_tran, nexxim_ami, designer_hspice, siwave_level1, siwave_level2, siwave_level3

ANSYS SIwave - DC

siwave_gui, siwave_level1

ANSYS SIwave PI

designer_desktop, ensemble_gui, nexxim_gui, nexxim_netlist, siwave_gui, siwave_reporter, designer_hspice, siwave_pi_adv, siwave_level1, siwave_level2

ANSYS SIwave PI Advisor Suite

siwave_gui, siwave_reporter, siwave_pi_adv

ANSYS SIwave Pre/Post Processor

al4generic, siwave_gui, siwave_reporter

ANSYS SIwave PSI Solver

siwave_psi_ac_solve

ANSYS SMPS Power Package

simplorer_LibSMPS