CS ver 6.0 - Homogeneus Eulerian - VoF model: Fluid properties varying with temperature

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Almat
Posts: 8
Joined: Mon Jun 25, 2018 10:20 am

CS ver 6.0 - Homogeneus Eulerian - VoF model: Fluid properties varying with temperature

Post by Almat »

Hi everyone,

Using CS version: 6.0
OS: Ubuntu 18.04

first of all many thanks to EDF and its kind working group for this new CS awesome version, hope Your good job will go further and further.

My questions concern the managing of fluids properties in the "Homogeneus Eulerian - VoF model" flow model.

1] imposing functional dependence from temperature for density and viscosity.
Looking in the GUI at the "Fluid properties" section, only constant values for both fluids are allowed and deactivated "linear mixture law" buttons appear for both. Is there a way to impose a user law function for these quantities via the GUI?

I was wondering if it is possible to use user subroutine "cs_user_physical_properties.f90" for that but I'm failing in finding variables and/or associated examples in both guide docs and doxygen documentation. In the latter I found some reference according to the cs_vof_parameters_t structure, but I'm here now as a not very expert coder. Does anyone has a little piece of code to start with?

2] assigning specific heat and thermal conductivity properties to both fluid1 and fluid2.
In the GUI it is possible only to specify one cp and lambda values/functions, but fluids are two. How does CS treats that?
Does by the formula editor (accessible here) is possible to write a cp and lambda functions imposing transition from fluid1 to fluid2 through the void fraction value?


Any suggestion, if any, is appreciated.
Thanks

Alessandro
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: CS ver 6.0 - Homogeneus Eulerian - VoF model: Fluid properties varying with temperature

Post by Yvan Fournier »

Hello,

I'll try to answer, but I'll ask a colleague who actually worked on this to check or complete this post...

1) I assume they are greyed-out specifically in the VOF case for safety, because the way the GUI handles this is not quite adapted. A user-subroutine would probably have better chances of working (unless there is a more fundamental issue in Vof I am not aware of).

In this case, you need to indicate the property is variable in cs_user_parameters.f90 (as the GUI won't let you do it) setting irovar = 1 and ivivar = 1 (or cs_glob_fluid_properties->irovar and in cs_user_parameters.c).
Then use cs_user_physical_properties.c. If you need values from a given variable/field, check for cs_field_by_name in various other user examples (grep is your friend) for access.

2) For scalars, you can already assign specific diffusivites. But in your case, where you have 2 fluids, I am not sure. code_saturne inherently uses a 1-fluid model, where multiple fluids are handled as mixtures, for which rho and lambda are mixture properties. So using the volume of fluid to determine your mixture and working with that is probably simpler.

I'll check if a colleague can provide more details...

Best regards,

Yvan
Almat
Posts: 8
Joined: Mon Jun 25, 2018 10:20 am

Re: CS ver 6.0 - Homogeneus Eulerian - VoF model: Fluid properties varying with temperature

Post by Almat »

Hi Yvan,

thanks for Your suggestions. Ok I'll try this way for 1] and wait for any hint, if any, for 2].

Best regards,

Alessandro
Almat
Posts: 8
Joined: Mon Jun 25, 2018 10:20 am

Re: CS ver 6.0 - Homogeneus Eulerian - VoF model: Fluid properties varying with temperature

Post by Almat »

Hello,

after some checks here is what is in my understanding, hope it will be of some help:

- "irovar" and "ivivar" variables are set to 1 by default when the VoF flow model is selected in the GUI;

- density and viscosity temperature (or any other variable) dependencies cannot be changed using "cs_user_physical_properties.c". Maybe this occurs because the vof subroutine (i.e. cs_vof.c) sets itself the values for both the properties (using the constant values from the GUI) and it is called after "cs_user_physical_properties.c" overwriting the introduced user expressions, hence the latter are to be introduced directly in the "cs_vof.c" subroutine, after placing it in the src folder, as usual

- specific heat and thermal conductivity properties are treated without accounting for the fraction of volume variable and the two fluids share the same value or user-expressions introduced in the GUI. For these properties, use of specific expressions in "cs_user_physical_properties.c" is allowed and work normally.

In this way everything works fine for me, but any comment is welcomed.
Best regards,

Alessandro
Erwan Le Coupanec
Posts: 45
Joined: Sun Sep 08, 2013 8:50 pm

Re: CS ver 6.0 - Homogeneus Eulerian - VoF model: Fluid properties varying with temperature

Post by Erwan Le Coupanec »

Hello Alessandro,

Sorry for the late answer.

In the VoF model, as implemented in CS, the assumption that density varies linearly with the void fraction is used to derive the void fraction equation from mass balance and mass balance itself is solved under its incompressible form i.e.:

div( \vect{u} )= 0

By modifying the way density is updated, you're most likely breaking mass conservation law.

The base model is actually described in the theory guide of CS v6.0, under the "cavitation modelling" section (just remove the vaporisation-condensation source term to get the VoF base model).

If I may ask, what kind of free surface are you trying to simulate ?

Cheers,
Erwan
Almat
Posts: 8
Joined: Mon Jun 25, 2018 10:20 am

Re: CS ver 6.0 - Homogeneus Eulerian - VoF model: Fluid properties varying with temperature

Post by Almat »

Hi Erwan,
thanks for your answer, no matter for the time :)

I was wondering if at this stage of development CS could be accurate enough to model injection moulding processes.

Indeed, we can see that many models for the viscous behaviour of an injected material (e.g. CRoss-WLF Model) depend on both temperature and shear rate, thus the need to explore CS capabilities for that.

It was already in my knowledge that the vof solver was implemented as incompressible (even if I didn't know that was practically the same as the cavitation model, I will take a look there, thanx), so the attempt was for testing an approach where despite minor errors in preserving continuity (and fluids densities derivatives) we could take into consideration the temperature dependence for viscosity that is quite relevant.

I thought, but still not checked, that in such a problem (according to low fluid injection velocities and not very high heat exchange coefficients at boundaries) maybe solutions could be reasonable anyway, but is merely an attempt, this is why I'm still looking for a good test-case for validating results.

I've setup a simple filling model to explore such an approach, maybe if you have any other suggestion or comment on that issue I could open another post naming it ad-hoc and share the case for checking some (working or better) solution.

Thank you,
regards

Alessandro
Post Reply