Skip to content

Update Schulz Method#77

Draft
tmweigand wants to merge 3 commits intomainfrom
drainage_img_updates
Draft

Update Schulz Method#77
tmweigand wants to merge 3 commits intomainfrom
drainage_img_updates

Conversation

@tmweigand
Copy link
Copy Markdown
Owner

As to #74, the drainage algorithm has been modified so the Schulz algorithm operates on the fully saturated system for each given capillary pressure.

@kbruning also mentioned we were using a different reference. I am going to go through that and make sure this all makes sense as it doesnt currently.

@kbruning
Copy link
Copy Markdown
Collaborator

Results are qualitatively looking good. I will do comparison runs to the analytic solutions.

@tmweigand
Copy link
Copy Markdown
Owner Author

Great. I just pushed another commit to allow for the generation of an elliptical inkbottle addressing the second part of #74 . This is based of your previous example where r_y and r_z are used to scale inkbottle. See examples/drainage_inkbottle.py. Here is the function for reference:

r = (0.01*cos(0.01*x[i]) + 0.5*sin(x[i]) + 0.75)
ry = r*r_y
rz = r*r_z
if y[j]*y[j]/(ry*ry) + z[k]*z[k]/(rz*rz) <= 1:
    _grid[i,j,k] = 1

@tmweigand
Copy link
Copy Markdown
Owner Author

I also went through the correct paper and all seems good. Their modifications are only to include the contact angle when determining the probe radius. They also state they use a distance transform instead of morphological operators but those yield identical results and the hybrid approach in pmmoto is typically more efficient from the profiling we have done.

@tmweigand tmweigand marked this pull request as draft May 23, 2025 23:58
@tmweigand tmweigand force-pushed the drainage_img_updates branch from d202d0a to d2fc7b3 Compare May 29, 2025 23:41
… in Schulz method and breaks into the two approaches
@tmweigand
Copy link
Copy Markdown
Owner Author

tmweigand commented May 30, 2025

@kbruning okay. So there was a bug in the "contact_angle" method. In the 2015 paper, Schulz uses a different radius for the erosion and dilation step of the algorithm. This is not part of the 2007 paper and I have removed it from the "contact_angle" method. They have some fine print about the 2015 algorithm ("extended_contact_angle") that I would need to read more into if you would also like this approach implemented correctly.

All methods are identical if the contact angle is set to 0. Happy to chat tomorrow.

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.

2 participants