ansys / pyprimemesh

Pythonic Meshing Client for Ansys Prime Server
https://prime.docs.pyansys.com/
MIT License
19 stars 9 forks source link

Quadratic Tet Mesh has no midside nodes #856

Closed jefeenders closed 1 day ago

jefeenders commented 3 weeks ago

πŸ” Before submitting the issue

🐞 Description of the bug

When trying to create a quadratic tet mesh with the current 0.6 version of prime only a linear tet mesh is created. In a previously used version (0.4.2) this worked.
Comparing the cdb files from 0.4.2 and 0.6 the older version assigns solid187 (tet10) elements and the new version uses solid185 elements. Maybe some refactoring of the cdb writing functionality might have introduced this problem?

πŸ“ Steps to reproduce

I copy the code of the important sections of the steps as well:

  1. Create a surface mesh with wrap function on a .stl file
    mesh_util = prime.lucid.Mesh(model)
    wrap = mesh_util.wrap(
        keep_inputs=False,
        growth_rate=FINAL_GROWTH_RATE,
        region_extract=prime.WrapRegion.EXTERNAL,
        create_intersection_loops=False,
        recompute_remesh_sizes=False,
        wrap_size_controls=[
            curv_ctrl_wrap,
        ], 
        remesh_size_controls=[curv_control], 
        extract_features=False,
        feature_angle=180,
        number_of_threads=4,
        use_existing_features=True,
        remesh_postwrap=True,  
    )
  2. Create volume mesh:

    mesh_util = prime.lucid.Mesh(model)
    x = wrapPart.get_edge_zonelets()
    wrapPart.delete_zonelets(x)
    mesh_util.compute_volumes()
    volume = prime.lucid.VolumeScope(
        part_expression=wrapPart.name,
        entity_expression="*",
    )
    
    model.set_global_sizing_params(
        prime.GlobalSizingParams(model, min=0.1, max=10.0, growth_rate=1.6)
    )
    
    mesh_util.volume_mesh(scope=volume, quadratic=True, growth_rate=1.6)
  3. Export cdb
    mesh_util = prime.lucid.Mesh(model)
    # file_io = prime.FileIO(model)
    output_folder = Path("./")
    mesh_util.write(str(output_folder / "part.cdb"))
  4. Use external model in Ansys Workbench to import to static structural analysis
  5. Midside nodes are not in the model

πŸ’» Which operating system are you using?

Windows

πŸ“€ Which ANSYS version are you using?

2024 R2

🐍 Which Python version are you using?

3.9

πŸ“¦ Installed packages

aiohappyeyeballs==2.3.5
aiohttp==3.10.3
aiosignal==1.3.1
ansys-api-meshing-prime==0.1.3
ansys-dpf-core==0.12.1
ansys-meshing-prime==0.6.2
anyio==4.4.0
appdirs==1.4.4
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asttokens==2.4.1
async-timeout==4.0.3
attrs==24.2.0
beautifulsoup4==4.12.3
bleach==6.1.0
cachetools==5.4.0
certifi==2024.7.4
cffi==1.17.0
charset-normalizer==3.3.2
colorama==0.4.6
comm==0.2.2
contourpy==1.2.1
cycler==0.12.1
decorator==5.1.1
defusedxml==0.7.1
exceptiongroup==1.2.2
executing==2.0.1
fastjsonschema==2.20.0
fonttools==4.53.1
fqdn==1.5.1
frozenlist==1.4.1
google-api-core==2.19.1
google-api-python-client==2.140.0
google-auth==2.33.0
google-auth-httplib2==0.2.0
googleapis-common-protos==1.63.2
grpcio==1.65.4
httplib2==0.22.0
idna==3.7
importlib_metadata==8.2.0
importlib_resources==6.4.0
ipython==8.18.1
ipywidgets==8.1.3
isoduration==20.11.0
jedi==0.19.1
Jinja2==3.1.4
jsonpointer==3.0.0
jsonschema==4.23.0
jsonschema-specifications==2023.12.1
jupyter-events==0.10.0
jupyter_client==8.6.2
jupyter_core==5.7.2
jupyter_server==2.14.2
jupyter_server_proxy==4.3.0
jupyter_server_terminals==0.5.3
jupyterlab_pygments==0.3.0
jupyterlab_widgets==3.0.11
kiwisolver==1.4.5
MarkupSafe==2.1.5
matplotlib==3.9.2
matplotlib-inline==0.1.7
mistune==3.0.2
more-itertools==10.4.0
msgpack==1.0.8
multidict==6.0.5
nbclient==0.10.0
nbconvert==7.16.4
nbformat==5.10.4
nest-asyncio==1.6.0
numpy==2.0.1
overrides==7.7.0
packaging==24.1
pandocfilters==1.5.1
parso==0.8.4
pillow==10.4.0
platformdirs==4.2.2
pooch==1.8.2
prometheus_client==0.20.0
prompt_toolkit==3.0.47
proto-plus==1.24.0
protobuf==4.25.4
psutil==6.0.0
pure_eval==0.2.3
pyasn1==0.6.0
pyasn1_modules==0.4.0
pycparser==2.22
Pygments==2.18.0
pyparsing==3.1.2
python-dateutil==2.9.0.post0
python-json-logger==2.0.7
pyvista==0.44.1
pywin32==306
pywinpty==2.0.13
PyYAML==6.0.2
pyzmq==26.1.0
referencing==0.35.1
requests==2.32.3
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.20.0
rsa==4.9
scooby==0.10.0
Send2Trash==1.8.3
simpervisor==1.0.0
six==1.16.0
sniffio==1.3.1
soupsieve==2.5
stack-data==0.6.3
terminado==0.18.1
tinycss2==1.3.0
tornado==6.4.1
tqdm==4.66.5
traitlets==5.14.3
trame==3.6.3
trame-client==3.2.2
trame-server==3.0.3
trame-vtk==2.8.10
trame-vuetify==2.6.2
types-python-dateutil==2.9.0.20240316
typing_extensions==4.12.2
uri-template==1.3.0
uritemplate==4.1.1
urllib3==2.2.2
vtk==9.3.1
wcwidth==0.2.13
webcolors==24.8.0
webencodings==0.5.1
websocket-client==1.8.0
widgetsnbextension==4.0.11
wslink==2.1.2
yarl==1.9.4
zipp==3.20.0
hlee0122 commented 3 weeks ago

APS 1116868

hlee0122 commented 3 weeks ago

@jefeenders Just wanted to comment on the bullet point 4, you could still have Tet10 elements with mid nodes if you read the exported cdb to ANSYS Mechanical using new Mesh Workflows (i.e. not using external model route in Workbench).

jefeenders commented 3 weeks ago

@jefeenders Just wanted to comment on the bullet point 4, you could still have Tet10 elements with mid nodes if you read the exported cdb to ANSYS Mechanical using new Mesh Workflows (i.e. not using external model route in Workbench).

I checked that workflow, but I am not really sure how to import the cdb into that.

hlee0122 commented 3 weeks ago

@jefeenders Just wanted to comment on the bullet point 4, you could still have Tet10 elements with mid nodes if you read the exported cdb to ANSYS Mechanical using new Mesh Workflows (i.e. not using external model route in Workbench).

I checked that workflow, but I am not really sure how to import the cdb into that.

Let's connect separately for this topic so I can guide you through the workflow setup if that's ok. Thanks

waltersma commented 1 day ago

Issue was limited to wrapper based workflow exporting quadratic elements and reading them through External Model in Workbench. Fixed in 25R1 server.