CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Declare a zone/thread as a liquid

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 31, 2016, 09:56
Default Declare a zone/thread as a liquid
  #1
Member
 
mimi
Join Date: Mar 2016
Posts: 33
Rep Power: 10
cik mimi is on a distinguished road
Good day,

In my udf code, under DEFINE_INIT(my_initilize,d),

can I declare C_UDMI(c,t,i) = 1.0 as liquid thread , without using

FLUID_THREAD_P(t) macro?

Thank you so much.
cik mimi is offline   Reply With Quote

Old   March 31, 2016, 11:21
Default
  #2
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
Quote:
Originally Posted by cik mimi View Post
Good day,

In my udf code, under DEFINE_INIT(my_initilize,d),

can I declare C_UDMI(c,t,i) = 1.0 as liquid thread , without using

FLUID_THREAD_P(t) macro?

Thank you so much.
I am not sure about what you need. Can you explain what is your problem so we will have a better chance to help you.
cik mimi likes this.
Bruno Machado is offline   Reply With Quote

Old   March 31, 2016, 11:28
Default
  #3
Member
 
mimi
Join Date: Mar 2016
Posts: 33
Rep Power: 10
cik mimi is on a distinguished road
Hi Bruno Machado,
I am appreciate for your quick response.

Actually, in my case, I need to compile the code since I have this miscellaneous macro i.e. FLUID_THREAD_P(t).

However, my computer has problem to compile the code and certainly the code cannot be simply interpret. Therefore, I have decided to get rid of this term FLUID_THREAD_P(t) and just simply make looping on UDMI(c,t,i) equal to 1.0 (to declare it is a liquid region).

This is part of my code:

DEFINE_INIT(initialize,d)
{ cell_t c;
Thread *t;
int i;

thread_loop_c(t,d) /* Loop over all cell threads in domain */
{
if (FLUID_THREAD_P(t))
{
begin_c_loop(c,t) /* Loop over all cells in a cell thread*/
{
C_UDMI(c,t,4) = 1.0; /* Liquid region */
C_UDMI(c,t,0) = Latent_Heat;
C_UDMI(c,t,1) = Latent_Heat;
C_UDMI(c,t,2) = 1.0;
C_UDMI(c,t,3) = 1.0;
}
end_c_loop(c,t)
}
}
}

Is it possible to just put the number 1.0 to indicate it is liquid?

Thank you so much.
cik mimi is offline   Reply With Quote

Old   March 31, 2016, 11:37
Default
  #4
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
Quote:
Originally Posted by cik mimi View Post
Hi Bruno Machado,
I am appreciate for your quick response.

Actually, in my case, I need to compile the code since I have this miscellaneous macro i.e. FLUID_THREAD_P(t).

However, my computer has problem to compile the code and certainly the code cannot be simply interpret. Therefore, I have decided to get rid of this term FLUID_THREAD_P(t) and just simply make looping on UDMI(c,t,i) equal to 1.0 (to declare it is a liquid region).

This is part of my code:

DEFINE_INIT(initialize,d)
{ cell_t c;
Thread *t;
int i;

thread_loop_c(t,d) /* Loop over all cell threads in domain */
{
if (FLUID_THREAD_P(t))
{
begin_c_loop(c,t) /* Loop over all cells in a cell thread*/
{
C_UDMI(c,t,4) = 1.0; /* Liquid region */
C_UDMI(c,t,0) = Latent_Heat;
C_UDMI(c,t,1) = Latent_Heat;
C_UDMI(c,t,2) = 1.0;
C_UDMI(c,t,3) = 1.0;
}
end_c_loop(c,t)
}
}
}

Is it possible to just put the number 1.0 to indicate it is liquid?

Thank you so much.
Basically by defining C_UDMI(c,t,4) = 1.0; you are defining that the value stored in the UDMI 4 is equal to 1.0. Nothing else.

I am just wondering if you need to use the FLUID_THREAD_P(t). In the cell zone conditions in Fluent, you can define if you have a fluid or a solid zone. In case you are working with both (fluid+particles) the FLUID_THREAD_P(t) becomes interesting, otherwise, you can simply use the thread returned by the Fluent.
cik mimi likes this.
Bruno Machado is offline   Reply With Quote

