|
[Sponsors] |
March 1, 2016, 09:19 |
|
#21 |
Member
Hossein
Join Date: Oct 2010
Location: Greensboro, NC, USA
Posts: 30
Rep Power: 16 |
I compiled your code, but I am trying to use it for DEFINE_PROPERTY. For the error you get, I put mixture_domain=Get_Domain(1). It compiles and runs well
__________________
Hossein Amini PhD student in Biochemical Engineering; Computational Science and Engineering department; North Carolina Agricultural and Technical State University |
|
March 1, 2016, 09:37 |
|
#22 | |
Member
Hossein
Join Date: Oct 2010
Location: Greensboro, NC, USA
Posts: 30
Rep Power: 16 |
Quote:
__________________
Hossein Amini PhD student in Biochemical Engineering; Computational Science and Engineering department; North Carolina Agricultural and Technical State University |
||
October 9, 2017, 08:23 |
The same problem !
|
#23 |
Senior Member
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10 |
Dear Ebrahim,
I have a same problem like your case and just my viscosity function is different. Did you solve your UDF's problem? I would be appreciated if you could help me on this. Thanks in advance, Ali |
|
October 9, 2017, 08:25 |
|
#24 |
Senior Member
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10 |
Dear Ebrahim,
I have a same problem like your case and just my viscosity function is different. Did you solve your UDF's problem? I would be appreciated if you could help me on this. Thanks in advance, Ali |
|
October 9, 2017, 08:56 |
The same problem !
|
#25 | |
Senior Member
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10 |
Dear Ebrahim,
I have a same problem with you problem. Just my viscosity function is different. Did you solve the UDF's problem(viscous function vs volume of fraction)? I would be appreciated if you could help me on this. Thanks in advance, Ali Quote:
|
||
October 9, 2017, 09:23 |
|
#26 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
The solution was already given by Hossein Amini, just above your message.
If you are interested in what was the reason for the error message: the variable "mixture_domain" is defined, but never given a value. You ask the computer to say something about a mixture domain, but you don't tell him which mixture domain (even though you probably only have one), so Fluent is confused. |
|
October 9, 2017, 10:29 |
|
#27 | |
Senior Member
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10 |
Hi,
What is [**pt] in 6 line and[*] in 7 , 8 lines? Thanks, Ali Quote:
|
||
October 23, 2017, 11:21 |
Add UDF in Fluent's materials section?
|
#29 |
Senior Member
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10 |
Hi All,
I wrote UDF code in Fluent and I added it instead of the constant amount of water viscosity, but I have not answered so far! Should special settings be made? Thanks, Ali |
|
October 24, 2017, 05:41 |
|
#30 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
I don't understand what you are asking.
|
|
October 24, 2017, 16:02 |
|
#31 |
Senior Member
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10 |
||
October 24, 2017, 16:05 |
|
#32 |
Senior Member
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10 |
I have a twophase flow :
Water and a other fluid phase |
|
October 25, 2017, 03:38 |
|
#33 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
And you already wrote a UDF or not?
What is your problem? Do you not know how to write it? Or do you get errors? Or do you get unexpected results? If you want help, don't let us guess at what you are doing... |
|
October 25, 2017, 05:26 |
|
#34 |
Senior Member
Join Date: Nov 2010
Posts: 103
Rep Power: 16 |
Hi ali, as pakk said your question is bit unclear.
Please share your UDF, or maybe the function you are trying to code for the viscosity. In case you are getting unexpected results, please share the results and tell us why you think they are wrong. So, everyone will have a better understanding of the problem. cheers |
|
November 4, 2017, 01:29 |
UDF for viscosity
|
#35 |
Senior Member
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10 |
Thank you for your reply.
I use a mix model that the water and the other phase (X) are mixed, which phase water and phase X have individual properties (density and viscosity). In the Inlet Boundary Condition, the phase X with a certain amount of volume of fraction (alphaX) is mixed with the water phase However, in different points of the domain and at different times, the volume of fraction of the X phase changes, and subsequently the viscosity of the mixed phase (m) also changes according to the formula: Viscosity (m) = 3.8 * viscosity (water) * (1-(alphaX/0.62))^(-1.55) Where, the viscosity function of the mixture phase (m) varies according to the volume of fraction (alpha X) of the phase X, and also the μc is the constant value of the viscosity of water. A very similar example to my problem that I found on the cfd-online site is as follows: UDF for volume fraction It is important that based on a study on related articles, I have to replace the UDF file on the constant amount of water viscosity in the Materials substitute of fluent to vary the viscosity of the mix phase at different points and at different times in the domain. Of course, I have already written three UDF codes, but I have not responded to any of these. Thank you in advance for your commenting on any of these fallowing codes: |
|
November 4, 2017, 06:29 |
|
#36 |
Senior Member
Join Date: Nov 2010
Posts: 103
Rep Power: 16 |
Hi,
Maybe you can use both Code:
DEFINE_ADJUST Code:
DEFINE_PROPERTY Code:
DEFINE_PROPERTY(viscosity_mix,c,t) { real viscosity; viscosity = C_UDMI(c,t,1); return viscosity; } DEFINE_ADJUST(my_adjust,mixture_domain) { Thread *t; cell_t c; Thread **pt; real mu_water = 0.00103; mp_thread_loop_c(t,mixture_domain,pt) { begin_c_loop(c,t) { C_UDMI(c,t,1) = 3.8*mu_water*(pow((1.0 - C_VOF(c,pt[1])/0.62), -1.55)); } end_c_loop(c,t) } } hope it helps cheers! |
|
November 5, 2017, 10:17 |
|
#37 |
Senior Member
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10 |
Thanks for your reply.
What do you mean by last statement: "Please remember to define a user define memory before compiling, because the values are stored in an UDM." How can I define a user define memory before compiling? I isn't professional in writing UDF!!! |
|
November 5, 2017, 11:16 |
|
#38 |
Senior Member
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10 |
What numbers do I enter in this window?
|
|
November 6, 2017, 05:37 |
|
#39 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
If you want to have one User Defined Memory, change the first zero (0) into a one (1).
|
|
November 6, 2017, 07:39 |
|
#40 | |
Senior Member
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10 |
Quote:
As you see, In my case two fluids are mixed together: water and another fluid called ferrosilicon (Other than Air). In udf code that you wrote, how do I understand the software that the volume fraction (vof) is related to the ferrosilicon fluid? |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
udf: volume fraction gradient in eulerian model | jwwang | FLUENT | 22 | April 15, 2015 07:27 |
Conversion of mass fraction to mole fraction in FLUENT | prince_pahariaa | FLUENT | 0 | August 26, 2014 09:08 |
interDyMFoam - change in volume fraction | gopala | OpenFOAM Running, Solving & CFD | 0 | April 27, 2009 11:46 |
UDF for Species mass fraction | daniel | FLUENT | 3 | June 22, 2005 09:40 |
Species Mass Fraction inside UDF using PDF? | Daniel Schneider | FLUENT | 0 | September 20, 2000 07:34 |