CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   How to Capture the Nodes on the Blade Surface (https://www.cfd-online.com/Forums/cfx/87334-how-capture-nodes-blade-surface.html)

Araz April 18, 2011 04:15

How to Capture the Nodes on the Blade Surface
 
Hello every one,

My case is a 2d compressor blade (stator / rotor) and I'm working with CFX12.1.
My problem is that, I need to capture the nodes on the blade surface so that I can have access to the value of variables such as pressure and temperature on every single node after each time step when running the cfx-solver (Not in cfx-post).
for this purpose I think first I need to find the Zone_ID of the Pressure &Suction Side and then write a Loop over these Zones to capture nodes (to be figured out!)

In Fluent I have seen that we can easily find the zone_id of every edge by using "File > read mesh" from the main toolbar which gives you the number of nodes on each edge and the Zone_ID of that edge. In CFX, I don't know how to do that and find the Pressure side & Suction Side face_ids.

any answer to this question and also your kind suggestions for solving this problem is appreciated. :)

Regards,
Araz

ghorrocks April 18, 2011 06:50

CFX uses a very different approach to accessing data than Fluent does. So do not be distracted by the way Fluent makes you access the nodal data. So best explain what you are trying to do and we will see if CFX has some way to implement it.

So what are you doing with the temperature and pressure on the blades?

Araz April 18, 2011 19:52

Thank you for your comment dear Glenn,
In my simulation, which is redesigning the blade geometry to meet a prescribed target pressure distribution (p.d.), the nodes on the blade surface are supposed to move using a Fortran code. I have chosen an arbitrary blade geometry and ran a steady state simulation using valid B.C to find the initial p.d. over the blade. Then, the difference between this two p.d. is used by the code as the source of the movement of nodes. By doing this the blade is supposed to deform gradually to finally this difference reaches to zero and shape a new blade which meets the prescribed target p.d..
briefly, each node will move independent of the others, one may move 1mm the other 1 cm...
So, the data of each single node are needed to be transformed to the code and vice versa after each time step. That is why I want to capture the nodes on the blade surface.

thank you very much again for your help and time :)

ghorrocks April 19, 2011 06:37

I see. I do not have any experience in this area so cannot help you. If you cannot work it out yourself you may have to contact CFX support for assistance.

Araz April 20, 2011 14:15

Thank you anyway dear Glenn :)

Araz April 20, 2011 14:29

I also have another critical question,

The Fortran code that I have is about 1900 lines, it has not been written according to CFX data base, so, should I change the logics and syntaxes of this code according to CFX database?
Moreover,
I have a code written in C, it has everything that I want but it is written based on fluent data base and udf manual. I read in cfx documentation that we can use C language in cfx, is it possible to use this C code?

(if this is not a good plase to post this question, please tell me to post a new thread)
Thnaks a lot

ghorrocks April 20, 2011 18:57

Fluent and CFX are totally different for user routines. Your Fluent routine will need to be totally rewritten for CFX, well, at least the sections which read and write values to the solver will.

Araz April 20, 2011 19:10

Thank you Glenn,
What about the Fortran routine?
will it need to be totally rewritten as well to be compatible with cfx or just changing the sections which read and write the values and then compiling the routine using Fortran compiler is enough?
and for C code, do we need to install a C compiler to use the code in cfx?

Thanks a lot,

bhatiadinesh April 21, 2011 06:25

Hi,
Is it compulsory for you to use CFX or Fluent only ???? In the market there are many 2-D solvers which are very simple to use and also you can use your code to modify the profile. Especially for designing Airfoils such codes are extensively used. Just search the net for such softwares. You can combine your code with the software to come up with a new blade design method.

Regards,
Dinesh

Araz April 21, 2011 14:40

