Stiff 2D Transient Diffusion (Fick's 2nd Law) for UHPC and RC (Diffusion coefficient of 1e-12 m2/s) and positivity constraints #2087
|
Dear community, I am Luis, and I am currently working on my MSc thesis regarding UHPC and RC durability, and as a part of it, I need to calculate the resulting concentration field on a concrete section in 2D produced by concentration on the boundaries, provided by Dirichlet conditions. For this I am using PINNs to model the 2D concentration field, but I have run into some issues. I wonder if someone could give me some insights on this, I think I am facing "stiffness" in the PINN and convergence issues: I have explored two different approaches in DeepXDE, but neither has fully resolved the physics. Some common code cells are here. I am working on deepxde in Python: 1.- Hard PINNs: I have the following code for HPINNs. For the BCs and ICs, I have used an Ansatz like the following: And so when I use this code I find the BCs perfect, but inside the domain there is a localized valley that goes to a negative value at the bottom (always close to the boundaries of the BCs). The main issue with this code is that I need positivity, and I cant apply softplus (because if I apply it to the complete output transform, the model does not converge, especialy with LBFGS). And if I apply it only to y, the limits go from 0 to 1, to 0.62 and 1.32 coming from softplus, and this keeps the valley I mentioned, it moves from the negative value to 0.25). The BCs are test functions that we believe could be used as design parameters in concrete durability, so initially they were to be kept like this, but the results are so stiff that it is not viable. 2.- After finding the previous issues, I have switched to soft PINNs (to make use of strict positivity with softplus), and for this I have developed the following code. Since in this case I can use softplus, I have defined that: instead of 0 I am using a small epsilon (razonably inside the domains of Softplus). I also implemented adaptive weights and resampling of points, to help the training: In this case convergence is extremely slow. Despite normalization and adaptive techniques, the model struggles to "push" the concentration front into the domain (especially at the edges). The PDE residual remains orders of magnitude higher than the BC losses, and I don't know what else could I do to improve this. Possitivity is ensured, but the ICs and BCs are not within a satisfactory distance of the specified value. For now I have moved on with my thesis to the next steps. I understand that the problem of having values in a corner can be hard for PINNs to learn, and that is why I have put these functions so the values at each corner match with the functions on each edge. I am open ot any suggestion of anyone, I would be very grateful. Whether if the BCs are wrong, or any suggestion about how to implement positivity or any other are welcome!. |
Replies: 2 comments 3 replies
|
Hi @jimenezastorga1990-arch, The idea is to use a boundary-satisfying base function and multiply the trainable correction by a factor that vanishes on the boundary, so the network can modify only the interior solution without breaking the hard constraints. I would also recommend using layer-wise locally adaptive activation functions ( |
|
Thank you for your help, but if it was not too much, I would like to ask you something else. I was asked that instead of making the boundary conditions increase linearly with time, they should increase either by the square root of the time or even exponentially: def A(x): When I try to run this with the code you proposed, the concentration near the boundary at time equal to 0.1 (roughly ten years) presents a weird shape at the bottom right corner. And also I noticed that at somepoints inside the domain, the concentration is not close to 0 for some time steps (there are small hills like 0.02, but noticeable in a plot). If you could, I wanted to ask you if the following ideas I was thinking of couldd hep here:
I am already testing what you suggested, but if you might have another idea please let me know. I would be very grateful. :D |
Hi @jimenezastorga1990-arch,
you can try reformulating the hard boundary constraints as follows.