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

how to have a changing boundary condition at the in let of a tube

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By `e`

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 22, 2018, 14:04
Unhappy how to have a changing boundary condition at the in let of a tube
  #1
New Member
 
karri Veerandra Yadav
Join Date: Jul 2016
Posts: 2
Rep Power: 0
YADAVRAJA is on a distinguished road
I have a tube as shown in the attachment, which as a open end and a close end , open end is connected to a high pressure source of pressure 5 bar for a time period of 0.005 sec and for closed for a time of 0.0001 sec and again connected to a low pressure source of 1 bar for again a time period of 0.002 sec.
Is it possible to write a udf to change a boundary condition at the open end of the pipe from pressure inlet ( for a time period of 0.005 Sec) to wall (for a time period of 0.0001 Sec) to pressure outlet ( for a time period of 0.002 Sec).
i.e. the pipe open end must act as a pressure inlet (for a given time period), then it must change to a wall Boundary condition (for a given time period), and after that it must change to pressure out let (for a given time period). and soo on
Attached Images
File Type: png Untitled.png (4.7 KB, 17 views)
YADAVRAJA is offline   Reply With Quote

Old   June 22, 2018, 15:18
Default
  #2
Senior Member
 
Join Date: Dec 2016
Posts: 152
Rep Power: 10
RaiderDoctor is on a distinguished road
I don't know about how to do this with a UDF, but you can do it manually! There's also a way to do it with "Events", but I haven't really played around with that too much. The basic idea is that you want to break your simulation up into phases that feature the different boundary conditions. You will change the conditions at the end of the time step previous to when you want your conditions to take effect, and then continue the calculation.The steps really aren't that hard once you do it once or twice, but learning it based on text alone might be tricky. I'm going to give it a try anyway.

1.) Set the inlet as the first boundary (pressure inlet of 5 bar).

2.) Run the simulation for 0.005 s.

3.) Close Fluent, and save your project.

4.) Open the Solution section on the Fluent module (I'm assuming you are working from workbench).

5.) Click File, Solution Files. A new menu should appear called "Solution Files". Ensure that your last time step is selected (0.005 s). Close the Solution Files menu.

6.) Go to the Boundary Conditions section on the Tree. Click your inlet, and switch the Type to "wall".

7.) Click File, Export, Case and Data. This will bring up a save menu with all of your previous solution files in it. This is important, do not change the name of the case file. You want to continue calculation from it with one minor change. Click okay and nothing else. This will cause Fluent to say something along the lines of "Okay to overwrite case and data?". Click Yes, and wait for Fluent to finish writing the case and data files. Don't initialize or anything, it is already initialized from the previous simulation.

8.) Run the simulation for a period of 0.0001 s (or however long you need the inlet to be set as a wall).

9.) Repeat steps 5-8 for changing the inlet boundary condition again.

Let me know if this works out for you!
RaiderDoctor is offline   Reply With Quote

Old   June 23, 2018, 02:06
Default
  #3
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
The task of changing the boundary conditions during a simulation can be performed automatically using a Scheme script, called with a Calculation Activity.

Quote:
Originally Posted by jpina View Post
For changing a boundary condition at a time t:

Create a .scm file with the following content:

(if (> (rpgetvar' flow-time) 0.05)
; Set que inlet_velocity boundary to pressure-inlet
(ti-menu-load-string "define/boundary-conditions/zone-type inlet_velocity pressure-inlet")
; Set the pressure value to 6000000
(ti-menu-load-string "define/boundary-conditions pressure-inlet inlet_velocity mixture yes no 6000000 no 0 no 300 no yes")
)

In the Calculation Activities make this scheme file be executed every time_step with:

(load "velocity_to_pressure_inlet.scm")
For discussions, see UDF: Change boundary condition. Velocity inlet to pressure inlet at time "t" and Changing Boundary Condition Types via Scheme/UDF.
RaiderDoctor likes this.
`e` 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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
Out File does not show Imbalance in % Mmaragann CFX 5 January 20, 2017 11:20
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 08:00
External Radiation Boundary Condition (Two sided wall), Grid Interface CFD XUE FLUENT 0 July 8, 2010 07:49
cyclic boundary condition doesn't work in a tube ?? Cyp OpenFOAM 6 April 16, 2010 16:21


All times are GMT -4. The time now is 02:05.