CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

Different Initial Conditions Within a Single Body

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 7, 2014, 01:14
Default Different Initial Conditions Within a Single Body
  #1
Member
 
Nurzhan
Join Date: Jan 2014
Posts: 56
Rep Power: 12
Nurzhan is on a distinguished road
Dear CFX experts,

I am trying to set different initial temperatures within one geometry and look how the temperature will achieve the equilibrium within the body.

I built all eight parts separately (using DM) and meshed the parts in ANSYS meshing application. Then, I represent each part as a separate domain and made interface connections between the domains.

Was my philosophy is right? Is it possible to set different initial conditions within a single body in any other way? I was advised to try "IF" statement, where I have to specify coordinates of each part (e.g. IF x<0.5 and y<0.4 than T=50).

Any help and advise will be highly appreciated.

Best regards,
Nurzhan
Nurzhan is offline   Reply With Quote

Old   May 7, 2014, 02:46
Default
  #2
Senior Member
 
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22
Lance is on a distinguished road
You can use nested if statements or step functions to get what you want.

"IF x<0.5 and y<0.4 than T=50" can be written in a CEL expression as
Code:
if(X < 0.5 [m],(if(Y< 0.4 [m], 50 [C],0 [C])),0 [C])
It would give you 50 [C] at x<0.5 and y<0.4 and 0 [C] everywhere else.
Lance is offline   Reply With Quote

Old   May 7, 2014, 18:03
Default
  #3
Member
 
Nurzhan
Join Date: Jan 2014
Posts: 56
Rep Power: 12
Nurzhan is on a distinguished road
Hi Lance,

Thanks for quick response and it is exactly what I wanted.

In addition I want to ask:

If I want to specify temperatures for another parts of a geometry , for example:

1st part of the geometry: x<0.5 and y<0.4 then T= 50oC
2nd part of the geometry: x<1 and y< 0.6 then T= 60oC
3d part of the geometry: x<1.2 and y<0.7 then T= 70oC
4th part of the geometry: x<1.5 and y<0.8 then T= 80oC

Will the expression look like this:

if(X < 0.5 [m],(if(Y< 0.4 [m], 50 [C],if(X < 1 [m],(if(Y< 0.6 [m], 60 [C],if(X < 1.2 [m],(if(Y< 0.7 [m], 70 [C],80 [C])),80 [C]))),80 [C]))),80 [C])

?

Thanks again Lance.

Regards,
Nurzhan
Nurzhan is offline   Reply With Quote

Old   May 7, 2014, 18:38
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,816
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Your expression is becoming pretty messy. If you have lots of regions like this I would consider using a 1D interpolation function instead.
ghorrocks is offline   Reply With Quote

Old   May 7, 2014, 20:30
Default
  #5
Member
 
Nurzhan
Join Date: Jan 2014
Posts: 56
Rep Power: 12
Nurzhan is on a distinguished road
Hi Glenn,

I got your idea, but does 1-D interpolation will work for my case (see attached photo)? As per my understanding if temperature was uniform at given x value than 1-D interpolations make a sense.
Attached Images
File Type: jpg Temp. profile.jpg (11.6 KB, 10 views)
Nurzhan is offline   Reply With Quote

Old   May 7, 2014, 20:46
Default
  #6
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,816
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
No, 1D interpolation would not work for your 2D case.

You could use a 3D interpolation where you set the 3rd dimension to zeros. That would be a single function, but note it uses nearest neighbour interpolation and that means the transitions between temperature regions can be a little weird sometimes.

Maybe your nested if statements are the best way to go.
ghorrocks is offline   Reply With Quote

Old   May 7, 2014, 22:13
Default
  #7
Member
 
Nurzhan
Join Date: Jan 2014
Posts: 56
Rep Power: 12
Nurzhan is on a distinguished road
Thank you guys for given advises. I will try IF expression then.
Nurzhan is offline   Reply With Quote

Old   May 7, 2014, 23:15
Default
  #8
Member
 
Nurzhan
Join Date: Jan 2014
Posts: 56
Rep Power: 12
Nurzhan is on a distinguished road
I found mistake IF function for my case perfectly.

Regards,
Nurzhan

Last edited by Nurzhan; May 8, 2014 at 00:27. Reason: Mistake is found
Nurzhan is offline   Reply With Quote

Old   May 8, 2014, 00:32
Default
  #9
Senior Member
 
Join Date: Jun 2009
Posts: 1,850
Rep Power: 33
Opaque will become famous soon enough
I am bit confused by your description. If you already meshed the parts, I imagine they show up as mesh entities under Mesh in CFX-Pre. If you already created the domains using such parts, the domains should also show up on the outline tree, correct ?

If you want to set the initial temperature distribution within one of the domain you have defined, you can open the Domain Editor, Click on the Domain Initialization tab, and input your temperature (x,y,z) distribution via a CEL expression.

If you want to set the initial temperature distribution within a mesh region (2D, or 3D), you can do so by creating your CEL expression for the distribution, and multiply it by the "inside()@Locator" function. For example, let's assume you have mesh regions named "Part 1", and "Part 2", and you want to specify the temperature as a quadratic function in "Part 1", and cubic in "Part 2", you will input

Temperature = (x * x + y * y) * inside()@Part 1 + (x * x * x + y * y * y) * inside()@Part 2.

If you want to do so for domains, the syntax is similar:

Temperature = (x * x + y * y) * inside()@Domain 1 + (x * x + y * y) * inside()@Domain 2

or on 2D locators

Temperature = (x * x + y * y) * inside()@TheInlet + (x * x + y * y) * inside()@MyWall

In summary, if the coordinates describing your expressions match the mesh region boundaries, there is no need for IF statements anywhere.

Hope the above helps,
Opaque is offline   Reply With Quote

Old   May 8, 2014, 02:09
Default
  #10
Member
 
Nurzhan
Join Date: Jan 2014
Posts: 56
Rep Power: 12
Nurzhan is on a distinguished road
Quote:
If you already meshed the parts, I imagine they show up as mesh entities under Mesh in CFX-Pre. If you already created the domains using such parts, the domains should also show up on the outline tree, correct ?
I already simulated this problem by using domain interface and setting each part as a separate domain. However, when I will complicate my model the domain interface may cause some problem and mistakes in my calculations. Hence, I was trying to use another method to solve this problem and as it was proposed I tried IF function.

Your idea with "inside()@Locator" also sounds interesting, as "IF" function is quite "messy". Moreover, I personally found "IF" function quite inconvenient and limited, as its principle is IF(test, res1, res2) and I have to specify only one condition at test parameter.
Nurzhan 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
buoyantSimpleFoam and watertank Tobi OpenFOAM Running, Solving & CFD 100 December 18, 2022 08:15
a problem with convergence in buoyantSimpleFoam skuznet OpenFOAM Running, Solving & CFD 6 November 15, 2017 12:12
Extremely slow simulation with interDyMFoam jrrygg OpenFOAM Running, Solving & CFD 9 April 23, 2013 10:14
SLTS+rhoPisoFoam: what is rDeltaT??? nileshjrane OpenFOAM Running, Solving & CFD 4 February 25, 2013 04:13
Problems with simulating TurbFOAM barath.ezhilan OpenFOAM 13 July 16, 2009 05:55


All times are GMT -4. The time now is 21:37.