Old   March 31, 2016, 11:46
Default
  #5
Member
 
mimi
Join Date: Mar 2016
Posts: 33
Rep Power: 10
cik mimi is on a distinguished road
Dear Bruno Machado,

Thank you for your explanation.

Somehow my compilation code has showed error message (not compatible with 64 bits environment).

I wonder if you can give an opinion on how to get correct steps to compile the codes with the miscellaneous macro, FLUID_THREAD_P(t)?

Thank you =)
cik mimi is offline   Reply With Quote

Old   March 31, 2016, 11:48
Default
  #6
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Quote:
Is it possible to just put the number 1.0 to indicate it is liquid?
I don't know what you mean by "indicate it is liquid". If you make UDM4 equal to 1.0, Fluent does not magically understand that you mean it is a liquid element.

I would advise you to fix the problem you have with "FLUID_THREAD_P(t)", and don't invent your own method that will have many more problems. Which compilation errors do you get?
pakk is offline   Reply With Quote

Old   March 31, 2016, 11:52
Default
  #7
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
Quote:
Originally Posted by cik mimi View Post
Dear Bruno Machado,

Thank you for your explanation.

Somehow my compilation code has showed error message (not compatible with 64 bits environment).

I wonder if you can give an opinion on how to get correct steps to compile the codes with the miscellaneous macro, FLUID_THREAD_P(t)?

Thank you =)
For this, I can not help much. But make sure you open your Fluent using the command prompt from the Visual Studio. Also, have a look in the post `e` posted in the other topic. I am pretty sure you can find the answer in the topic he referred to you.
cik mimi likes this.
Bruno Machado is offline   Reply With Quote

Old   March 31, 2016, 11:53
Default
  #8
Member
 
mimi
Join Date: Mar 2016
Posts: 33
Rep Power: 10
cik mimi is on a distinguished road
Hi Pakk.
Thank you for your response. Appreciate it.

My compilation error gives me: does not compatible with 64 bits environment.

Previously, when I interpret the code, it does showed >> structure references is not implemented on line 41: FLUID_THREAD_P(t).

Earlier, I assume that number 1.0 is stored in Fluent library as liquid thread. However, I am wrong with that. Sorry with that.
cik mimi is offline   Reply With Quote

Old   March 31, 2016, 11:57
Default
  #9
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Quote:
Originally Posted by cik mimi View Post
Hi Pakk.
Thank you for your response. Appreciate it.

My compilation error gives me: does not compatible with 64 bits environment.

Previously, when I interpret the code, it does showed >> structure references is not implemented on line 41: FLUID_THREAD_P(t).

Earlier, I assume that number 1.0 is stored in Fluent library as liquid thread. However, I am wrong with that. Sorry with that.
That is not the compilation error. Please show the text that pops up in the text user interface, copied literally.
cik mimi likes this.
pakk is offline   Reply With Quote

Old   March 31, 2016, 12:01
Default
  #10
Member
 
mimi
Join Date: Mar 2016
Posts: 33
Rep Power: 10
cik mimi is on a distinguished road
Hi pakk,

This is the result of my compilation..

Error: The UDF library you are trying to load (libudf) is not compiled for 2d on the curent platform (win64)

Thank you.
cik mimi is offline   Reply With Quote

Old   April 1, 2016, 03:23
Default
  #11
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
That is not the error you get when you compile, but the error you get when you load.

Please show the error that you get when you compilee (click 'build').
cik mimi likes this.
pakk is offline   Reply With Quote

Old   April 4, 2016, 10:59
Default
  #12
Member
 
mimi
Join Date: Mar 2016
Posts: 33
Rep Power: 10
cik mimi is on a distinguished road
Quote:
Originally Posted by pakk View Post
That is not the error you get when you compile, but the error you get when you load.

Please show the error that you get when you compilee (click 'build').
Hi pakk,

when I tried to open it gave me this error:

