|
[Sponsors] |
Time varying pressure gradient for channel flow |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 1, 2023, 09:04 |
Time varying pressure gradient for channel flow
|
#1 |
Senior Member
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 16 |
Dear Foamers,
I am struggling to find a way through which I could impose time varying pressure gradient in the channel flow, I looked this website and got some clue, but unable to get the code running, I tried to impose using the following ways in fvoptions: 1. Using Code:
vectorCodedSource 2. Using Code:
vectorSemiImplicitSource I am tired of trying both the ways, but none is working. If would be very much kind and helpful if anyone could at least let me know which way to move forward, then I would try to concentrate and focus on that. Any help/comment/suggestion would be very much appreciated, many thanks in advance. Happy New Year -2022! |
|
January 1, 2023, 10:10 |
|
#2 |
Senior Member
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 16 |
Hi again,
Using the first way, i.e. Code:
vectorCodedSource Code:
topoSet Then I know the pressure gradient (let us say 1) in the streamwise direction and put inside that value inside the Code:
vectorCodedSource Code:
USource[celli] += vector(1, 0,0 ); 1. Am I doing the toposet correctly? If not then how could I select the inlet face as the source for the pressure gradient term? 2. Using vectorCodedSource, should I multiply the pressure gradient term with the length of channel to get the force to be applied in the Code:
USource[celli] += Code:
vectorSemiImplicitSource Code:
pressureGradient { type vectorSemiImplicitSource; selectionMode all; volumeMode specific; injectionRateSuSp { U ((1 0 0) 0); } } |
|
January 2, 2023, 04:52 |
|
#3 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14 |
I am a bit puzzled about what you are trying to achieve, since you refer to patches, ie boundary conditions.
When I started reading your first post, I thought that you were trying to apply a global pressure gradient, to balance the wall shear ... and to make that time varying. Is that the case? If so, then this has nothing to do with the boundary conditions, but must be applied to the whole domain through a source term - eg vectorSemiImplicitSource. Perhaps you can apply a table to the source value, to get the time variation - I am not sure what OF version you are applying. Either that, or generate your own version of the solver and just code in the time variation into the solver. If you are trying to do something else, then you'll need to explain it a bit more, I am afraid. Good luck! |
|
January 2, 2023, 05:03 |
|
#4 |
Senior Member
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 16 |
Hi Tobermory,
Good morning and many thanks for your response, yes you are correct I am trying to impose (time varying periodic with respect to time ) pressure gradient to balance the wall shear force. As you stated that this could be done using Code:
vectorSemiImplicitSource So then I looked at the Code:
vectorCodedSource |
|
January 2, 2023, 05:11 |
|
#5 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14 |
Aaah - okay - I understand now. I don't think that your idea of "applying the total force" at the inlet will work ... and certainly not in the way that you are envisaging. Are you using cyclic boundary conditions in the streamwise direction? If this is an incompressible fluid simulation, then the source term approach should be more robust.
If it's compressible flow, then you probably want to be applying a pressure boundary conditions at the upstream end ... and it all gets complicated. Assuming it's incompressible, I would suggest tring a table for the source value, and if that doesn't work then the simplest would be to just write your own solver as I suggested in my earlier post. |
|
January 2, 2023, 05:18 |
|
#6 |
Senior Member
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 16 |
Hi again,
Many thanks for your consistent help, support and cooperation. Sorry I forgot to mention that it's an in-compressible flow. So, my follow up questions would be: 1. Is it not possible to use Code:
vectorSemiImplicitSource 2. Could you please give some help for modifying or writing a code for that ? 3. What is physically or computationally wrong in providing the total force at the inlet ? Sorry for asking multiple queries, but for last couple of weeks I am trying to figure this out but had failed and gave a try on this forum, hope you understand my situation, thanks again. |
|
January 2, 2023, 05:34 |
|
#7 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14 |
1. Yes - this seems the best approach to me. Look at the DOxygen entry for the class (https://cpp.openfoam.org/v8/classFoa...e.html#details) and you'll see that they use a table entry for the source value, which was the approach that I suggested. My suggestion is to follow this route.
2. If you wanted to code it up yourself, just add the coding for the time function that you want to apply in the solver loop, for whatever solver you are using. This is probably a more involved task, since you'll need ro learn some basic coding skills ... it will be useful for you in the future though if you want to continue using OF. 3. You can't apply it as a surface condition since the pressure gradient is a body force. Ask yourself, for example, how you would apply the effect of gravity by only using forces on the domain surface. |
|
January 2, 2023, 06:00 |
|
#8 |
Senior Member
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 16 |
Hello again,
Thanks again for your help and sharing the link. I am afraid that I could import a table, since the pressure gradient needs to be on and off for certain cycles, and it needs to be for the whole simulations, thus I would assume that table approach won't be that beneficial (if I understand correctly then through the table we can import only limited cycles, which ever are given as input in the table). But I would guess that Code:
type coded; 1. This could be used for vector field also ? 2. Will it work for OpenFOAM v1906 and/or v 2112 ? Any further comment/suggestion would be helpful, thanks again, highly appreciate your comments. |
|
January 2, 2023, 06:46 |
|
#9 | |
Senior Member
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 16 |
Quote:
I artificially created a box of size (inletptach = ly \times lz) \times dx, here dx is in the streamwise grid size and ly, lz are the total domain length in the wall height and spanwise direction. And then after generating this in Code:
topoSetDict Code:
vectorCodedSource |
||
January 14, 2023, 08:25 |
|
#10 |
Senior Member
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 16 |
Hi again,
Thanks a lot for your help and support, I guess I figured this out and posted a detailed solution in Could pressure gradient be modelled as "vectorCodedSource" in fvoptions at inlet |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
courant number increases to rather large values | 6863523 | OpenFOAM Running, Solving & CFD | 22 | July 5, 2023 23:48 |
Issues on the simulation of high-speed compressible flow within turbomachinery | dowlee | OpenFOAM Running, Solving & CFD | 11 | August 6, 2021 06:40 |
AMI speed performance | danny123 | OpenFOAM | 21 | October 24, 2020 04:13 |
Micro Scale Pore, icoFoam | gooya_kabir | OpenFOAM Running, Solving & CFD | 2 | November 2, 2013 13:58 |
IcoFoam parallel woes | msrinath80 | OpenFOAM Running, Solving & CFD | 9 | July 22, 2007 02:58 |