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

Update lucid.rst #656

Merged
merged 6 commits into from
Jan 16, 2024
Merged
Changes from 1 commit
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
70 changes: 69 additions & 1 deletion doc/source/user_guide/lucid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Common meshing tasks and the Lucid module
*****************************************

The :mod:`lucid <ansys.meshing.prime.lucid>` module defines high-level methods to abstract
The `lucid <https://prime.docs.pyansys.com/version/stable/api/_autosummary/ansys.meshing.prime.lucid.html>` module defines high-level methods to abstract
and simplify common meshing tasks. Methods contained in this module are intended to demonstrate
how the low-level APIs can be combined to execute meshing workflows flexibly and with minimal
need for understanding PyPrimeMesh-specific concepts. The methods use global automatic defaults
Expand Down Expand Up @@ -41,3 +41,71 @@ Here is an example of meshing the mixing elbow case for a fluid flow analysis:
mesh_util.create_zones_from_labels()
mesh_util.write("mixing_elbow.cas")

Remesh surface using the Lucid module
-------------------------------------

This code shows how to replicate the preceding surface mesh results by remeshing
the surface using the Lucid module:

.. code-block:: python

import ansys.meshing.prime as prime

prime_client = prime.launch_prime()
model = prime_client.model

# Instantiate the Lucid module
mesh_util = prime.lucid.Mesh(model)

# Import CAD (STL) file
input_file = r"D:/Examples/simple-bracket-holes.stl"
mesh_util.read(input_file)

Surface wrapping using the ``lucid.Mesh`` class
-----------------------------------------------

This example shows you the method required to replicate the preceding surface mesh results:

.. code:: python

model = prime_client.model
mesh_util = prime.lucid.Mesh(model)
input_file = r"D:/PyPrimeMesh/cylinder_with_flange.pmdat"
mesh_util.read(input_file)

# Create size control for remeshing
size_control2 = model.control_data.create_size_control(
sizing_type=prime.SizingType.HARD
)
size_control2.set_hard_sizing_params(prime.HardSizingParams(model=model, min=0.8))
size_control2.set_scope(prime.ScopeDefinition(model=model))

# Wrap and remesh the input parts
mesh_util.wrap(
min_size=0.2,
max_size=1.0,
input_parts="flange,pipe",
use_existing_features=True,
recompute_remesh_sizes=True,
remesh_size_controls=[size_control2],
)


# Surface mesh the geometry with curvature sizing
# Set minimum and maximum sizing to use for curvature refinement
mesh_util.surface_mesh(min_size=0.27, max_size=5.5)
waltersma marked this conversation as resolved.
Show resolved Hide resolved

Prism controls for polyhedral mesh using the Lucid module
---------------------------------------------------------

This example shows how to generate the preceding poly prism method using the Lucid module:

.. code-block:: python

# Volume mesh with polyhedral elements
# Set prism layers parameter for boundary layer refinement
mesh_util.volume_mesh(
volume_fill_type=prime.VolumeFillType.POLY,
prism_layers=5,
prism_surface_expression="* !inlet !outlet",
)
Loading