|
1 | 1 | """
|
2 |
| -Airbag deploy example |
3 |
| ---------------------- |
4 |
| -
|
| 2 | +Airbag deploy |
| 3 | +------------- |
5 | 4 | This example shows how to create an airbag deploy model with the PyDNYA ``pre`` service.
|
6 | 5 | The executable file for LS-DYNA is ``ls-dyna_smp_d_R13.0_365-gf8a97bda2a_winx64_ifort190.exe``.
|
7 | 6 |
|
8 | 7 | """
|
9 | 8 | ###############################################################################
|
10 | 9 | # Perform required imports
|
11 | 10 | # ~~~~~~~~~~~~~~~~~~~~~~~~
|
12 |
| -# Import required imports. |
| 11 | +# Peform required imports. |
13 | 12 |
|
14 | 13 | import os
|
15 | 14 | import sys
|
|
31 | 30 | )
|
32 | 31 |
|
33 | 32 | ###############################################################################
|
34 |
| -# Manually start the ``pre`` server |
| 33 | +# Manually start the ``pre`` service |
35 | 34 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
36 | 35 | # Copy the ``pyDyna/src/ansys/dyna/core/pre/Server``folder to a desired location.
|
37 | 36 | # Start the ``pre``service at this location by running this command:
|
|
41 | 40 | # Once the ``pre`` servic is running, you can connect a client to it using
|
42 | 41 | # the hostname and the port. This example uses the default local host and port
|
43 | 42 | # (``"localhost"`` and ``"50051"`` respectively).
|
44 |
| - |
| 43 | +# |
45 | 44 | from ansys.dyna.core.pre.dynamaterial import MatRigid, MatFabric
|
46 | 45 | from ansys.dyna.core.pre import examples
|
47 | 46 | # sphinx_gallery_thumbnail_path = '_static/pre/airbag/airbag.png'
|
|
50 | 49 | if len(sys.argv) > 1:
|
51 | 50 | hostname = sys.argv[1]
|
52 | 51 |
|
53 |
| - |
54 | 52 | ###############################################################################
|
55 | 53 | # Start the solution workflow
|
56 | 54 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
63 | 61 | path = examples.airbag_deploy + os.sep
|
64 | 62 | fns.append(path + "airbag_deploy.k")
|
65 | 63 | airbag_solution.open_files(fns)
|
| 64 | + |
66 | 65 | ###############################################################################
|
67 | 66 | # Create standard explicit control cards
|
68 | 67 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
80 | 79 | ###############################################################################
|
81 | 80 | # Define *AIRBAG_SIMPLE_AIRBAG_MODEL* as a keyword
|
82 | 81 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
83 |
| -# Using the ``Airbag`` function in the ``DynaMech`` class, create |
| 82 | +# Use the ``Airbag`` function in the ``DynaMech`` class to define |
84 | 83 | # *AIRBAG_SIMPLE_AIRBAG_MODEL* as a keyword. While LS-DYNA has many different
|
85 |
| -# airbag models, PyDNYA currently supports only one airbag model: |
| 84 | +# airbag models, PyDYNA currently supports only one airbag model, |
86 | 85 | # SIMPLE_AIRBAG_MODEL. If you have an urgent need for PyDYNA to support
|
87 | 86 | # another airbag model, email `[email protected] <mailto:[email protected]>`_.
|
88 | 87 |
|
|
108 | 107 | airbagdeploy.add(rigidwall)
|
109 | 108 |
|
110 | 109 | ###############################################################################
|
111 |
| -# Define a contact *NODES_TO_SURFACE* |
112 |
| -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
113 |
| -# Define a contact NODES_TO_SURFACE by passing a master part set and a slave |
| 110 | +# Define a node-to-surface contact |
| 111 | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 112 | +# Define a node-to-surface contact by passing a master part set and a slave |
114 | 113 | # part set.
|
115 | 114 |
|
116 | 115 | contact = Contact(category=ContactCategory.NODES_TO_SURFACE)
|
|
178 | 177 | airbagdeploy.parts.add(airbagpart)
|
179 | 178 |
|
180 | 179 | ###############################################################################
|
181 |
| -# Define database outputs in ASCII and binary |
182 |
| -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
183 |
| -# Use the ``set_output_database()`` and ``create_database_binary``methods to define the |
184 |
| -# output frequency of the ASCII and binary D3PLOT files. The, use the ``save_file()`` |
| 180 | +# Define database outputs |
| 181 | +# ~~~~~~~~~~~~~~~~~~~~~~~ |
| 182 | +# Use the ``set_output_database()`` and ``create_database_binary()`` methods to define the |
| 183 | +# output frequency of the ASCII and binary D3PLOT files. Then, use the ``save_file()`` |
185 | 184 | # method to write out the model as an input DYNA key file.
|
186 | 185 |
|
187 | 186 | airbag_solution.set_output_database(
|
|
0 commit comments