CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > Siemens > STAR-CCM+

Varying Pressure Outlet with Field Function

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 28, 2017, 14:14
Default Varying Pressure Outlet with Field Function
  #1
Member
 
Tate
Join Date: Feb 2015
Posts: 31
Rep Power: 11
t8fanning is on a distinguished road
I'm modelling a pump with cavitation. The amount of cavitation is defined by the inlet pressure, but my inlet boundary condition is a mass flow inlet. Therefore, changing the value of the pressure outlet boundary condition indirectly defines the inlet pressure.

I'm trying to define the outlet pressure boundary condition with a field function to vary the outlet pressure to hit a target inlet pressure. The inlet pressure target varies with time. I think an if statement that checks the inlet pressure is the way to do it, but I'm struggling with actual implementation. I have also thought about using a user code, but I'm hoping that a field function will work as it seems easier.

Does anyone have any insight or advice on how to define this pressure outlet boundary condition?
t8fanning is offline   Reply With Quote

Old   October 9, 2017, 16:45
Default
  #2
Senior Member
 
Matt
Join Date: Aug 2014
Posts: 947
Rep Power: 17
fluid23 is on a distinguished road
Field functions should do the trick. The if-then statements probably aren't needed unless your inlet-outlet relationship is not C0 or C1 continuous. (i.e. a piece wise function). If you can explain a little more about this relationship I will try to be a little more specific.
fluid23 is offline   Reply With Quote

Old   October 9, 2017, 17:08
Default
  #3
Member
 
Tate
Join Date: Feb 2015
Posts: 31
Rep Power: 11
t8fanning is on a distinguished road
Thanks for the response. I've tried to find a solution with a macro as well as with field functions.

I was mistaken in my first post. In my simulation, the rotor rotation rate and the inlet mass flow rate change with time, but I need to maintain a constant inlet total pressure. So the outlet pressure will need to vary depending on how far the inlet pressure is from the target.

I've uploaded a txt file containing a java macro I wrote to loop through the following: perform an iteration, check inlet pressure and then adjust outlet pressure. In this case my target inlet pressure is 22820 Pa and the report P00 is a mass flow average of total pressure on the inlet, and P08 is a mass flow average of total pressure on the outlet.

I've also attempted using field functions. I made two field mean monitors to describe the average total pressure on the inlet and outlet, respectively. I then defined the following field function as the outlet pressure boundary condition:

($InletFieldMeanMonitor <= 22320) ? $OutletFieldMeanMonitor+100 : (($InletFieldMeanMonitor >= 23320) ? $OutletFieldMeanMonitor-100 : $OutletFieldMeanMonitor)

This attempts to keep the inlet total pressure in a 1 kPa band around 22820 Pa. However, the simulation fails to run as the field function cannot be computed.
Attached Files
File Type: txt change_outlet_pressure.txt (2.9 KB, 52 views)
t8fanning is offline   Reply With Quote

Old   October 10, 2017, 09:30
Default
  #4
Senior Member
 
Matt
Join Date: Aug 2014
Posts: 947
Rep Power: 17
fluid23 is on a distinguished road
Ok... Correct me if I am wrong (and maybe some images of your domain/regions would be helpful) but you have an inlet total pressure that is constant and a mass flow rate that varies with time. The varying mass flow results in a varying back pressure that you are trying to link to your inlet pressure. Does that sound about right?

If that is the case, put all this behind you and set up your inlet as a stagnation inlet. This will keep total pressure at your inlet constant. Then, depending on the physics of your problem, either setup a mass flow inlet or pressure outlet at the outlet of your domain. The mass flow inlet should use a field function that gives your mass flow vs time but returns a negative value (i.e. a negative inlet is an outlet). The other option, which is a little more robust but a little more cumbersome, is to use a pressure outlet with the target mass flow option turned on. This will essentially vary outlet pressure, within some bounds you specify, to match the mass flow target.

Also, I would caution you against setting up reports at a region boundary. Not sure if that's what you were doing, but that is generally bad practice. If you need flow data at those specific locations then you should extend or extrude your inlet/outlet away even further.
fluid23 is offline   Reply With Quote

Old   October 10, 2017, 11:16
Default
  #5
Member
 
Tate
Join Date: Feb 2015
Posts: 31
Rep Power: 11
t8fanning is on a distinguished road
Quote:
Originally Posted by MBdonCFD View Post
Ok... Correct me if I am wrong (and maybe some images of your domain/regions would be helpful) but you have an inlet total pressure that is constant and a mass flow rate that varies with time. The varying mass flow results in a varying back pressure that you are trying to link to your inlet pressure. Does that sound about right?
That is correct. I've attached an image of my domain.

Quote:
Originally Posted by MBdonCFD View Post
If that is the case, put all this behind you and set up your inlet as a stagnation inlet. This will keep total pressure at your inlet constant. Then, depending on the physics of your problem, either setup a mass flow inlet or pressure outlet at the outlet of your domain. The mass flow inlet should use a field function that gives your mass flow vs time but returns a negative value (i.e. a negative inlet is an outlet). The other option, which is a little more robust but a little more cumbersome, is to use a pressure outlet with the target mass flow option turned on. This will essentially vary outlet pressure, within some bounds you specify, to match the mass flow target.
That sounds like exactly what I want to do. I guess I didn't realize I could prescribe a negative mass flow at an outlet. I'm changing the inlet mass flow with a time table, so I'll just change all those values to negative. I'll also try the pressure outlet with mass flow target. Thank you.

