Page 1 of 1

Divergence of a gradient

Posted: Sat Aug 15, 2020 12:45 pm
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.

Re: Divergence of a gradient

Posted: Sun Aug 16, 2020 5:23 pm
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

Re: Divergence of a gradient

Posted: Sun Aug 16, 2020 6:03 pm
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.