Modifying the corrosion_microgalvanic class

70 views
Skip to first unread message

Syed Ahmed Ali

unread,
Oct 19, 2024, 1:18:27 PM10/19/24
to PRISMS-PF Users
Hi everyone!

I'm a bit new to prisms-pf. I was wondering if the current model for micro galvanic corrosion can be modified to model for a ternary alloy, say Ti4Al6V. I went through the paper that was submitted to MRS Communications, and it represents corrosion between galvanic coupling of two phases of a Magnesium-Aluminum alloy. I was wondering if the same can be done for Ti4Al6V, with the electrolyte being a purely hydrogen environment. I actually wanted to work towards modelling hydrogen embrittlement, although I understand that it may require modelling for mechanical elements/fracture mechanics as well?

Any guidance on this would be highly appreciated!

Best,
Syed

David Montiel

unread,
Oct 19, 2024, 11:02:55 PM10/19/24
to Syed Ahmed Ali, PRISMS-PF Users
Hello, Syed

It would help if you could share a paper (or papers) that describes the model and the physics you would like to implement. 

For example, are you only interested in describing microgalvanic corrosion between two phases of the ternary alloy? 

Is solute transport within the anode or cathode something that affects the corrosion rate? 

Is the embrittlement occurring concurrently with corrosion?

Best,

David

--
You received this message because you are subscribed to the Google Groups "PRISMS-PF Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prisms-pf-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prisms-pf-users/00a38821-60fa-4115-8dc1-acb3350f099cn%40googlegroups.com.

Syed Ahmed Ali

unread,
Oct 24, 2024, 8:49:24 PM10/24/24
to PRISMS-PF Users
Hello Dr. Montiel,

I appreciate the reply you gave me privately on email. I have since decided to proceed with caution when considering anything in the realm of Prisms-Pf. For now, I wanted to know how to increase the number of seeds in the dendriticSolidification Model. 

The reason for switching to the dendriticSolidification model was that I was trying to understand how this model fits solidification as in Additive Manufacturing. I also tried to change parameters for the parameters.prm file, but, was met with a lot of different errors. Which is why, I am going step by step, and I think changing the number of seeds will be he most difficult part, which is why I am specifically asking help in this regard.

I also saw that one version of the source code on github features a model specifically on simulating additive manufacturing. I tried to run this model, but I was faced with a compiler error - some container had headers that were not updated in the code.

Any insights and comments on this would be highly appreciated. I know that my subject has since changed, so if you would like me to open another conversation, I would gladly do so!

Thanks for all your help.

Regards,
Syed

Syed Ahmed Ali

unread,
Oct 24, 2024, 10:01:43 PM10/24/24
to PRISMS-PF Users
A bit of an update regarding the things I wanted to understand:

1. I saw that the dendriticSolidification model uses nucleation.h, and nucleation.cc files. However, for nucleation.cc, there are 3 different files present within the master directory, so I'm confused which one the current model points to. I was also wondering if these files are explicitly not being placed within the current model's application folder, are they even being used?

2. Since Ti6Al4V has a hexagonal structure, I changed mult to 6.0. However, for the model constant D (which has been set to 1 by default), I am a  bit confused. Is this the thermal diffusivity of the material? If so, what are its units?

3. Lastly, speaking about units, I would also like to know what the grid units are. I currently see a 500 x 500 grid, but I am uncertain about the units. Is it in micrometers? If so, I would have to adjust the thermal diffusivity accordingly right? Also, is it possible to increase the grid size, and as per my previous question, can multiple seeds be added?

I am also a bit confused as to what exactly I am seeing here. I think I see a single grain growing, and forming a dendritic structure. Is this true?

Thanks in advance for your help.

Best,
Syed

David Montiel

unread,
Oct 25, 2024, 11:45:01 AM10/25/24
to Syed Ahmed Ali, PRISMS-PF Users
Hello, Syed

I am away this week and with limited connectivity but I will try to reply later today.

Best regards,

David

Syed Ahmed Ali

unread,
Oct 25, 2024, 12:58:16 PM10/25/24
to PRISMS-PF Users
Thank you Dr. Montiel. I will wait for your response.