Quote:
Originally Posted by MBdonCFD View Post
Also, I would caution you against setting up reports at a region boundary. Not sure if that's what you were doing, but that is generally bad practice. If you need flow data at those specific locations then you should extend or extrude your inlet/outlet away even further.
I was doing that, but setting up field means monitors. Is it bad practice because there is potential for unrealistic flow discontinuities at the boundaries?
Attached Images
File Type: jpg Pump_Geometry.jpg (30.7 KB, 30 views)
t8fanning is offline   Reply With Quote

Old   October 11, 2017, 09:42
Default
  #6
Senior Member
 
Matt
Join Date: Aug 2014
Posts: 947
Rep Power: 17
fluid23 is on a distinguished road
Not so much flow discontinuities, but mis-represented flow. You want to be far enough a way from the boundary conditions that whatever you are looking at is being influenced by your geometry rather than what you have prescribed at your boundary... if that makes any sense.
fluid23 is offline   Reply With Quote

Old   October 11, 2017, 09:50
Default
  #7
Senior Member
 
Matt
Join Date: Aug 2014
Posts: 947
Rep Power: 17
fluid23 is on a distinguished road
Just glancing at your domain shot, you might want to move your inlet further upstream (large diameter end). Since you are using a stagnation inlet you will need to provide time for the flow to develop.
fluid23 is offline   Reply With Quote

Old   October 31, 2017, 18:39
Default
  #8
Member
 
Tate
Join Date: Feb 2015
Posts: 31
Rep Power: 11
t8fanning is on a distinguished road
Thanks so much for the help. Your suggestion to use a stagnation inlet and a mass flow inlet for the outlet seems to be working well. I am running into another problem though. I can't seem to figure out how to change the rotation rate with time. Both rotating reference frames and rotating motions seem to only take a constant value for rotation. Any idea how to work around this?
t8fanning is offline   Reply With Quote

Old   November 1, 2017, 08:04
Default
  #9
Senior Member
 
Matt
Join Date: Aug 2014
Posts: 947
Rep Power: 17
fluid23 is on a distinguished road
Quote:
Originally Posted by t8fanning View Post
Thanks so much for the help. Your suggestion to use a stagnation inlet and a mass flow inlet for the outlet seems to be working well. I am running into another problem though. I can't seem to figure out how to change the rotation rate with time. Both rotating reference frames and rotating motions seem to only take a constant value for rotation. Any idea how to work around this?
I will look into it. Can you provide a little info on how it changes? Is it a ramp, a step function, sinusoidal, random?
fluid23 is offline   Reply With Quote

Old   November 1, 2017, 08:44
Default
  #10
Senior Member
 
Matt
Join Date: Aug 2014
Posts: 947
Rep Power: 17
fluid23 is on a distinguished road
Looking at the help files, I think you are going to want to use user-defined vertex motion. This allows you to specify a location for a vertex at each time step. I am not familiar with it, so I will not be much help. You can read up on it yourself...

User Guide > Star-CCM+ > Simulating Physics > Modeling Space, Time and Motion > Modeling Motion > Working with User-Defined Vertex Motion
fluid23 is offline   Reply With Quote

Old   November 1, 2017, 10:25
Default
  #11
Member
 
Tate
Join Date: Feb 2015
Posts: 31
Rep Power: 11
t8fanning is on a distinguished road
I'll look into user defined vertex motion. Thanks.

I've attached an image of the time vs rotational speed curve I'm trying to match.

I've digitized the curve and put it in a table with increments of 0.01 s. I imported the table into my simulation and wrote a field function that I think will work:

interpolateTable(@Table("10879 Flow and Speed v2"), "Time", SPLINE, "N2", $Time)

This came from "Working with Table Values Through Field Functions" in the user help files.

I'm still testing it, so I'm not sure if it works yet.
Attached Images
File Type: jpg image001.jpg (65.2 KB, 16 views)
t8fanning is offline   Reply With Quote

Old   November 1, 2017, 10:32
Default
  #12
Senior Member
 
Matt
Join Date: Aug 2014
Posts: 947
Rep Power: 17
fluid23 is on a distinguished road
If your table is defined in 0.01 s increments, does that mean your time step is also 0.01 s?
fluid23 is offline   Reply With Quote

Old   November 1, 2017, 10:33
Default
  #13
Member
 
Tate
Join Date: Feb 2015
Posts: 31
Rep Power: 11
t8fanning is on a distinguished road
No. My time step is 0.0001 s, but as I understand it, the field function should be interpolating between each table value for a rotational rate at each time step.
t8fanning is offline   Reply With Quote

Old   November 1, 2017, 10:37
Default
  #14
Senior Member
 
Matt
Join Date: Aug 2014
Posts: 947
Rep Power: 17
fluid23 is on a distinguished road
Ok... Just wanted to make sure. Typically 1 degree per time step is a good choice and it looks like you are even a little better than that.

Good luck.
fluid23 is offline   Reply With Quote

Old   November 1, 2017, 10:39
Default
  #15
Member
 
Tate
Join Date: Feb 2015
Posts: 31
Rep Power: 11
t8fanning is on a distinguished road
Thanks. I usually aim for 0.5° per time step just to be sure, but this mesh is pretty large so I tried for a bit closer to 1°.
t8fanning 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
how can make normal shock in the nozzle at inlet B.C : Pressure Far field SonicGhoul FLUENT 2 May 8, 2016 05:16
Pressure inlet vs outlet position, transient, time dependent pressure and gravity silent2608 FLUENT 0 February 6, 2016 10:19
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 18:57
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 06:42
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50


All times are GMT -4. The time now is 04:57.