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

UDF for changing zone of some cells

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 15, 2014, 09:36
Default UDF for changing zone of some cells
  #1
New Member
 
hamid
Join Date: Oct 2014
Posts: 6
Rep Power: 11
mech_sim is on a distinguished road
Hi,
can anybody tell me how I can change zone type of some cells with udf in fluent?
Thank you
mech_sim is offline   Reply With Quote

Old   October 15, 2014, 11:15
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
I don't think that is possible with a udf.
pakk is offline   Reply With Quote

Old   October 16, 2014, 01:52
Default
  #3
New Member
 
k
Join Date: Apr 2014
Posts: 12
Rep Power: 12
znri is on a distinguished road
Thank you Pakk. Instead of that, can I import two .msh files to fluent and then replace the zone of some cells with udf?
Best ragards
znri is offline   Reply With Quote

Old   October 16, 2014, 01:58
Default
  #4
Senior Member
 
Cees Haringa
Join Date: May 2013
Location: Delft
Posts: 607
Rep Power: 0
CeesH is on a distinguished road
Why would you want that?
CeesH is offline   Reply With Quote

Old   October 16, 2014, 02:18
Default
  #5
New Member
 
k
Join Date: Apr 2014
Posts: 12
Rep Power: 12
znri is on a distinguished road
I have a .msh file for a foam like structure, with solid and fluid zones. I only need a central sphere of that cube, whereas the outside of sphere be in fluid zones.
znri is offline   Reply With Quote

Old   October 16, 2014, 02:27
Default
  #6
Senior Member
 
Cees Haringa
Join Date: May 2013
Location: Delft
Posts: 607
Rep Power: 0
CeesH is on a distinguished road
Why do you need to specify that in FLUENT? Can't you divide the geometry in the desired zones in the geometry or meshing step?
CeesH is offline   Reply With Quote

Old   October 16, 2014, 03:21
Default
  #7
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
I can see two ways to do this.

1. As CeesH says: don't do this in Fluent, but do this before you make your mesh. This is by far the easiest method.
2. If, for some reason, you only have the .msh files and you can not get access to the original geometry, there is a workaround. Move the geometry (by translate mesh) such that the center of the sphere is in the origin, define a custom field function as the distance to the origin, and mark (adapt->mark) cells with that custom field function smaller than the radius, and then separate your mesh (mesh->separate) with "marked". You will have to sort some of the details out yourself, and the result will not be a smooth sphere because it will follow the mesh faces in your original mesh. I would strongly advice against this.

But in your questions you keep saying you want to do it with a udf. Is there a reason why you want a udf for this? I don't see any reason for that.
pakk is offline   Reply With Quote

Old   October 16, 2014, 10:13
Default
  #8
New Member
 
k
Join Date: Apr 2014
Posts: 12
Rep Power: 12
znri is on a distinguished road
Thank you for your reply. Actually I only have the .msh file. And as you mentioned, in this way I will haven't a smooth sphere. But it's the only way. I did the procedure you proposed, before. As I mentioned before, my msh file is contained of solid and fluid zones. When I separated the marked region (outside of the sphere), the solid zone divided to two region. Then I tried to merge the outside of the sphere with the fluid zone. But it didn't work. In the opened window (mesh->merge), I only could merge regions with the same type of zone. Can you please tell me how can I merge the regions?
The reason for using udf is that I haven't a way to merge the regions (with different zone types) in my mind. Let me know what is your suggestion?
Best regards
znri is offline   Reply With Quote

Old   October 16, 2014, 11:24
Wink
  #9
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Quote:
Originally Posted by znri View Post
Thank you for your reply. Actually I only have the .msh file. And as you mentioned, in this way I will haven't a smooth sphere. But it's the only way. I did the procedure you proposed, before. As I mentioned before, my msh file is contained of solid and fluid zones. When I separated the marked region (outside of the sphere), the solid zone divided to two region.
Fine until here.

Quote:
Then I tried to merge the outside of the sphere with the fluid zone.
Why would you try that? That does not help you to obtain what you want...

What you want is to make the outside of the sphere fluid. So do that. Go to "Cell Zone Conditions", select the zone you want to change, and change "Type" from "Solid" to "Fluid". If you want, you could merge afterwards, but merging is not the answer to your problem.
pakk is offline   Reply With Quote

Old   October 16, 2014, 14:57
Default
  #10
New Member
 
k
Join Date: Apr 2014
Posts: 12
Rep Power: 12
znri is on a distinguished road
Thank you for your helpful reply. Now how can I export mesh file with new zones from fluent? I would like to import it to ICEM.
Best regards
znri is offline   Reply With Quote

Old   October 16, 2014, 16:12
Default
  #11
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
As far as I know, that is impossible to do with Fluent. I would not know how. If you manage to do this, please let me know!
pakk is offline   Reply With Quote

Old   October 16, 2014, 20:43
Default
  #12
New Member
 
ketan
Join Date: Oct 2014
Posts: 3
Rep Power: 11
ket1 is on a distinguished road
can an one help me out in explaining : what is meant by mesh orientation in north and east in solar radiaton model. what does 0 and 1 signify
ket1 is offline   Reply With Quote

Reply


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
Problem with divergence TDK FLUENT 13 December 14, 2018 06:00
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem Attesz OpenFOAM Meshing & Mesh Conversion 12 May 2, 2013 10:52
[Netgen] Import netgen mesh to OpenFOAM hsieh OpenFOAM Meshing & Mesh Conversion 32 September 13, 2011 05:50
Problem in IMPORT of ICEM input file in FLUENT csvirume FLUENT 2 September 9, 2009 01:08
Create an UDF function for defining a zone ... CFDNewbie FLUENT 0 July 18, 2007 14:19


All times are GMT -4. The time now is 00:43.