Question about grdcel function

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
N.Paris

Question about grdcel function

Post by N.Paris »

Hello,

I'm a new user of Code Saturne and i have a question about the grdcel function, i know there is a lot of post about that in the forum but it didnt solve my problem. So could you explain to me how this function is used ?
Here is what i do for now, i'd like to compute the grad of a new variable, let's say sqrt(k), so i use the grdcel function :

call grdcel &
!==========
( ivar , imrgra , inc , iccocg , nswrgp , imligp , &
iwarnp , nfecra , epsrgp , climgp , extrap , &
pvar , coefa, coefb , &
grad )

- So first, it looks like ivar can be set to zero ?

- Coefa and Coefb are boundary conditions for my sqrt(k) ? Hence zero in my case.

- pvar is the value of my variable for the first element ? Let's say sqrtk(1) where sqrtk(iel) the value of sqrt(k) at the element iel. But why does the file grdcel.f90 says "variable (pression)" for pvar ?

- The grad will be compute and i can acess it with :
grad(iel, 1) = dsqrt(k)/dx
grad(iel, 2) = dsqrt(k)/dy
gradk(iel, 3) = dsqrt(k)/dz
Is that correct ?

- Does this function can be used for every scalar ?

- In order to understand how it works, i tried to compute by myself the value of grad(Rij) in the resrij subroutine (where this grad is already computed). But even if i set
test(iel) = rtpa(iel, ivar)
and i compute the grad of test(iel) with same parameters, i can't find the correct result... Do you know why ?

Thank you,
Regards
Post Reply