Divergence of a gradient

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Cbarnaud
Posts: 36
Joined: Tue Oct 22, 2019 10:28 am

Divergence of a gradient

Post by Cbarnaud »

Hello,

I could like to compute scalar Laplacian, so a divergence of a gradient of a scalar field (div(grad(X))).
I found a way to compute the gradient with field_gradient_scalar subroutine.
But I can't found the way to compute a divergence or directly a laplacian.
Is there someone who can give me tips about it?

Best regards
Camille Barnaud.
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Divergence of a gradient

Post by Yvan Fournier »

Hello,

In the sources, in src/alge, you will find some functions that may help in cs_divergence.c/h.

You may see how it is used for example in src/turb/cs_les_balance.c. (which also includes a _les_balance_laplacian function).

Hoping it helps. I am not an expert in those parts of the code (I simply have an idea of what to search for using "grep").

Best regards,

Yvan
Cbarnaud
Posts: 36
Joined: Tue Oct 22, 2019 10:28 am

Re: Divergence of a gradient

Post by Cbarnaud »

Hello,
Thank you for your answer.
I'm sorry but the file src/turb/cs_les_balance.c doesn't exist on my version (CS 6.0.0), so neither the laplacian function.
I used the grep tip and I got the file cs_divergence.c/h too but the use of theses functions didn't fit my needs (if I trust Doxygen's documentation).

Thank you for trying to help me, I will find another way to compute my equation.

Best regards,
Camille Barnaud.
Post Reply