Axail fan modelling usin cs_fan.h

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Luciano Garelli
Posts: 280
Joined: Fri Dec 04, 2015 1:42 pm

Re: Axail fan modelling usin cs_fan.h

Post by Luciano Garelli »

Hello,

Some time ago I was working with other CFD software in a simulation with fan, so it is very interesting for me too.

I was following the comments of Yvan, I added the "cs_fan.c" to my 4.2.1 version and also have to add "cs_math.c" and "cs_math.h" because the functions cs_math_3_cross_product() and cs_math_3_norm() where not defined. Also I have to comment a pair of lines in cs_fan.c where is used

Code: Select all

cell_fan_id 
, may be this is a problem of my version.

Code: Select all

/* Store the cell_fan_id in the postprocessing field */
  // cs_field_t *fans_ids = cs_field_by_name("fans_ids");
  //for (cs_lnum_t cell_id = 0; cell_id < n_ext_cells; cell_id++)
  // fans_ids->val[cell_id] = (cs_real_t)cell_fan_id[cell_id];
After that I have run a simple example ( A box with a fan inside) with your parameters. First of all I check your pressure curve and it has negative value of pressure, maybe there is a problem with the reference pressure. In general the curves are like this
Fan-Curve.jpg
I have run the example (no turbulence model) with your curve and with the used in the template of cs_user_parameters-fan.c without problem. I don't understand very well the definition of "axial_torque" but it is a relation between the axial and radial velocities.
Velocity_1.jpg
If you want I can upload the case

Regards.
Yvan Fournier
Posts: 4069
Joined: Mon Feb 20, 2012 3:25 pm

Re: Axail fan modelling usin cs_fan.h

Post by Yvan Fournier »

Hello,

This seems interesting.

Just a note regarding the documentation (or lack thereof). The fan model was implemented and documented in an older code, and the model was recently added to Code_Saturne, but not documented yet. This documentation should be added to the code in the next few months, so tit should be either in version 4.3 (this summer), or 5.0 (next year, with a feature freeze around november).

The curves in our documentation are similar to the ones you posted, but I don't have them here (only have access to the documentation system from the office, and have not made a local copy of this document), so I can't tell right now if the representation is exactly the same, but it should ba at worse quite similar.

From memory, axial torque is an optional model parameter accounting for the fact that the rotation of the fans adds a rotation term to the flow (i.e. in a virtual "tube" containing the fan, the flow has a spiral, not straight movement).

Regards,

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

Re: Axail fan modelling usin cs_fan.h

Post by Luciano Garelli »

Hello,

I suspected that the axial torque has the influence that you mention.

Wth respect to the pressure curve, is a function of volumetric flow rate or velocity, because I dont understand what means with flow in th doxygen doc.

Regards

Luciano
jb_l
Posts: 31
Joined: Wed Aug 26, 2015 4:49 pm

Re: Axial fan modelling usin cs_fan.h

Post by jb_l »

Thanks a lot Luciano for your interest in this post.

I'll be very interested if you can post your case.
I've try to do the same copy as you, but it doesn't works on my side (copying cs_mat.c, cs_math.h and cs_fan.c from the trunk repository to the SRC directory of the case, commenting same lines as you).

I've got a lot of compilation errors about the files above...

Where did you copy them?

Regards

JB
jb_l
Posts: 31
Joined: Wed Aug 26, 2015 4:49 pm

Re: Axail fan modelling usin cs_fan.h

Post by jb_l »

Ok,

The Monday morning dummy error...
I've copied the html page of the trunk instead of the cs_math.c and cs_math.h files....
Changed that and the case now compiles.

However, I still have a divergence in the first iteration, even without turbulence model.

Is your case a closed box? Or do you have Inlet and outlet on some walls?

Regards

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

Re: Axail fan modelling usin cs_fan.h

Post by Luciano Garelli »

Hello,

In my test case I have set inlet and outlet.

I attach the case file, the mesh and the fan function. If this case run without problem post your case in order to help you to debug the problem.

Regards,

Luciano
Attachments
Fan_test_case.tar.gz
(1.23 MiB) Downloaded 234 times
jb_l
Posts: 31
Joined: Wed Aug 26, 2015 4:49 pm

Re: Axail fan modelling usin cs_fan.h

Post by jb_l »

Luciano,

Thanks a lot for your case

I'm gonna try it and let you know how it works on my CS.

Regards

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

Re: Axail fan modelling usin cs_fan.h

Post by Luciano Garelli »

Hello Yvan,

Do you have any references for the implementation of the axial fan model? Because there are different alternatives depending on the blade, fan and hub radios. Also in the 2D modeling, there is weighting with the thickness and radios.

Thanks in advance.

Regards,
Luciano.
Yvan Fournier
Posts: 4069
Joined: Mon Feb 20, 2012 3:25 pm

Re: Axail fan modelling usin cs_fan.h

Post by Yvan Fournier »

Hello Luciano,

I might be able to find an old report (in French) in which 1 or 2 pages describe the model and might provide a reference. I need to do a bit of archeology on my machine, but I'll let you know.

Best regards,

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

Re: Axail fan modelling usin cs_fan.h

Post by Yvan Fournier »

Hello Luciano,

Here is the theoretical documentation for Fan modeling in N3S, a predecessor to code_saturne, with the same fan models.
This is in French, but with diagrams and equations.

Best regards,

Yvan
Attachments
fan-model-fr.pdf
(883.33 KiB) Downloaded 156 times
Post Reply