Gradient of user computed field

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
ArnauMiro
Posts: 6
Joined: Wed Jun 01, 2016 8:57 am

Gradient of user computed field

Post by ArnauMiro »

Hello,

I have a field I have computed in the subroutine usvpst. I would like to perform the gradient of such field. However, the field_gradient_scalar and the field_gradient_vector subroutines require a field ID to be inputed (instead of the values of the field). I have seen that user defined fields can be created but as far as I know they are transported, which I don't want. Just to compute the field in usvpst, perform the gradient and save it.

Is there a way to perform such operation?

Thanks for your help.

Kind regards,
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: Gradient of user computed field

Post by Yvan Fournier »

Hello,

For fields that do not represent resolved variables, the only solution for this is to use the "low level" functions, for which you need to define variable condition arrays...

Check src/alge/cs_gradient.h in the sources, or the Doxyhen documentation (not sure how far it goes into details) for examples.

Regards,

Yvan
ArnauMiro
Posts: 6
Joined: Wed Jun 01, 2016 8:57 am

Re: Gradient of user computed field

Post by ArnauMiro »

Hello Yvan,

Thanks for your quick reply. I've taken a look at the cs_gradients.h file and it seems complicated to implement...

For the moment, I think I will use Paraview's filter implementation.

Thanks for your help.
Post Reply