David Montiel

unread,
Oct 26, 2024, 3:46:17 PM10/26/24
to Syed Ahmed Ali, PRISMS-PF Users
Hello, Syed

Please see my inline replies below.

Best,

David

On Thu, Oct 24, 2024 at 8:02 PM Syed Ahmed Ali <asyeda...@gmail.com> wrote:
A bit of an update regarding the things I wanted to understand:

1. I saw that the dendriticSolidification model uses nucleation.h, and nucleation.cc files. However, for nucleation.cc, there are 3 different files present within the master directory, so I'm confused which one the current model points to. I was also wondering if these files are explicitly not being placed within the current model's application folder, are they even being used?

I am confused about this.  There are no files called "nucleation" in the dendriticSolidification app, and in fact the app does not use the nucleation functionality. I would recommend looking into the application nucleationModel, for an example into how nucleation is implemented.

2. Since Ti6Al4V has a hexagonal structure, I changed mult to 6.0. However, for the model constant D (which has been set to 1 by default), I am a  bit confused. Is this the thermal diffusivity of the material? If so, what are its units?

Yes, D is thermal diffusivity. The application is based on the PFHub Benchmark problem 3, which is formulated without units, even though the values for all the constants are not all the same. For an application of the same model with units, I would recommend checking out this paper by Karma and Rappel.

3. Lastly, speaking about units, I would also like to know what the grid units are. I currently see a 500 x 500 grid, but I am uncertain about the units. Is it in micrometers? If so, I would have to adjust the thermal diffusivity accordingly right? Also, is it possible to increase the grid size, and as per my previous question, can multiple seeds be added?

See above. 

I am also a bit confused as to what exactly I am seeing here. I think I see a single grain growing, and forming a dendritic structure. Is this true?

Yes, that is true.
 

Syed Ahmed Ali

unread,
Oct 26, 2024, 4:23:55 PM10/26/24
to PRISMS-PF Users
Dear Dr. Montiel,

Thank you for your valuable insights.

I will go through the paper which mentions the use of units.

However, I have shifted my focus back to the corrosion and corrosion_microgalvanic applications. I would like to apologize deeply for this shift of focus. From now on, I will only ask questions about these classes, and in particular how to use these apps to model corrosion dynamics for HSLA steels. I have finalized my thesis topic too, which is ''A Phase-field Model based on PRISMS-PF to Compute and Visualize Microstructural Evolution during Anodic and Microgalvanic Corrosion in High-Strength Low-Alloy (HSLA) Steel''. The reason for choosing HSLA was its obvious relevance in industry. I tried to change the parameters for the corrosion models, however, I was getting two errors:

1. ERROR: field 'irxn' solution is NAN. exiting.
2.  Warning: linear solver did not converge as per set tolerances. Consider increasing the maximum number of iterations or decreasing the solver tolerance. ERROR: field 'Phi' solution is NAN. exiting.

Again, I think this has to do with the use of dimensionless parameters. I tried to change these, but I think I require more details on the non-dimensionalization process, and how to model for specific material properties. I believe this should be the end goal.

I am currently in the process of drafting my proposal. I see that corrosion.pdf mentions the paper from where the phase-field model is based, and I am guessing that your paper that was submitted to MRS Communications details the use of the dimensions for the corrosion_microgalvanic application. I will read through these papers, and other existing literature I find relevant. I will get back to you if I have any other problems, or need advice on anything.

I would also like to thank you again for replying to my messages, even when you're away!

Best,
Syed

David Montiel

unread,
Oct 27, 2024, 12:16:56 AM10/27/24
to Syed Ahmed Ali, PRISMS-PF Users
Hello, Syed

If you tell me specifically what parameters you changed (and to which values) I may be able to figure out why you are getting the error. 

The error you are describing is typically due to a numerical instability often associated with using a time step that is too large (although there can be other reasons). 

Best regards,

David

Syed Ahmed Ali

unread,
Oct 27, 2024, 12:28:45 AM10/27/24
to PRISMS-PF Users
Hi Dr. Montiel,


