ansys / pydpf-core

Data Processing Framework - Python Core
http://dpf.docs.pyansys.com/
MIT License
67 stars 23 forks source link

Add Operator for 2D Element Area #1201

Closed MichaelBThompson closed 8 months ago

MichaelBThompson commented 10 months ago

Description of the feature

It is good to be able to get the area of 2D elements as a function of time as they deform in an analysis. Most common use would be contact area. Add an operator that can calculate the area of the 2D element faces and return a fields container of element->Area. Could also make an option in the operator to return the total area (summation). This could also be done in linking to the summation operator, but an option in this one would be useful.

Steps for implementing the feature

add operator

Useful links and references

No response

PProfizi commented 10 months ago

@MichaelNale

mikerife commented 10 months ago

Hi @MichaelBThompson @MichaelNale In Mechanical APDL most elements that are 3D (i.e. have 3 dof's) but are 2D in shape (like contact174) store their area within the 'volume place' in the result file. I created a small actual 2D test model (plane183) with contact172 bonding two parts each meshed with just 1 element. The final 'volume' of the contact element should be 2 (plane strain assuming unit thickness). The units will be volume but it is really an area. The model is two unit squares stretched in one direction by 1 unit.

from ansys.dpf import core as dpf
import os
result_file = r"file.rst"
DS = dpf.DataSources(result_file)
model = dpf.Model(DS)
mesh = model.metadata.meshed_region
contact_elem = dpf.mesh_scoping_factory.elemental_scoping([3])
contact_area = dpf.operators.result.elemental_volume()
contact_area.inputs.mesh_scoping.connect(contact_elem)
contact_area.inputs.data_sources.connect(DS)
contactArea = contact_area.outputs.fields_container()

And it does return the right value, though with the wrong units (which is expected):

image

Perhaps of more importance is the contacting area which can be retrieved via a NMISC item (retrieving nmisc and smisc items already have operators). The name is CAREA.

Mike

MichaelBThompson commented 10 months ago

Nice work @Mike @.***>. One other use case might be to know the area of a load application like pressure. This could be pressure with surface effect elements but could also be directly applied to solid element faces.

An ideal way to get this area data would be to calculate it via DPF rather than get it from the stored results file. This way we could still get it from a skin mesh that is created via DPF. We have a similar operator that calculates element normals. Adding area in the same way would be my suggestion, but also good to know about the ways to get info on contacts with existing methods.

Mike Thompson / Applications Engineer

407-625-7304 @.*** / www.ansys.com


From: Mike Rife @.> Sent: Thursday, October 12, 2023 10:02:55 PM To: ansys/pydpf-core @.> Cc: Michael Thompson @.>; Mention @.> Subject: Re: [ansys/pydpf-core] Add Operator for 2D Element Area (Issue #1201)

[External Sender]

Hi @MichaelBThompsonhttps://github.com/MichaelBThompson @MichaelNalehttps://github.com/MichaelNale In Mechanical APDL most elements that are 3D (i.e. have 3 dof's) but are 2D in shape (like contact174) store their area within the 'volume place' in the result file. I created a small actual 2D test model (plane183) with contact172 bonding two parts each meshed with just 1 element. The final 'volume' of the contact element should be 2 (plane strain assuming unit thickness). The units will be volume but it is really an area. The model is two unit squares stretched in one direction by 1 unit.

from ansys.dpf import core as dpf import os result_file = r"file.rst" DS = dpf.DataSources(result_file) model = dpf.Model(DS) mesh = model.metadata.meshed_region contact_elem = dpf.mesh_scoping_factory.elemental_scoping([3]) contact_area = dpf.operators.result.elemental_volume() contact_area.inputs.mesh_scoping.connect(contact_elem) contact_area.inputs.data_sources.connect(DS) contactArea = contact_area.outputs.fields_container()

And it does return the right value, though with the wrong units (which is expected):

[image]https://user-images.githubusercontent.com/91209185/274773220-0d5e7e07-c8d5-43ae-a489-08b4469486c4.png

Perhaps of more importance is the contacting area which can be retrieved via a NMISC item (retrieving nmisc and smisc items already have operators). The name is CAREA.

Mike

— Reply to this email directly, view it on GitHubhttps://github.com/ansys/pydpf-core/issues/1201#issuecomment-1760654114, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AY3ECFVD3BLLKTVKHTINZPDX7COM7AVCNFSM6AAAAAA55X2CSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRQGY2TIMJRGQ. You are receiving this because you were mentioned.Message ID: @.***>

PProfizi commented 10 months ago

Hi @MichaelBThompson,

It sounds to me like the operator elements_facets_surfaces_over_time may do what you want.

MichaelBThompson commented 8 months ago

@PProfizi , you are correct that this operator does the requested actions to get the surface areas over time. I would suggest a rename of this operator to something with surface area, but I understand if renaming is more work than is worth.