How can I add/modify 'artificial viscosity' in a volume zone ?

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

How can I add/modify 'artificial viscosity' in a volume zone ?

Post by Cbarnaud »

Hello all,

I didn't find a subject on this topic in the forum so I created this one.
I have an internal flow case where I would like to slow down a flow jet entering in a cavity.
I would like to increase the viscosity in a delimited zone up to the jet dissipate to simulate the entry of the jet in a more viscous zone. The fact is I tried head loss volume condition but my case diverges each time I tried, no matter the coefficients are.
I use fast chemistry combustion and standard k-eps in the simulation, maybe there's the heart of the problem and it's incompatible with the head loss condition.

So currently I choose to modify the code and I would like to add more viscosity in the molecular viscosity, like a scale between X1 to X100 in a zone.
Is someone has and idea where to do this in the source code? I'm lost with the structure, I don't understand where is exactly calculated the molecular viscosity.

Thank you all,
Cbarnaud.
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: How can I add/modify 'artificial viscosity' in a volume zone ?

Post by Yvan Fournier »

Hello,

You can simply modify the molecular viscosity by defining it as "user defined" in the GUI, and assigning an appropriate "MEI" expression to that. If that does not leave enough control, you can switch to user-defined functions (cs_user_physical_properties), of which you have several examples in the Doxygen documentation.

Turbulent viscosity probably has a higher influence than molecular viscosity, though...

Regards,

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

Re: How can I add/modify 'artificial viscosity' in a volume zone ?

Post by Cbarnaud »

Hello,

Thank you very much for your answer.
I thought it was more difficult because I failed to do this before. I just used the wrong method/function.
I'll try this soon and give feedback with my modifications if it can help someone else.

Thank you again,
Regards
Camille

Edit: actually I can't use GUI to modify the law/formula, I can't add variables such as 'temperature' as in the given examples. I get an error 'First use in this function'. I think this bug will be fixed in the next update, I just wanted to report it.
Cbarnaud
Posts: 36
Joined: Tue Oct 22, 2019 10:28 am

Re: How can I add/modify 'artificial viscosity' in a volume zone ?

Post by Cbarnaud »

Hello,

I just share my cs_user_physical_properties.f90 file, if it can help someone in the future.

Best regards,
Camille B.
Attachments
cs_user_physical_properties.f90
(12.46 KiB) Downloaded 156 times
Post Reply