I made the following changes to parameters.prm, for the corrosion app:

VMV = 7.09e-6
zMV = 2.0
DMV = 1.0e-9
cMsatV = 500.0
icorrV = 1.0e-3
EcorrV = -0.44
VsV = -0.44
betaV = 0.5
TV = 298.15
epssqV = 4.0e-14
rad0 = 1.0e-7
DPV = 1.33e-9
DnV = 2.03e-9
zPV = 1.0
znV = -1.0  

to model for corrosion of steels

Regards,
Syed

David Montiel

unread,
Oct 28, 2024, 10:18:10 PM10/28/24
to Syed Ahmed Ali, PRISMS-PF Users
Hello, Syed

I have not been able to look into this but I will be back at work on Wednesday and look into your issue first thing in the morning.

David 

David Montiel

unread,
Oct 30, 2024, 12:01:02 PM10/30/24
to Syed Ahmed Ali, PRISMS-PF Users
Hello, Syed

A couple of points of clarification

1) Unlike dendriticSolidification, which uses dimensionless parameters, both the corrosion and corrosion microgalvanic application use constants in SI units (m, kg, s, etc). 

2) The parameters of the metal in the corrosion app are for 304 stainless steel (see Chadwick et al., J. Electrochem. Soc.,10, C633-C646 (2018)). 

I noticed that you increased the diffusivity of the ions in the electrolyte by about an order of magnitude. This may have an effect on the largest possible time step you can use. Did you try decreasing the time step?

One thing that I would advise (particularly for the corrosion application) is to not change all default parameters at once, because it is then hard to spot what may be leading to the instability. 

Finally, I noticed you decreased the initial pit radius to a value that can probably not be resolved within the simulation. Is there a reason behind this?

Best,

David

Syed Ahmed Ali

unread,
Dec 9, 2024, 9:32:33 AM12/9/24
to PRISMS-PF Users
Hi Dr. Montiel,

I am still struggling to modify the parameters for both the corrosion and microgalvanic corrosion applications to model for HSLA steels. Another issue that is arising is deciding how to compare outputs to real world experiments. While Chadwick et. al compares the model to experiments carried out in Ernst and R. C. Newman, Corros. Sci., 44, 927 (2002), the paper submitted by Goel et. al (your paper, MRS communications), does not compare the results, specified by this line here: "Detailed analyses of these results, as well as an expanded parametric study to develop a quantitative understanding of the effect of microstructure on microgalvanic corrosion in Mg alloys, are beyond the scope of this paper and will be left for a future publication."

Does this mean that for the microgalvanic corrosion model, there is no way to compare the results to real-world studies, and thus, it is purely an ''approach''?

Best regards,
Syed

David Montiel

unread,
Dec 12, 2024, 9:16:31 PM12/12/24
to Syed Ahmed Ali, PRISMS-PF Users
Hello, Syed

Sorry for the late reply.

The following microgalvanic corrosion papers

Simulating microgalvanic corrosion in alloys using the PRISMS phase-field framework 
focus on the PRISMS-PF application for microgalvanic corrosion and its use to conduct a parametric study, i.e., investigate the effect of different physical parameters in the corrosion rate. But as you point out, we do not perform a direct comparison with experiments. 

However, I would be glad to give some guidance on the parameterization of the model with experimental data to simulate the scenario you are interested in. 

I think perhaps it would be more convenient to discuss this over a Zoom meeting. 

If you would like to meet, please send me your availability for next week to: dmon...@umich.edu

Best,

David


Syed Ahmed Ali

unread,
Dec 13, 2024, 3:35:16 AM12/13/24
to PRISMS-PF Users
Hi Dr. Montiel,

I sent you an email with my availability. Thanks!

Best Regards,
Syed

Syed Ahmed Ali

unread,
Dec 21, 2024, 5:53:16 PM12/21/24
to PRISMS-PF Users
Hi Dr. Montiel,

