ENH: Workspace integration#39
Conversation
- Ordering handling is now special cased for Scheil since it's difficult to use eq_results - Equilibrium is updated to use Workspace at a high level, but still falls back on xarray Dataset objects for most the work
…istent by default
d107924 to
1e88aca
Compare
|
@Chuangye-Wang @sorkins I think I'm happy with Workspace support here in general. The latest commit adds notional support to demo the custom property use case. The idea is that you can pass anything that works for PyCalphad Workspace to sol_res = simulate_scheil_solidification(dbf, comps, phases, initial_composition, start_temperature, step_temperature=20.0, verbose=True, output=["HM", "CPM", "NP(LIQUID)"])These properties give the properties of the state of the properties are for 1 mole of solidifying liquid values at any instant in the simulation (that is, we don't account for the properties of the previously solidified solid at all or the remaining amount of liquid). This is conceptually the same thing that happens in the implementation of #38, i.e. leaving it all up to the user. I'm a little hesitant to not account for the simulation's sense of how much liquid remains and the properties of the frozen-in solid, since that's what the equilibrium picture would look like if we took the same kind of approach there. I don't like the idea that equilibrium and Scheil solidification simulations give different physical pictures of the properties. But I'm open to the idea of deferring on supporting the equilibrium solidification support for now until we reconcile handling the Scheil case better. Does this approach serve your use case? I'm curious on how you're addressing handling the properties of the frozen-in solid if that's relevant for your use case. Happy to accept feedback in general. |
|
Thanks so much for the work here @bocklund! We'll test things out with this branch ASAP and give some feedback. We'll think on the frozen-in solid question, it's nothing too complex so I'm sure it wouldn't be a problem to share some details. |
|
@bocklund Thanks for this nice implementation! I tried to use this branch to get solidified fraction during solidification, but the results turned out to be different from the branch I made. I got a lot of duplicated values for the fraction_solid in the scheil's results. I tried to debug a bit, and found multiplicity_aware_stable_phases only include liquid phase from the fourth iteration, which leads to the duplication. Could you help to identify the root cause for this issue? I used alloy Fe-0.3Cr-0.02C in mole fraction. Sorry I cannot provide our internal database for you to debug. If you need I provide a test case to debug, I will try to make one for you.
|
|
@bocklund I created an example for you to test on.
|
|
@bocklund reminder |
Apologies, I've been swamped recently. Thank you for the test, it helps a lot debugging this stuff. I just want to verify that the expected behavior of the test is that it passes (it does for me), but you see that there are duplicated values in the fraction of solid? I am able to reproduce that behavior (test passes, but has duplicated fraction liquid/solid values) |
|
@bocklund Correct. It passes but the results contain a lot of duplicated values. |
|
@bocklund reminder on this when you have the time. If there's anything you can point us at to help figure this out, please let us know! |
|
@bocklund reminder, no rush. |
|
@bocklund Thanks a lot! I will test and let you know next week. |
|
Great, I'll try to make any last polishing changes and try to get it merged and a new release out 😄 Thanks for your patience through my busy summer. |







This branch only has WIP changes for directly using
Workspaceinsimulate_scheil_solidificationOutstanding TODO items:
Workspacesimulate_equilibrium_solidificationtoWorkspaceoutputkeyword argument (analogous to PyCalphadequilibriumoutput)? See Add options to save equilibrium results during scheil simulation #38. Also would want to export the properties to theSolidificationResultobject API.