adding drift velocity to scalar

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
daniele
Posts: 158
Joined: Wed Feb 01, 2017 11:42 am

adding drift velocity to scalar

Post by daniele »

Hello,

I would like to add a drift velocity to a scalar field I am solving.
After having looked at the documentation and examples, it is not clear for me the exact way to do that.

1) First, in the cs_user_parameters.f90 I have to activate the relative flag. Is the following the right way (considering that I do not want to take into account thermophoresis and other diffusivities, just add a drift velocity to the main velocity) to do that?

call field_get_key_id("drift_scalar_model", keydri)
if (nscaus.ge.1) then
iscdri = 1
iscdri = ibset(iscdri, DRIFT_SCALAR_ADD_DRIFT_FLUX)
iscal = 1
f_id = ivarfl(isca(iscal))
! Set the key word "drift_scalar_model" into the field structure
call field_set_key_int(f_id, keydri, iscdri)
endif


(but still, I do not understand where I have to set "drift_scalar_model">0)


2) Then, in order to specify the value of the drift velocity, do I have to use the driflu.f90 routine?

Many thanks in advance.

Best regards,

daniele
daniele
Posts: 158
Joined: Wed Feb 01, 2017 11:42 am

Re: adding drift velocity to scalar

Post by daniele »

Dear all,

I am still stuck with drift velocity definition for scalars.

I activated all the required flags in the cs_user_parameters.f90.
The drift velocity vector is available in the post treatment variables, which confirms that drift has been activated.

Nevertheless, how do I specifiy the drift velocity vector???
I tried the driflu.f90 routine, but it does not seem to be the right way, since only a scalar drift mass flux can be defined through this routine...

Could anybody tell me how to define the three composants of the drift velocity vector?

Thanks a lot in advance.

Regards,

Daniele
Post Reply