CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   urgently need help to write UDF (https://www.cfd-online.com/Forums/fluent-udf/167266-urgently-need-help-write-udf.html)

Capricorn February 26, 2016 07:43

urgently need help to write UDF
 
I have a periodic domain of 0.64x0.64 m with 512x512 grid points. I am simulating gas solid flow. I need to gather data of solid velocity,gas velocity slip velocity and solid volume of fraction in each cell after every time step. For a given solid vof say 0.1 ,calculating the solid vof in each cell in the full domain,when the solid vof fall in like vof-0.1 ,save the current time,solid vof,solid velocity and gas velocity in a file.. Any one can help me in this issue?I have a strict deadline of a week to finish this ?

`e` February 29, 2016 19:47

Let's try to break your question up into sections:

Quote:

Originally Posted by Capricorn (Post 586998)
I have a periodic domain of 0.64x0.64 m with 512x512 grid points. I am simulating gas solid flow.

We assume you're using the Euler-Euler approach with the volume of fluid.

Quote:

Originally Posted by Capricorn (Post 586998)
I need to gather data of solid velocity,gas velocity slip velocity and solid volume of fraction in each cell after every time step.

This data is available by default and could be either saved for output in CFD-Post or written to a data file with a UDF to be opened in another postprocessing or data manipulation software such as MATLAB.

Quote:

Originally Posted by Capricorn (Post 586998)
For a given solid vof say 0.1 ,calculating the solid vof in each cell in the full domain,when the solid vof fall in like vof-0.1 ,save the current time,solid vof,solid velocity and gas velocity in a file.

A conditional if statement could be employed within a DEFINE_ADJUST macro (called at each time step) where the VOF of cells are checked. Then, output the data as usual.

Capricorn March 1, 2016 01:56

. Thank you so much "e" for your response. I am using multiphase eulerian model and then i chose eulerian model in Fluent not VOF....I am in a learning phase to write a udf but it will probably take some time. How can i save this data using post cfd??And can you give me a sample udf ??I am finished with the simulation and now i need this data....probably i have to run this simulation again with the udf. right?

`e` March 1, 2016 04:26

Quote:

Originally Posted by Capricorn (Post 587477)
How can i save this data using post cfd??

Have a read of this tutorial starting from "Setting Up Data Export to Create Animation". You may also want to create an animation, but otherwise simply save plots of your volume fractions etc.

Note: this method is for every n number of time steps (rather than on a condition of cells reaching a VOF threshold). If you only want to save the data when the volume fractions are at a threshold (or similar condition), then you may need to write a Scheme script with TUIs and couple that with a UDF (not as straightforward).

Quote:

Originally Posted by Capricorn (Post 587477)
And can you give me a sample udf ??I am finished with the simulation and now i need this data....probably i have to run this simulation again with the udf. right?

It's still unclear what you're after overall. If saving the data every few time steps is not what you want, then try to explain again when you want to save this data.

Capricorn March 9, 2016 02:34

Thank you e for your response..Sorry i am in China and sometimes i cant acess this site without vpn. What i want is to gather the data according to the solid volume of fraction in each cell. As solid vof will not be equal in every location even at the same instant of time. So i will divide the allowed value of solid vof from 0-0.65 into 1300 bins. So that now every bin has a window of 0.0005. Now i want my udf to calculate the solid vof into bins with in this range. Like less than 0.0005 vof,,into one bin. Then greater than 0.0005 but less than 2(0.0005) into next bin,,so on and so forth. This udf should also tell the corresponding value of solid velocity,gas velocity and current time. Can you help me with that?

pradip.c1000 March 11, 2016 00:55

'e' Help Me also
 
Hello e,

I have similar problem as above I have gone through above mentioned tutorial of simcafe but I have 4 with my project and 2 problems with this tutorial.

Project doubt:

1. I am doing flapping wing analysis with udf for Wing as rigid body and surrounding as deforming body. Which gives results of Coeff. of Lift and drag. But further I required some expression(such as Coeff of thrust and Efficiency of propulsion) to be evaluated at time steps and plot graph of the same.How can I do that from fluent to cfx pre/ cfd post? Can we do write expression for any formula in Fluent and graph will be plotted?

2. If I have to calculate above mentioned expressions which file format I have to save results of Fluent. Is it possible to run udf in cfd post? because it is compiled in c compiler using Visual studio 2010 and cfx require fortran.

3. Which parameters I have to choose while exporting from Fluent?

4. Also motion can we give it to wing as rigid body in cfx pre solving?

Turorial Doubt:

1. When I tried 3 times on patching they have give image but this did not happened in my solving.

2. Solution also did not come as they have explained.

Thanks in Advanced.
:):)

Regards
Pradip.


All times are GMT -4. The time now is 09:50.