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

Controlling pressure drop with source terms

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 16, 2016, 14:28
Question Controlling pressure drop with source terms
  #1
Member
 
Howard
Join Date: Jun 2012
Posts: 43
Rep Power: 14
twcp0104 is on a distinguished road
Hello!!!

So, I'm trying to simulate a filter and to do that I need to be able to control the pressure drop across a narrow region. I've been trying to do that by using a source term and the DEFINE_SOURCE macro. My problem has been that I can't seem to specify the delta P values. For example:

DEFINE_SOURCE(cake_resist_x,c,t,dS,eqn)
{
real source;
real dx=0.01;

source=-1/dx;
return source;
}

I'm applying this momentum source on the first layer of cell next to a surface. So the dx variable represents the depth of that first layer (each cell is like a cube of side 0.01). I expect that the value of the pressure drop between the inlet and outlet to be eventually 1. And it does converge to a value, but it is never very precise and it never gets to 1. Usually it goes to 0.5.

So that's my problem. I need to control the pressure drop between the inlet and the outlet. I've been trying with a source term but it doesnt seem to be working very well or very precisely.

Has anyone done something like this? Am I missing something obvious? Is there a better way? Am I ignoring some variable that effects the delta P other than the source term? My understanding is that:

source*DX=dP

where DX is the distance over which the source term is applied and dP is the pressure diffference that this adds.

Any ideas are welcome
twcp0104 is offline   Reply With Quote

Old   December 16, 2016, 14:40
Default
  #2
Member
 
Howard
Join Date: Jun 2012
Posts: 43
Rep Power: 14
twcp0104 is on a distinguished road
So, I attached a graph of the pressure drop as a function of time... I start to apply the source term at 0.1 s into the simulation. and this is running a source term very similar to the one above.

A bit more info: the mesh is basically rectangular, with the inlet a square 1 m2, then 0.1 m forward a porous jump with 0 dp and 0.1 m after the outlet; the fluid speed is 0.1 m/s; fluid is air; energy equation off; laminar; the walls dont add friction;
Attached Images
File Type: png Untitled.png (5.5 KB, 35 views)
twcp0104 is offline   Reply With Quote

Old   December 19, 2016, 09:16
Default
  #3
Senior Member
 
Kevin
Join Date: Dec 2016
Posts: 138
Rep Power: 10
KevinZ09 is on a distinguished road
Can't you simply use a Porous Jump boundary condition if all you want to do is to reproduce a pressure drop?
KevinZ09 is offline   Reply With Quote

Old   December 20, 2016, 06:37
Default
  #4
Member
 
Howard
Join Date: Jun 2012
Posts: 43
Rep Power: 14
twcp0104 is on a distinguished road
That was my first thought... unfortunately I can't figure out how to link the pressure drop of the porous jump to the "mass" saved in the UDMI. Do you know how to change the dP of a pressure drop using a UDF?
twcp0104 is offline   Reply With Quote

Old   December 20, 2016, 10:55
Default
  #5
Senior Member
 
Kevin
Join Date: Dec 2016
Posts: 138
Rep Power: 10
KevinZ09 is on a distinguished road
I don't think you can hook an UDF to the input parameters of a Porous Jump. I've never done anything like that. You can do it with a Porous Zone however. You probably achieve something similar as a Porous Jump with a Porous Zone. Just let your inertial resistance parameter depend on the streamwise coordinate, and create for example a block function, where it has a desired value over a narrow region and zero outside of that region.

Not sure if this is any helpful though. I'd need more details in order to try to help you out better.
KevinZ09 is offline   Reply With Quote

Old   December 20, 2016, 21:22
Default
  #6
Member
 
Howard
Join Date: Jun 2012
Posts: 43
Rep Power: 14
twcp0104 is on a distinguished road
That's very helpful... I have been using a source term, but a porous zone might work better... do you know if you can modify the resistance values from within the code? Do you have any examples?
twcp0104 is offline   Reply With Quote

Old   December 21, 2016, 07:18
Default
  #7
Senior Member
 
Kevin
Join Date: Dec 2016
Posts: 138
Rep Power: 10
KevinZ09 is on a distinguished road
I've never used an UDF for the resistance factors myself, but you can connect a profile to it so you've got all the freedom to do with the factors as you'd have with an inlet condition for example. So you can have it depend on your coordinates, or some flow properties. Not sure what else you'd mean with "modify the resistance values from within the code"?
KevinZ09 is offline   Reply With Quote

Old   December 21, 2016, 09:07
Default
  #8
Member
 
Howard
Join Date: Jun 2012
Posts: 43
Rep Power: 14
twcp0104 is on a distinguished road
I meant control the resistance factor... just what you said... So I tried last night: unfortunately I can't seem to hook the macro to fluent... The idea is to go to the fluid zone you want, turn on porous zone, and then go to the resistance factors and change from "constant" to "user defined function". That second option doesn't show up... any ideas?
twcp0104 is offline   Reply With Quote

Old   December 21, 2016, 09:31
Default
  #9
Senior Member
 
Kevin
Join Date: Dec 2016
Posts: 138
Rep Power: 10
KevinZ09 is on a distinguished road
Did you use the DEFINE_PROFILE macro? And did you compile it? If so, what Fluent version are you using? I'm using Fluent 15 and I see the UDF option whenever I compiled a DEFINE_PROFILE macro.
KevinZ09 is offline   Reply With Quote

Old   December 21, 2016, 10:24
Default
  #10
Member
 
Howard
Join Date: Jun 2012
Posts: 43
Rep Power: 14
twcp0104 is on a distinguished road
Actually... yeah... i got it... ill try and get back to you guys... thanks a bunch
twcp0104 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
Custom Thermophysical Properties wsmith02 OpenFOAM 4 June 1, 2023 15:30
question regarding LES of pipe flow - pimpleFoam Dan1788 OpenFOAM Running, Solving & CFD 37 December 26, 2017 15:42
polynomial BC srv537 OpenFOAM Pre-Processing 4 December 3, 2016 10:07
[OpenFOAM.org] Error creating ParaView-4.1.0 OpenFOAM 2.3.0 tlcoons OpenFOAM Installation 13 April 20, 2016 18:34
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 02:24


All times are GMT -4. The time now is 18:55.