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

fix_IndexSwarmVariable #267

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

NengLu
Copy link
Contributor

@NengLu NengLu commented Nov 13, 2024

update two files

  • test_1130_IndexSwarmVariable.py
    Test IndexSwarmVariable in getting the right value on the Symmetrical Points.
  • Ex_IndexSwarmVariable.ipynb
    Vis the errors in the original code uw.swarm.IndexSwarmVariable._update(), and provide two methods to fix that.
    • MaterialA: the original code
    • MaterialB: assign the particles to the nearest mesh_levelset nodes, and calculate the material property value on mesh_levelset nodes from them.
    • MaterialC: calculate the material property value on mesh_levelset nodes from the nearest N particles directly.

The values on mesh_levelset nodes (for M_0 indicated by red, P=10.0, for M_1 indicated by blue, P=1.0)
image
The particles used to calculate the value on nodes 6 (blue) and 7 (red) (nodes 6 & 7 are the points in the middle of the left and right wall)
image

Need a further review of these two methods. They work fine for the structured box, but not well in the unstructured_irregular box.

@bknight1
Copy link
Member

bknight1 commented Nov 13, 2024

Nice work Neng!

Just a suggestion, would it be worth implementing something similar to the marker chain method? I.e. the material properties are taken at/close to the centre of the element (when degree = 0)? This would give us results to directly compare against and we know it works well in both mesh types

@NengLu
Copy link
Contributor Author

NengLu commented Nov 13, 2024

Nice work Neng!

Just a suggestion, would it be worth implementing something similar to the marker chain method? I.e. the material properties are taken at/close to the centre of the element (when degree = 0)? This would give us results to directly compare against and we know it works well in both mesh types

Thanks, Ben. Yes, and it can be done by setting the proxy_continuous as False.
IndexSwarmVariable("M", swarm, indices=2, proxy_degree=0, proxy_continuous=False), which calculates the material property value at the centre points in cells.

Sth related to the marker chain method or level set method, I am thinking about: can we use some strategies like adaptive particle refinement in SPH (smoothed particle hydrodynamics) method to improve the performance in the particle-in-cell method, as mesh elements inside the materials and far away from the interface between different materials do not need so many particles in them, and near the interface we need more particles to better "describe" the interface.

@bknight1
Copy link
Member

Nice work Neng!
Just a suggestion, would it be worth implementing something similar to the marker chain method? I.e. the material properties are taken at/close to the centre of the element (when degree = 0)? This would give us results to directly compare against and we know it works well in both mesh types

Thanks, Ben. Yes, and it can be done by setting the proxy_continuous as False. IndexSwarmVariable("M", swarm, indices=2, proxy_degree=0, proxy_continuous=False), which calculates the material property value at the centre points in cells.

Sth related to the marker chain method or level set method, I am thinking about: can we use some strategies like adaptive particle refinement in SPH (smoothed particle hydrodynamics see) method to improve the performance in the particle-in-cell method, as mesh elements inside the materials and far away from the interface between different materials do not need so many particles in them, and near the interface we need more particles to better "describe" the interface.

Nice one mate, good to know we can reproduce the MC method with the index swarm!

SPH looks interesting, will be keen to see what you come up with

@lmoresi
Copy link
Member

lmoresi commented Nov 13, 2024

I think the n-particles to nodes is consistent with what we do for our other mappings (eg. the evalf function). It might well be worth investigating other methods for mapping the properties but it would also make sense to use the existing PETSc functionality for this instead.

Not sure I understand your comments about Marker Chain, Ben. Would we be able to use the same strategy for a swarm that is restricted to the interface ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants