Simple flow problem comparison with Comsol

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
jgd23
Posts: 141
Joined: Mon Jun 06, 2016 10:00 am

Simple flow problem comparison with Comsol

Post by jgd23 »

Hello,

To compare a 3D laminar flow case, I calculate the same problem with CS and Comsol.
The geometry consist of a tube with 2 inlets ans one outlet.
It is strange to me that the velocity is not null on the boundary (BC=Wall) with CS. Maybe it is a problem of post processing with paravis I visualize only the fluid domain?

I join pictures.

Best regards

Julien
Attachments
CS_laminaire.png
comsol_laminaire.png
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Simple flow problem comparison with Comsol

Post by Yvan Fournier »

Hello,

Yes, the velocity that is visualized for Code_Saturne is actually the velocity at the cell centers adjacent to the boundary.

For scalars, we have recently added the possibility of visualizing boundary values on the surface mesh, but for velocity, we do not have this option yet.

Regards,

Yvan
jgd23
Posts: 141
Joined: Mon Jun 06, 2016 10:00 am

Re: Simple flow problem comparison with Comsol

Post by jgd23 »

Hello,

Thank you for your answer Yvan.

I am new in finite volumes calculation, I used to work with finite elements. I don't exactly if is due to the kind of element used or due to the code but it seems that the time stepping could be quite different.
My question is: why do you call a calculation to be "steady state" in Calculation features and let the user defines time stepping in Pseudo time step feature?
Meaning that if the user doesn't allow enough time to the calculation the steady state is never reach!

In Comsol, in steady state mode the code stop the calculation when the variation between 2 iterations is less than the tolerance.

So, how can the user in CS can make a steady state calculation and to be sure that there is no more change in function of time?

How can I fixe the minimum time step (the reference time step)?

Best regards

Julien
Luciano Garelli
Posts: 280
Joined: Fri Dec 04, 2015 1:42 pm

Re: Simple flow problem comparison with Comsol

Post by Luciano Garelli »

Hello,

Regarding your question about steady algorithm you can check the BPG (Best Practice Guidelines) http://code-saturne.org/cms/sites/defau ... meters.pdf where some guidelines about the use and requirements of the different schemes.

In order to check if the steady state was reached you can use monitoring point in several position in the domain like in the tutorial of the Shear driven cavity flow.

Regards

Luciano
jgd23
Posts: 141
Joined: Mon Jun 06, 2016 10:00 am

Re: Simple flow problem comparison with Comsol

Post by jgd23 »

Hello,

Thank you for your answer and the very interesting document. It's clearer for me now.

But I don't find the features describe in your document for the steady state:
"With the steady-state algorithm (IDTVAR=-1), convergence is generally reached within a few thousands iterations for “standard” cases; if this algorithm fails, one may select the time-marching algorithm instead with a time step variable in space and in time (IDTVAR=2)."

I read that it is possible to firstly compute the fluid flow and after use the results to compute the heat flux!
"Compute the dynamic variables first and deal with the temperature/scalars in a second stage on a frozen velocity/pressure field"

It's very interesting, how to do this? Is it possible to do this in the GUI?


Best regards

Julien
Luciano Garelli
Posts: 280
Joined: Fri Dec 04, 2015 1:42 pm

Re: Simple flow problem comparison with Comsol

Post by Luciano Garelli »

Hello,

In the practical user's guide of CS (http://code-saturne.org/cms/documentation) you can get a description of the different values of IDTVAR
IDTVAR = -1: steady algorithm
IDTVAR = 0: constant time step
IDTVAR = 1: time step constant in space but variable in time
IDTVAR = 2: variable time step in space and in time.

I never use a frozen field, but I think that you have to run the fluid dynamic until convergence first and then do a calculation restart selecting the checkpoint directory and picking the option "Calculation on frozen velocity and pressure field". This will solve only the equations for the scalars.

Regards,

Luciano
jgd23
Posts: 141
Joined: Mon Jun 06, 2016 10:00 am

Re: Simple flow problem comparison with Comsol

Post by jgd23 »

You are right, I can select a restart point and select also "calculation on frozen velocity and pressure fields". I will try to see if only temperature is computed now.

A new question please, when I set up the calculation control in steady state calculation, can I record intermediate solutions for n time steps?
For example, in Pseudo time step I define the maximum number of iterations = 100 and in the output control I select the log frequency to be Output every n time steps = 10. I was thinking that I can postprocess 9 intermediate files plus the final iteration but I have only the final...

Do you know how can I measure boundary fluxes to check energy balance ?

Best regards

Julien
Luciano Garelli
Posts: 280
Joined: Fri Dec 04, 2015 1:42 pm

Re: Simple flow problem comparison with Comsol

Post by Luciano Garelli »

Hello,

Yes, you can select the frequency of the output in the writer tab on "Output Control".

With respect to the energy balance you can define internal surfaces and integrate the variables or quantities, but also you can do during the post processing (this is what I did) in paravis/paraview. For example, you can do a slice near the inlets and outlets and the use the "integrate" filter to get the flow rate, average temperature and hence the energy. I hope that this help you.

Regards,

Luciano
jgd23
Posts: 141
Joined: Mon Jun 06, 2016 10:00 am

Re: Simple flow problem comparison with Comsol

Post by jgd23 »

Restart calculations seems to work correctly with only scalar computation, good news.

I try unsteady state but I can't record any intermediate files which can be open in paraview. Only info in the listing file.

Thank you for the tip for the heat flux, I think that there was some more automatic tools (and acccurate) for the boundaries fluxes. I want to use radiations in the future with Syrthes, I think that postprocessing in paraview won't be sufficient, what do you think? Maybe in Syrthes there is some tools to compute fluxes.
But thank you very much it helps a lot!

Best regards

Julien
Luciano Garelli
Posts: 280
Joined: Fri Dec 04, 2015 1:42 pm

Re: Simple flow problem comparison with Comsol

Post by Luciano Garelli »

Hello,

I attach a screenshot about where you can set the output frequency.
output.jpg
Regards,

Luciano
Post Reply