CFD Online URL
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Cyclic boundary condition for dnsFoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes
  • 1 Post By wyldckat
  • 2 Post By chegdan

Reply
 
LinkBack Thread Tools Display Modes
Old   February 28, 2013, 11:22
Default Cyclic boundary condition for dnsFoam
  #1
New Member
 
Antoine Piedfert
Join Date: Feb 2013
Posts: 1
Rep Power: 0
antoinep76 is on a distinguished road
Hi everyone,
I am trying to simulate a channel flow with dnsFoam. I successfully added the transport equation for a passive scalar to simulate the temperature. Since I need to get a stationary flow, I chose cyclic boundary conditions instead of an inlet and an outlet.

My problem is: I don't want the temperature to be cyclic, but it is impossible to create a cyclic velocity field and a non cyclic temperature field only by modifying the case. So I tried to modify the source as follows:


fvScalarMatrix TEqn
(
fvm::ddt(T)
+ fvm::div(phi, T)
- fvm::laplacian(DT, T)
);


TEqn.solve();

// force inlet T=300 K
label patchi = mesh.boundaryMesh().findPatchID("inlet");
T.boundaryField()[patchi] = 300. ;

runTime.write();

(extract from my_dnsFoam.C)

I wanted the temperature at the inlet patch to become equal to 300K, but it didn't work at all. Do you have any idea why? And do you have a solution for my problem?

Thank you.
antoinep76 is offline   Reply With Quote

Old   March 2, 2013, 08:33
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,511
Blog Entries: 33
Rep Power: 74
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
Greetings Antoine and welcome to the forum!

I'm not very familiar on the full range of how cyclic patches can be used, but "cyclicFan" comes to mind. Check the tutorial "incompressible/pimpleFoam/TJunctionFan". This will probably mean that you'll need to implement a new boundary condition for this.

Additionally, I think I've seen this question more than once here in the forum...

Best regards,
Bruno
anishtain4 likes this.
wyldckat is offline   Reply With Quote

Old   March 2, 2013, 15:20
Default
  #3
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Posts: 124
Rep Power: 7
anishtain4 is on a distinguished road
You can't achieve this the way you did it because there is a boundaryCorrection somewhere in the solver which returns the values on boundary by the other side of cyclic bc condition.
Look up the forum, as wyldcat said this question has been addressed more than once.
anishtain4 is offline   Reply With Quote

Old   March 4, 2013, 12:30
Default
  #4
Senior Member
 
chegdan's Avatar
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 525
Rep Power: 17
chegdan will become famous soon enough
Both Wyldckat and anishtain4 are correct in that cyclic isn't what you need. One way around this is to use something like a mapped boundary condition. The values at the outlet of your field (e.g. momentum) are mapped to your inlet to create a pseudo-cyclic BC. I say pseudo because its essentailly one-way coupled and nothing from the inlet will be mapped to the outlet like they would be in pure cyclic. You can add a flow rate to the mapped BC have the flow inlet velocity scaled to a certain value and use regular pressure boudnary conditions. The beauty is that you can use fixedValue and other BCs for other variables i.e. you wont need to make some variables cyclic or pseudo-cyclic. Search for mapped, directMapped bcs (I believe directMapped became mapped in newer versions of OpenFOAM).
wyldckat and mgg like this.
__________________
Dan

Find me on twitter @dancombest

Last edited by chegdan; March 4, 2013 at 17:50.
chegdan is offline   Reply With Quote

Old   March 15, 2013, 08:21
Default
  #5
Senior Member
 
Julien
Join Date: Jun 2012
Location: France
Posts: 150
Rep Power: 4
Djub is on a distinguished road
Hi Chegdan,
You say "you can [...] use regular pressure boudnary conditions". Saying U=mapped and p=zeroGradient ?
In my opinion, the NS equations are linking both fields. You should not take V without P! For example, there is an under-pressure in the core of a large vortex. If you map U-field, you must have also this depressure, mustn't you? Thus you should have to map also P it in the inlet. Or maybe the NS solver is able to reconstruct it thanks to U-field?
I am still doubtfull, because within the calculated domain, from where you extract the V field, pressure field has no reason to be zerogradient. So it could create a kind of C0 discontinuity (continuous P with discontinuity in grap P).
I know majority of people, including tutorials, are working like this. So maybe I am missing something but I don't find what...
Can I have your opinion about this?
Djub is offline   Reply With Quote

Old   March 15, 2013, 15:59
Default
  #6
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Posts: 124
Rep Power: 7
anishtain4 is on a distinguished road
in a channel flow you use constant gradient not zero gradient, this value is what determines your flow rate once it reaches a steady state
anishtain4 is offline   Reply With Quote

Old   March 17, 2013, 09:19
Default
  #7
Senior Member
 
chegdan's Avatar
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 525
Rep Power: 17
chegdan will become famous soon enough
I was using pressure as a classic example of a situation where you could use cyclic on one variable (i.e. U) and fixedValue/zeroGradient on another (i.e. pressure). You could map all variables to the inlet and have a constant pressure gradient from your channel inlet to the outlet. Again, these will be one-way coupled from the outlet to the inlet.

Quote:
Originally Posted by Djub View Post
Hi Chegdan,
You say "you can [...] use regular pressure boudnary conditions". Saying U=mapped and p=zeroGradient ?
In my opinion, the NS equations are linking both fields. You should not take V without P! For example, there is an under-pressure in the core of a large vortex. If you map U-field, you must have also this depressure, mustn't you? Thus you should have to map also P it in the inlet. Or maybe the NS solver is able to reconstruct it thanks to U-field?
I am still doubtfull, because within the calculated domain, from where you extract the V field, pressure field has no reason to be zerogradient. So it could create a kind of C0 discontinuity (continuous P with discontinuity in grap P).
I know majority of people, including tutorials, are working like this. So maybe I am missing something but I don't find what...
Can I have your opinion about this?
__________________
Dan

Find me on twitter @dancombest
chegdan is offline   Reply With Quote

Old   March 18, 2013, 06:54
Default
  #8
Senior Member
 
Julien
Join Date: Jun 2012
Location: France
Posts: 150
Rep Power: 4
Djub is on a distinguished road
Thanks both for your answers,
By the way, I still don't understand everything.
Within the flow, from where you are mapping pressure has no reason to be homogenous ans constant. In the middle of biggest vortices, the pressure is low (as in the core of a hurricane). So around a vortex, the grad P vector is pointing outside of the vortex. Its x-component (// to the flow, normal to the mapped plane) is non uniform, and due to Taylor's hypothesis, it is changing in time. Thus, forcing the inlet to be with a uniform and constant grad P sounds strange for me. This condition makes a flow different from the one within the flow (mapped plane). Do you agree?
Djub is offline   Reply With Quote

Reply

Tags
cyclic bc, dnsfoam, temperature

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
cyclic boundary condition flotran OpenFOAM 3 December 19, 2011 21:13
can I use cyclic boundary condition to modeling axisymmetric flow ? mechy OpenFOAM 0 July 8, 2011 15:16
vorticity boundary condition bearcharge Main CFD Forum 0 May 14, 2010 12:32
cyclic boundary condition doesn't work in a tube ?? Cyp OpenFOAM 6 April 16, 2010 16:21
fan cyclic boundary condition leejc OpenFOAM 0 April 15, 2010 17:38


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