Skip to content

Commit 9489c1a

Browse files
committed
Merge remote-tracking branch 'origin/zhanqun/dyna-prev4' into main
2 parents d156c7a + 2595a45 commit 9489c1a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+26043
-3936
lines changed

doc/source/Resources/pydyna_pre.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ Then running command:
6565
Starting the Server
6666
-------------------
6767

68-
So far, Python 3.6/3.8/3.9 is used to start server, make sure this like below:
68+
So far, Python 3.8/3.9 is used to start server, make sure this like below:
6969

7070
.. code:: python
7171
72-
(venv) C:\pyDyna\examples\pre> C:\python36\python.exe --version
73-
Python 3.6.8
72+
(venv) C:\pyDyna\examples\pre> C:\python38\python.exe --version
73+
Python 3.8.10
7474
7575
Here is the minimal content in Server folder
7676
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -83,10 +83,9 @@ Here is the minimal content in Server folder
8383
lib/
8484
linux/
8585
keywordreader.so
86-
windows/
87-
cp36/keywordreader.pyd
88-
cp38/keywordreader.pyd
89-
cp39/keywordreader.pyd
86+
windows/
87+
cp38/keywordreader.pyd
88+
cp39/keywordreader.pyd
9089
9190
9291
Starting the Server on Windows:

doc/source/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import datetime
44
import os
5-
import sys
65

76
import pyvista
87
from ansys_sphinx_theme import pyansys_logo_black, ansys_favicon

examples/Airbag/airbag_deploy.py

Lines changed: 85 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -9,73 +9,98 @@
99
import sys
1010

1111

12-
from ansys.dyna.core.pre.dynasolution import *
13-
from ansys.dyna.core.pre.dynamech import *
14-
from ansys.dyna.core.pre.dynamaterial import *
12+
from ansys.dyna.core.pre.dynasolution import DynaSolution
13+
from ansys.dyna.core.pre.dynamech import (
14+
DynaMech,
15+
Airbag,
16+
PartSet,
17+
Curve,
18+
Point,
19+
RigidwallPlanar,
20+
Contact,
21+
ContactSurface,
22+
ContactCategory,
23+
ShellPart,
24+
ShellFormulation,
25+
)
26+
from ansys.dyna.core.pre.dynamaterial import MatRigid, MatFabric
1527
from ansys.dyna.core.pre import examples
1628

29+
hostname = "localhost"
30+
if len(sys.argv) > 1:
31+
hostname = sys.argv[1]
32+
airbag_solution = DynaSolution(hostname)
33+
fns = []
34+
# path = sys.path[0] + os.sep + "input" + os.sep + "airbag_deploy" + os.sep
35+
path = examples.airbag_deploy + os.sep
36+
fns.append(path + "airbag_deploy.k")
37+
airbag_solution.open_files(fns)
1738

18-
if __name__ == "__main__":
19-
hostname = "localhost"
20-
if len(sys.argv) > 1:
21-
hostname = sys.argv[1]
22-
airbag_solution = DynaSolution(hostname)
23-
fns = []
24-
#path = sys.path[0] + os.sep + "input" + os.sep + "airbag_deploy" + os.sep
25-
path = examples.airbag_deploy+ os.sep
26-
fns.append(path + "airbag_deploy.k")
27-
airbag_solution.open_files(fns)
39+
airbag_solution.set_termination(0.03)
2840

29-
airbag_solution.set_termination(0.03)
30-
31-
airbagdeploy = DynaMech()
32-
airbag_solution.add(airbagdeploy)
41+
airbagdeploy = DynaMech()
42+
airbag_solution.add(airbagdeploy)
3343

34-
airbag = Airbag(set=PartSet([3]),
35-
heat_capacity_at_constant_volume=1.736e3,
36-
heat_capacity_at_constant_pressure=2.43e3,
37-
input_gas_temperature=1.2e3,
38-
input_mass_flow_rate = Curve(x=[0, 0.032, 0.045, 0.08],y=[0, 26, 0.6, 0.1]),
39-
shape_factor_for_exit_hole=0.7,
40-
ambient_pressure=14.7,
41-
ambient_density=3.821e-6)
42-
airbagdeploy.add(airbag)
44+
airbag = Airbag(
45+
set=PartSet([3]),
46+
heat_capacity_at_constant_volume=1.736e3,
47+
heat_capacity_at_constant_pressure=2.43e3,
48+
input_gas_temperature=1.2e3,
49+
input_mass_flow_rate=Curve(x=[0, 0.032, 0.045, 0.08], y=[0, 26, 0.6, 0.1]),
50+
shape_factor_for_exit_hole=0.7,
51+
ambient_pressure=14.7,
52+
ambient_density=3.821e-6,
53+
)
54+
airbagdeploy.add(airbag)
4355

44-
rigidwall = RigidwallPlanar(Point(0, 0, 0),Point(0, 1, 0),coulomb_friction_coefficient=0.5)
45-
airbagdeploy.add(rigidwall)
56+
rigidwall = RigidwallPlanar(Point(0, 0, 0), Point(0, 1, 0), coulomb_friction_coefficient=0.5)
57+
airbagdeploy.add(rigidwall)
4658

47-
contact = Contact(category=ContactCategory.NODES_TO_SURFACE)
48-
contact.set_friction_coefficient(static=0.5,dynamic=0.5)
49-
surf1=ContactSurface(PartSet([3]))
50-
surf2=ContactSurface(PartSet([2]))
51-
surf2.set_penalty_stiffness_scale_factor(0.06667)
52-
contact.set_slave_surface(surf1)
53-
contact.set_master_surface(surf2)
54-
airbagdeploy.contacts.add(contact)
59+
contact = Contact(category=ContactCategory.NODES_TO_SURFACE)
60+
contact.set_friction_coefficient(static=0.5, dynamic=0.5)
61+
surf1 = ContactSurface(PartSet([3]))
62+
surf2 = ContactSurface(PartSet([2]))
63+
surf2.set_penalty_stiffness_scale_factor(0.06667)
64+
contact.set_slave_surface(surf1)
65+
contact.set_master_surface(surf2)
66+
airbagdeploy.contacts.add(contact)
5567

56-
platemat = MatRigid(mass_density=7.84e-4,young_modulus=30e6,center_of_mass_constraint=1,translational_constraint=7,rotational_constraint=7)
57-
cylindermat = MatRigid(mass_density=1.96e-4,young_modulus=30e6)
58-
airbagmat = MatFabric(mass_density=1e-4,young_modulus_longitudinal_direction=2e6,young_modulus_transverse_direction=2e6,shear_modulus=1.53e6)
59-
60-
plate = ShellPart(1)
61-
plate.set_material(platemat)
62-
plate.set_element_formulation(ShellFormulation.BELYTSCHKO_TSAY)
63-
plate.set_thickness(0.5)
64-
airbagdeploy.parts.add(plate)
68+
platemat = MatRigid(
69+
mass_density=7.84e-4,
70+
young_modulus=30e6,
71+
center_of_mass_constraint=1,
72+
translational_constraint=7,
73+
rotational_constraint=7,
74+
)
75+
cylindermat = MatRigid(mass_density=1.96e-4, young_modulus=30e6)
76+
airbagmat = MatFabric(
77+
mass_density=1e-4,
78+
young_modulus_longitudinal_direction=2e6,
79+
young_modulus_transverse_direction=2e6,
80+
shear_modulus=1.53e6,
81+
)
6582

66-
cylinder = ShellPart(2)
67-
cylinder.set_material(cylindermat)
68-
cylinder.set_element_formulation(ShellFormulation.BELYTSCHKO_TSAY)
69-
cylinder.set_thickness(0.5)
70-
airbagdeploy.parts.add(cylinder)
83+
plate = ShellPart(1)
84+
plate.set_material(platemat)
85+
plate.set_element_formulation(ShellFormulation.BELYTSCHKO_TSAY)
86+
plate.set_thickness(0.5)
87+
airbagdeploy.parts.add(plate)
7188

72-
airbagpart = ShellPart(3)
73-
airbagpart.set_material(airbagmat)
74-
airbagpart.set_element_formulation(ShellFormulation.FULLY_INTEGRATED_BELYTSCHKO_TSAY_MEMBRANE)
75-
airbagpart.set_thickness(0.015)
76-
airbagpart.set_integration_points(4)
77-
airbagdeploy.parts.add(airbagpart)
78-
79-
airbag_solution.set_output_database(abstat=2.0e-4,glstat=2.0e-4,matsum=2.0e-4,rcforc=2.0e-4,rbdout=2.0e-4,rwforc=2.0e-4)
80-
airbag_solution.create_database_binary(dt=5e-4, ieverp=1)
81-
airbag_solution.save_file()
89+
cylinder = ShellPart(2)
90+
cylinder.set_material(cylindermat)
91+
cylinder.set_element_formulation(ShellFormulation.BELYTSCHKO_TSAY)
92+
cylinder.set_thickness(0.5)
93+
airbagdeploy.parts.add(cylinder)
94+
95+
airbagpart = ShellPart(3)
96+
airbagpart.set_material(airbagmat)
97+
airbagpart.set_element_formulation(ShellFormulation.FULLY_INTEGRATED_BELYTSCHKO_TSAY_MEMBRANE)
98+
airbagpart.set_thickness(0.015)
99+
airbagpart.set_integration_points(4)
100+
airbagdeploy.parts.add(airbagpart)
101+
102+
airbag_solution.set_output_database(
103+
abstat=2.0e-4, glstat=2.0e-4, matsum=2.0e-4, rcforc=2.0e-4, rbdout=2.0e-4, rwforc=2.0e-4
104+
)
105+
airbag_solution.create_database_binary(dt=5e-4, ieverp=1)
106+
airbag_solution.save_file()

0 commit comments

Comments
 (0)