The UDF library you are trying to load (libudf) is not compiled for 2d on the current platform (win64).
The system cannot find the path specified.

How to fix this issue?

Thank you so much
cik mimi is offline   Reply With Quote

Old   April 4, 2016, 11:07
Default
  #13
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
As I said before: that is not the error you get when you compile, but the error you get when you load.

Read it carefully: "The UDF library you are trying to load (libudf) is not compiled".
It is the error that you will get when you try to load a UDF that is not compiled. Why is the UDF not compiled? I don't know, and it is impossible to see from this error. You will have to show the error that you get when you try to compile.

So please show the error that you get when you compile (what is shown after you click 'build').
cik mimi likes this.
pakk is offline   Reply With Quote

Old   April 4, 2016, 11:29
Default
  #14
Member
 
mimi
Join Date: Mar 2016
Posts: 33
Rep Power: 10
cik mimi is on a distinguished road
Hi pakk,

May I ask, why this error occur during load?

This is the one I face. Not an error during compile.
So, my code cannot be compile to 'done'.

Thank you.
cik mimi is offline   Reply With Quote

Old   April 4, 2016, 11:35
Default
  #15
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
I don't know.

And until you share the text shown on your screen when you click 'build', I can not help you further. You say that there is no error there, but you might not read it correctly. (And given that you already misread my question here three times, it is not impossible that you just overlooked the error.)
pakk is offline   Reply With Quote

Old   April 4, 2016, 23:51
Default
  #16
Member
 
mimi
Join Date: Mar 2016
Posts: 33
Rep Power: 10
cik mimi is on a distinguished road
Good day,

This is my error message shown in this window

The UDF library you are trying to load (libudf) is not compiled for 2ddp on the current platform (win64).
The system cannot find the file specified.

C:\Users\sfahmi\Desktop\proposal defence\sas(1e-6)\solidification\libudf\win64\2ddp\libudf.dll
cik mimi is offline   Reply With Quote

Old   April 5, 2016, 04:01
Default
  #17
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Please don't repeat the text that is shown when you click 'load'. That is not important.

When you are ready to share the text that is shown when you click 'build', let me know.
pakk is offline   Reply With Quote

Old   April 6, 2016, 10:19
Default
  #18
Member
 
mimi
Join Date: Mar 2016
Posts: 33
Rep Power: 10
cik mimi is on a distinguished road
Dear sir,

please help me................ because my UDF code is in 32 bits
cik mimi is offline   Reply With Quote

Old   April 6, 2016, 10:20
Default
  #19
Member
 
mimi
Join Date: Mar 2016
Posts: 33
Rep Power: 10
cik mimi is on a distinguished road
And , I don't have a good compiler to match with a new fluent version
cik mimi is offline   Reply With Quote

Old   April 6, 2016, 10:45
Default
  #20
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
I really want to help you. But I can not see what is shown on your screen...

What you should do:
1. Open Fluent.
2. Load your model.
3. Go to the user-defined-functions, compilation option.
4. Select your source file.
5. Click 'build'.
6. Select the text shown in the text user interface.
7. Press control and C.
8. Go to this screen, and click 'reply'.
9. Press control and V.
10. Click 'Submit reply'.

If you don't do this, I can not help you.
pakk is offline   Reply With Quote

Reply

Tags
#udf #liquid #thread


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM.org] OpenFOAM 2.3.x on Mac OS X 10.10.1 Installation Errors Petru OpenFOAM Installation 15 December 29, 2015 13:51
[OpenFOAM.org] OpenFOAM 2.3.1 installation on SUSE Linux Enterprise 12 harsha_kulkarni OpenFOAM Installation 17 November 16, 2015 04:06
[OpenFOAM.org] Installation problem 2.4.0 on Centos 6.6 luke_skywalker OpenFOAM Installation 8 November 13, 2015 09:15
Sgimpi pere OpenFOAM 27 September 24, 2011 08:57
Ld_library_path scottneh OpenFOAM 9 November 21, 2009 10:15


All times are GMT -4. The time now is 22:16.