Dear Dinesh,
It is compulsory for me to use CFX. I haven't written this Fortran code but it has been successfully used to modify the profile, it has been also rewritten in C language and used in Fluent, now I want to do the same in CFX.
In cfx documentation there is "An Example of an Export Program" which is a C code, I may be able to edit this code according to my requirements, there is also information about required compiler flags for different platforms (I'm working with xp-32bit and I don't know which compiler flag I need and how to compile!),there is the direct command for linking the program.
But I am very confused now, since I'm supposed to compile and use the Fortran routine, but for exporting data from cfx I need a C code, so I think I should use both of them together!?
Finally, may you please tell me that Fortran routines need to be rewritten to be used with cfx or just a Fortran compiler is enough to link the code with cfx?

Thanks again for your advice,

joey2007 April 22, 2011 15:33

Guess, there are some export libraries for post-processing which can be used by C routines. Guess the example you mention refers to this. This stuff is not the same as a programming interface of the CFX solver.

If you intend to change mesh while the solution process you have use the mesh deformation / mesh movement features. This feature can be controlled by CEL with out programming. Usually it is not necessary to use the programming interface for mesh deformation.

The programming interface of the CFX solver is user fortran. Check the modelling manual chapter 17.0 for more details.

Araz April 23, 2011 02:22

Hi Joey,
Thanks for reply, as for the C routine and the Export example you are right, It is not what I need.
I will deal with mesh deformation in my simulation, but the difficulty is that, I have about 160 nodes on the Pressure Side. each of these nodes are supposed to move independently and actually my blade is deforming continuously (it is not a simple movement of the blade as a whole). The code that I have calculates the displacement of each node and updates blade geometry. but:

1- For this purpose,I need the nodal values of pressure and temperature for every single node since these are the inputs of my code. I think I need to first find the surface_id of my pressure side and then loop over it. I used ICEM for meshing and I have found the surface ID in ICEM (i.e. srf.08), I don't know whether it will change after importing the mesh into CFX-Pre or cfx retains the same definition. Anyway, in cfx I couldn't find the data structure of my zones.
2- The 2nd problem is to link my code with cfx solver I mean to export nodal values from cfx to code and return the updated geometry from code to cfx at each time step. I read the User Fortran section of the modeling manual, displacement of my nodes are not specified before running the solver so my case can not be the junction box routine (please correct me if I'm wrong), so I need user CEL function.
I will be grateful if someone show me the way :(
Thanks again

joey2007 April 26, 2011 04:21

You can call user cel with coordinates as arguments.

Araz April 28, 2011 05:47

Dear Joey,
Thank you for your advice,
Do you mean that I should define the initial nodes coordinates in my routine, and then create a CEL function in cfx containing the coordinates of my nodes as arguments which can be updated after each time step (i.e. get the displacement from routine and apply it to the corresponding node coordinate and move the node to its new location)?
for example I do the following in my routine:
1- (Xi,Yi,Zi) = ARGS(1,1) and i=(1-160)
2- Yi=Yi +calculated displacement (since displacement is only in Y direction)
3- define that it should be performed at every time step.
Then do the following in cfx:
1- myroutine = node function (Nodei location,aitern)
(based on which "Nodei location" refers to the args(1,1) in my routine).
2- define the "Nodei location" as the x,y,z coordinate of the corresponding node????
Can you please tell me how can I define the x,y,z coordinate of a node in a CEL expression so that CFX recognize it? since I need CFX to move this node when it receives the displacement of that node from the routine. (obviously I can not use the monitor point for this purpose and also I have not find any option in cfx for displacement of nodes or any arbitray point)
Is it possible to write only one CEL function (like what I did above) because it seems ridiculous to write one function for each node!?
I also found the node numbers in ICEM and compared them with the out put mesh file (.cfx5) and found the same numbers in it, so it seems that CFX uses the same node numbers but I don't know how to use them (or even the coordinates) to capture the nodes in cfx.
Sorry for too much questions, but I'm looking for a clue to go in the right direction, I have searched cfx documentations many times but didn't find anything useful about my case.

I really appreciate your help and advice
Araz


All times are GMT -4. The time now is 06:40.