|
[Sponsors] |
Multiphase UDF : How to specify velocities for different phases |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 28, 2015, 08:51 |
Multiphase UDF : How to specify velocities for different phases
|
#1 |
New Member
Aditya
Join Date: May 2015
Posts: 7
Rep Power: 11 |
Hello
I have a 3D 2-phase flow in a cylindrical column being simulated in FLUENT 14.0 . I want to specify different velocity inlets for both air and water. I figured that by making 2 different UDFs, I can specify the respective UDFs for the corresponding phase velocity boundary condition. However, whenever I interpret the 2nd UDF, the UDF interpreted earlier disappears i.e. I am unable to specify multiple velocity UDFs. Can someone please suggest how to tackle this problem? I had thought of somehow using phase_domain_index but I cannot find the way of using it. I am attaching my codes for reference. Thanks in advance P.S. While interpreting codes, I don't get any error, but when I try to compile the codes I get the errors as shown in the jpeg file |
|
May 28, 2015, 12:07 |
|
#2 |
Senior Member
Andrew Kokemoor
Join Date: Aug 2013
Posts: 122
Rep Power: 14 |
Try putting both macros in one file, i.e.
Code:
#include "udf.h" DEFINE_PROFILE(gas_z_velocity, thread, nv) { ... } DEFINE_PROFILE(liquid_z_velocity, thread, nv) { ... } |
|
May 29, 2015, 02:15 |
|
#3 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Compiling your UDFs would be a more robust and reliable method compared with interpreting your UDFs.
Are there any other lines of errors reported before or after those shown in your screenshot? It appears the problem might be with data types: are you running your simulations in single or double precision? Use the 'real' data type to declare your variables because then Fluent will either use float or long data types accordingly for single and double precision modes, respectively. Lastly, add a trailing period to your zeros and integers for example "0." instead of "0" to avoid incorrect assignments (again, be careful of data types). |
|
May 29, 2015, 02:20 |
|
#4 |
New Member
Aditya
Join Date: May 2015
Posts: 7
Rep Power: 11 |
Thank you Kokemoor, it worked like a charm.
Dear 'e', there are no other errors apart from those mentioned in the screenshot. I have defined the variable type as float (as mentioned in the code). and running the simulations on double precision. I interpreted the UDF and am currently running the simulation, will there be any difference if I define the data type as Real and then compile and run it? Thanks UPDATE : When I try to compile the file, I get the error as shown in the png file. The 'Done' statement is when I Build the file, the error afterwards is when I try to 'Load' it. Last edited by iamadz; May 29, 2015 at 02:35. Reason: Added compilation error |
|
May 29, 2015, 02:36 |
|
#5 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
If it's running successfully now then that's fine; but you could ensure the data types are assigned correctly and check that the results are equal. Sometimes code will compile (or "interpret") fine but not execute quite how you'd expect.
|
|
May 29, 2015, 02:39 |
|
#6 |
New Member
Aditya
Join Date: May 2015
Posts: 7
Rep Power: 11 |
Okay, I'll run another case after compiling it. But as mentioned in my just-updated-previous-reply, I'm encountering an error. Please have a look. Thanks
|
|
May 29, 2015, 07:26 |
|
#7 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Perhaps Fluent is getting caught up with the UDF version, try my compiling process for Fluent UDFs with an existing library loaded.
|
|
May 29, 2015, 07:36 |
|
#8 |
New Member
Aditya
Join Date: May 2015
Posts: 7
Rep Power: 11 |
There are no existing libraries to unload.
Regarding the compilation error for libudf, I looked up on the forums and found the attached pdf for solving this error. However, after installing both Visual C++ Studio and Microsoft SDK 7.0, I am now getting the following error while Build : "'nmake' is not recognized as an internal or external command, operable program or batch file" I found on the internet that this error relates to registering environment variables, but having followed whatever tips I could find, the error still does not go. Can you please advise what I should do now? Many thanks for your help again |
|
May 29, 2015, 07:56 |
|
#9 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
The Fluent FAQ Wiki has a section on compiling issues here. I use Microsoft Visual Studio Express (freely available). Have you managed to compile any UDFs in the past?
|
|
May 29, 2015, 08:11 |
|
#10 |
New Member
Aditya
Join Date: May 2015
Posts: 7
Rep Power: 11 |
No, I haven't compiled any UDFs in the past.
I have already read that wiki. They mention that I have to select the option for 'Setting environment variables' during installation. Unfortunately, I found no such option during the installation. I have reinstalled both Visual C++ Express 2010 and SDK but to no avail |
|
May 29, 2015, 08:26 |
|
#11 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Strange, I don't remember having these issues. Try uninstalling all of the software you've tried compiling with and reinstall Microsoft Visual Studio Express. If that still doesn't work, perhaps stay with interpreting UDFs for the meantime.
|
|
May 29, 2015, 09:25 |
|
#12 |
New Member
Aditya
Join Date: May 2015
Posts: 7
Rep Power: 11 |
Its working now, I had not changed the values for Path environment variable
Thanks a lot 'e' for your help |
|
May 29, 2015, 11:19 |
|
#13 | |
Senior Member
Andrew Kokemoor
Join Date: Aug 2013
Posts: 122
Rep Power: 14 |
Quote:
|
||
May 29, 2015, 20:39 |
|
#14 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
I use Microsoft Visual Studio Express 2012 for Windows Desktop. That's right, I don't use an SDK or any other programs for compiling within Fluent and compiling works well in all cases I've come across.
|
|
June 4, 2015, 02:16 |
|
#15 | |
Member
Shane
Join Date: Oct 2009
Posts: 52
Rep Power: 17 |
Quote:
Best way as advised by Kokemoor. Put as many macro as possible in single file, compile or interpret, then and "variable" will be visible all the time. Make life easy. Shane |
||
August 8, 2024, 09:58 |
How to specify two different velocity of two different fluid at same inlet multiphase
|
#16 |
New Member
Kanak Raj
Join Date: May 2023
Posts: 3
Rep Power: 3 |
I am facing an issue with giving two different velocities at a single inlet (The problem is that it is flowing through a pipe with different liquids, i.e. water liquid and water vapour in a vertical pipe). For that, the velocity of liquid and vapour is different. I am doing it by splitting the inlet into two parts and giving the different velocities at each face of the inlet. But the results are not coming correct. Can anyone please suggest another method to do it? Thanking you.
|
|
Tags |
multiphase flow, udf and programming, udf compilation |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF | acasas | CFD Freelancers | 1 | January 23, 2015 08:26 |
Operating density (UDF?) multiphase problem | GM_XIII | Fluent Multiphase | 1 | July 10, 2014 08:11 |
Drawing velocities of phases separately | K. Baker | FLUENT | 0 | June 10, 2007 09:40 |
multiphase udf | Rashmi | FLUENT | 1 | March 7, 2006 03:17 |
UDF for multiphase flow | ROOZBEH | FLUENT | 3 | April 7, 2004 18:54 |