Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc/revised example 13 #519

Merged
merged 4 commits into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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's thermal analysis results are also
the input of a 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
Loading