|
[Sponsors] |
September 28, 2017, 15:14 |
Varying Pressure Outlet with Field Function
|
#1 |
Member
Tate
Join Date: Feb 2015
Posts: 31
Rep Power: 11 |
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? |
|
October 9, 2017, 17:45 |
|
#2 |
Senior Member
Matt
Join Date: Aug 2014
Posts: 947
Rep Power: 18 |
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.
|
|
October 9, 2017, 18:08 |
|
#3 |
Member
Tate
Join Date: Feb 2015
Posts: 31
Rep Power: 11 |
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. |
|
October 10, 2017, 10:30 |
|
#4 |
Senior Member
Matt
Join Date: Aug 2014
Posts: 947
Rep Power: 18 |
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. |
|
October 10, 2017, 12:16 |
|
#5 | |||
Member
Tate
Join Date: Feb 2015
Posts: 31
Rep Power: 11 |
Quote:
Quote:
Quote:
|
||||
October 11, 2017, 10:42 |
|
#6 |
Senior Member
Matt
Join Date: Aug 2014
Posts: 947
Rep Power: 18 |
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.
|
|
October 11, 2017, 10:50 |
|
#7 |
Senior Member
Matt
Join Date: Aug 2014
Posts: 947
Rep Power: 18 |
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.
|
|
October 31, 2017, 19:39 |
|
#8 |
Member
Tate
Join Date: Feb 2015
Posts: 31
Rep Power: 11 |
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?
|
|
November 1, 2017, 09:04 |
|
#9 | |
Senior Member
Matt
Join Date: Aug 2014
Posts: 947
Rep Power: 18 |
Quote:
|
||
November 1, 2017, 09:44 |
|
#10 |
Senior Member
Matt
Join Date: Aug 2014
Posts: 947
Rep Power: 18 |
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 |
|
November 1, 2017, 11:25 |
|
#11 |
Member
Tate
Join Date: Feb 2015
Posts: 31
Rep Power: 11 |
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. |
|
November 1, 2017, 11:32 |
|
#12 |
Senior Member
Matt
Join Date: Aug 2014
Posts: 947
Rep Power: 18 |
If your table is defined in 0.01 s increments, does that mean your time step is also 0.01 s?
|
|
November 1, 2017, 11:33 |
|
#13 |
Member
Tate
Join Date: Feb 2015
Posts: 31
Rep Power: 11 |
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.
|
|
November 1, 2017, 11:37 |
|
#14 |
Senior Member
Matt
Join Date: Aug 2014
Posts: 947
Rep Power: 18 |
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. |
|
November 1, 2017, 11:39 |
|
#15 |
Member
Tate
Join Date: Feb 2015
Posts: 31
Rep Power: 11 |
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°.
|
|
|
|
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 06:16 |
Pressure inlet vs outlet position, transient, time dependent pressure and gravity | silent2608 | FLUENT | 0 | February 6, 2016 11:19 |
[mesh manipulation] Importing Multiple Meshes | thomasnwalshiii | OpenFOAM Meshing & Mesh Conversion | 18 | December 19, 2015 19:57 |
ParaView for OF-1.6-ext | Chrisi1984 | OpenFOAM Installation | 0 | December 31, 2010 07:42 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |