Skip to content

Commit

Permalink
revised example 13 doc
Browse files Browse the repository at this point in the history
  • Loading branch information
nshum4 committed Sep 17, 2024
1 parent e44f311 commit f90be81
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions examples/013_thermal_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@
Thermal analysis
----------------
PyDPF Composites can also be used to post-process thermal analyses.
In this case, the simulation is a two-step analysis where the results of
a thermal analysis are an input of the structural analysis. So, the RST
contains temperature and structural results.
The example mimics a PCB which was modeled with Ansys Composites PrePost (ACP).
where the solid model feature of ACP is used to generate the volume mesh.
This example shows how to evaluate a thermal analysis.
The simulation is a two-step analysis where the results of
a thermal analysis are an input of the structural analysis.
Therefore, the RST file contains temperature and structural results.
In detail, the example shows how to extract the temperatures for a specific ply,
and a specific material.
The example imitates a printed circuit board (PCB) that was
modeled with Ansys Composites PrepPost (ACP), using the solid model feature to
generate the volume mesh.
Descriptions of how to extract temperatures for a specific ply
and material are provided.
.. note::
Expand Down Expand Up @@ -67,22 +69,22 @@
# %%
# Initialize the model
# ~~~~~~~~~~~~~~~~~~~~
# The composite model is initialized with the composite files and the server.
# It provides access to the mesh, results, lay-up and materials
# Initialize the composite model with the composite files and server.
# The model provides access to the mesh, results, lay-up, and materials.
composite_model = CompositeModel(composite_files, server)

# %%
# Get Results - Temperatures
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
# The temperatures are stored under structural_temperature
# Get temperature results
# ~~~~~~~~~~~~~~~~~~~~~~~
# The temperatures are stored under ``structural_temperature``.
temp_op = composite_model.core_model.results.structural_temperature()
temperatures_fc = temp_op.outputs.fields_container()

# %%
# Ply-wise results
# ~~~~~~~~~~~~~~~~
# Ply-wise results can be easily extracted using the function
# :func:`.get_ply_wise_data` and by passing the ply name.
# Get ply results
# ~~~~~~~~~~~~~~~
# Extract the ply-wise results by passing the ply name
# to the function :func:`.get_ply_wise_data`.

all_ply_names = get_all_analysis_ply_names(composite_model.get_mesh())
print(all_ply_names)
Expand All @@ -99,10 +101,10 @@
composite_model.get_mesh().plot(nodal_values)

# %%
# Material-wise results
# ~~~~~~~~~~~~~~~~~~~~~
# It is also possible to filter the results by material.
# In this example the element-wise maximum temperature
# Get material results
# ~~~~~~~~~~~~~~~~~~~~
# You can filter the results by material.
# In this example, the element-wise maximum temperature
# is extracted for the material `Honeycomb Aluminum Alloy`.
print(composite_model.material_names)
material_id = composite_model.material_names["Honeycomb Aluminum Alloy"]
Expand Down

0 comments on commit f90be81

Please sign in to comment.