Just a short question: the corrosion model by Chadwick features 2 models - the mono-crystalline model, and the poly-crystalline model. Is the same done in the PRISMS code too? I can only see the results from the mono-crystalline model, so I'm assuming some changes would be required to run for the poly-crystalline one. If this is correct, how could I do this?

Best,
Syed

David Montiel

unread,
Dec 23, 2024, 5:35:49 PM12/23/24
to Syed Ahmed Ali, PRISMS-PF Users
Hello, Syad

We have a simplified version of the polycrystalline model, but it has not yet been released. 

In principle, all you have to do to modify it is include additional order parameters to represent every grain of the microstructure, along with governing equations for these order parameters.

In fact, the equations of the Chadwich paper apply to the polycrystalline case in general. 

In addition, you can initialize the microstructure in the way that is done for the grainGrowth or grainGrowth_dream3d apps. 

Let me know if you have any other questions about the details. I will be glad to help with the implementation.

Best,

David



Syed Ahmed Ali

unread,
Dec 28, 2024, 8:16:04 AM12/28/24
to PRISMS-PF Users
Hi Dr. Montiel,

I tried to do this, however, I'm encountering a lot of different issues. I tried a lot of different approaches to model multiple grains. My question at this point is, will I have to also change the original header files to handle the polycrystalline morphology, such as userInputParameters.h/.cc? Or can this be done without modifying these files?

Best,
Syed

Syed Ahmed Ali

unread,
Dec 29, 2024, 9:26:04 AM12/29/24
to PRISMS-PF Users
Hi Dr. Montiel,

A more recent attempt of mine looked something like this (I will be focusing on the 4 main files within the corrosion app):

This program compiled successfully, without any major warnings, however, the solution was blowing up, even after reducing the time step to e-10. I suspect there is either some contradictory logic or contradictory parameter values I am using, however, I cannot pinpoint it. If you see the files attached, you will notice that I keep the appended code quite close to the original code, just to avoid any sort of errors.

Any help on this would be greatly appreciated.

Best,
Syed
ICs_and_BCs.cc
equations.cc
customPDE.h
parameters.prm

David Montiel

unread,
Dec 29, 2024, 11:02:51 AM12/29/24
to Syed Ahmed Ali, PRISMS-PF Users
Hello, Syed

I thank you for sending the code. Regarding your previous email, you do not need to modify userInputParameters.h/.cc. 

Right now I am on vacation until January the 2nd but if I have some time this week, I will look at your files and get back to you. Can I ask what version of PRISMS-PF you are using?

David

Syed Ahmed Ali

unread,
Dec 29, 2024, 11:05:42 AM12/29/24
to PRISMS-PF Users
Hi Dr. Montiel,

I am using the current master branch on GitHub. Do you recommend using another version such as 2.4?

I will wait for your reply on the 2nd of January. Happy holidays!

Best,
Syed

David Montiel

unread,
Dec 29, 2024, 11:10:14 AM12/29/24
to Syed Ahmed Ali, PRISMS-PF Users
Hello, Syed

The current version is fine. I just wanted to know. 

David

Syed Ahmed Ali

unread,
Jan 1, 2025, 3:51:29 PMJan 1
to PRISMS-PF Users
Hi Dr. Montiel,

I have another question with respect to this: Chadwicks paper simulates for T = 60 seconds for the monocrystalline model, while the parameters in the corrosion app are set so to model for 1 second in total (# of time steps x time of one step). Is this correct? Also, I'm not too entirely sure about the domain that Chadwick is using. For example, he mentions 102.4 μm × 51.2 μm (which would make us change the parameters, since PRISMS does it 12.8 μm x 6.4 μm), however, in the graphs for pit depth, which in the 2D problem is measured essentially in the y-direction, he plots for a pit depth of 150 μm, which is out from this domain.

This is obviously causing confusion, so help on this would be appreciated!

Best,
Syed

David Montiel

unread,
Jan 2, 2025, 8:04:07 PMJan 2
to Syed Ahmed Ali, PRISMS-PF Users
Hello, Syed

I had to take care of a few urgent things today but I will reply to your questions and have a look at your code files tomorrow.

Happy new year!

David

Reply all
Reply to author
Forward
0 new messages