Skip to content
Snippets Groups Projects
ansys-mechanical-apdl.md 2.61 KiB
Newer Older
  • Learn to ignore specific revisions
  • David Hrbáč's avatar
    David Hrbáč committed
    # ANSYS MAPDL
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    
    
    Pavel Jirásek's avatar
    Pavel Jirásek committed
    **[ANSYS Multiphysics](http://www.ansys.com/products/multiphysics)**
    
    David Hrbáč's avatar
    David Hrbáč committed
    software offers a comprehensive product solution for both multiphysics and single-physics analysis. The product includes structural, thermal, fluid and both high- and low-frequency electromagnetic analysis. The product also contains solutions for both direct and sequentially coupled physics problems including direct coupled-field elements and the ANSYS multi-field solver.
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    To run ANSYS MAPDL in batch mode you can utilize/modify the default mapdl.pbs script and execute it via the qsub command.
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    ```bash
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    #!/bin/bash
    #PBS -l nodes=2:ppn=16
    #PBS -q qprod
    #PBS -N $USER-ANSYS-Project
    #PBS -A XX-YY-ZZ
    
    #! Mail to user when job terminate or abort
    #PBS -m ae
    
    #!change the working directory (default is home directory)
    #cd <working directory> (working directory must exists)
    WORK_DIR="/scratch/$USER/work"
    cd $WORK_DIR
    
    echo Running on host `hostname`
    echo Time is `date`
    echo Directory is `pwd`
    echo This jobs runs on the following processors:
    echo `cat $PBS_NODEFILE`
    
    module load ansys
    
    #### Set number of processors per host listing
    #### (set to 1 as $PBS_NODEFILE lists each node twice if :ppn=2)
    procs_per_host=1
    #### Create host list
    hl=""
    for host in `cat $PBS_NODEFILE`
    do
     if [ "$hl" = "" ]
     then hl="$host:$procs_per_host"
     else hl="${hl}:$host:$procs_per_host"
     fi
    done
    
    echo Machines: $hl
    
    #-i input.dat includes the input of analysis in APDL format
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    #-o file.out is output file from ansys where all text outputs will be redirected
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    #-p the name of license feature (aa_r=ANSYS Academic Research, ane3fl=Multiphysics(commercial), aa_r_dy=Academic AUTODYN)
    /ansys_inc/v145/ansys/bin/ansys145 -b -dis -p aa_r -i input.dat -o file.out -machines $hl -dir $WORK_DIR
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    ```
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    
    
    David Hrbáč's avatar
    David Hrbáč committed
    Header of the PBS file (above) is common and description can be found on [this site](../../resource-allocation-policy/). [SVS FEM](http://www.svsfem.cz) recommends to utilize sources by keywords: nodes, ppn. These keywords allow to address directly the number of nodes (computers) and cores (ppn) which will be utilized in the job. Also the rest of code assumes such structure of allocated resources.
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    
    
    David Hrbáč's avatar
    David Hrbáč committed
    Working directory has to be created before sending PBS job into the queue. Input file should be in working directory or full path to input file has to be specified. Input file has to be defined by common APDL file which is attached to the ANSYS solver via parameter -i
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    **License** should be selected by parameter -p. Licensed products are the following: aa_r (ANSYS **Academic** Research), ane3fl (ANSYS Multiphysics)-**Commercial**, aa_r_dy (ANSYS **Academic** AUTODYN)
    
    [More about licensing here](licensing/)