Cahn-Hilliard Problem

259 views
Skip to first unread message

Kubra Karayagiz (Alumni)

unread,
Jun 16, 2021, 2:21:40 PM6/16/21
to dea...@googlegroups.com
Hello all,

I am a new user of the deal.ii library and have been working on solving the Cahn-Hilliard problem with the following governing equations:

image.png


My main goal is to solve the problem with an implicit-explicit solver using a custom-designed preconditioner. Before diving deep into the implicit-explicit implementation, I first tried it with an explicit solver, which works fine. In that code, I computed the first derivative of the Gibbs free energy, fcV(c), within a for loop as shown below:

image.png

Next, I tried implementing the same problem using a function to compute the fcV(c) similar to the compute_nl_term() function from Step-25. However, I obtained different results in this case. Specifically, the concentration decreases as the simulation proceeds, which is not expected. Below, you can find the corresponding section from the second code with the compute_nl_term:

The compute_nl_term function definition:

image.png

The function is called within the run() function as below:

image.png

Could you please let me know if my understanding of the usage of this function is correct? (Note: the use of compute_nl_term() is necessary for the implicit-explicit implementation, due to the nonlinear functions)

Thanks in advance,

Best Regards,
Kubra Karayagiz





Wolfgang Bangerth

unread,
Jun 16, 2021, 7:33:10 PM6/16/21
to dea...@googlegroups.com
On 6/16/21 12:21 PM, Kubra Karayagiz (Alumni) wrote:
>
> Could you please let me know if my understanding of the usage of this function
> is correct? (Note: the use of compute_nl_term() is necessary for the
> implicit-explicit implementation, due to the nonlinear functions)

Kubra,
much debugging will be necessary to determine where the issue lies. I don't
think any of us will be able to tell just by looking at the code. Have you
tried a simple case first, say where you start with c=constant and see what
happens there?

Separately, the problem you are trying to solve has fourth spatial
derivatives. How do you deal with this?

Best
W.


--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Kubra Karayagiz (Alumni)

unread,
Jun 16, 2021, 8:30:30 PM6/16/21
to dea...@googlegroups.com
Prof. Bangerth,

Thank you for the prompt response.

On Wed, Jun 16, 2021 at 7:33 PM Wolfgang Bangerth <bang...@colostate.edu> wrote:
On 6/16/21 12:21 PM, Kubra Karayagiz (Alumni) wrote:
>
> Could you please let me know if my understanding of the usage of this function
> is correct? (Note: the use of compute_nl_term() is necessary for the
> implicit-explicit implementation, due to the nonlinear functions)

Kubra,
much debugging will be necessary to determine where the issue lies. I don't
think any of us will be able to tell just by looking at the code.
 
I totally understand that. I'll try to figure it out by myself.

Have you
tried a simple case first, say where you start with c=constant and see what
happens there?

I am sorry, I can't quite understand how it could be possible a case with c=constant, as it is the concentration variable that I am solving for. But, as I mentioned already my code works properly if I compute the function fcV(c) within a for loop.  (Based on comparisons with a benchmark study written in Prisms-PF software adopting deal.ii libraries).

Separately, the problem you are trying to solve has fourth spatial
derivatives. How do you deal with this?

To prevent fourth-order, I split the Cahn-Hilliard equation into two (Equations (1) and (2) below). I first solve for mu (chemical potential), then use its solution while solving for c (concentration). 

image.png

Thanks,
Kubra


Best
  W.


--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 bang...@colostate.edu
                            www: http://www.math.colostate.edu/~bangerth/

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/3391ca72-d1ca-dbb5-f35a-05185bd488aa%40colostate.edu.

Kubra Karayagiz (Alumni)

unread,
Jun 18, 2021, 2:40:17 PM6/18/21
to dea...@googlegroups.com
Hello all,

I've solved the problem. In the first approach (using a for loop to calculate fcV), I had to multiply the computed fcV with the mass matrix, following the below weak form:

image.png

However, we do not need such a multiplication, in the second approach as the assembly of the entire matrix M*F is already done in the compute_nl_term() function. Just wanted to share it in case someone else can also make the same mistake.

Best,
Kübra

Reply all
Reply to author
Forward
0 new messages