CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

Defining B.C. --> velocity profile

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 7, 2010, 12:52
Question Defining B.C. --> velocity profile
  #1
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 8
maysmech is on a distinguished road
Dear Foamers,

I need to define Driver and Seegmiller velocity inlet profile for backward facing step.


How can i write it in 0/U flie?
maysmech is offline   Reply With Quote

Old   September 7, 2010, 21:21
Default
  #2
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 418
Rep Power: 14
santiagomarquezd will become famous soon enough
Maysmech, groovBC is your friend:

http://openfoamwiki.net/index.php/Contrib_groovyBC

but you can write the boundary condition by hand using octave. You have to specify a nonuniform field with one vector per patch face in the boundaryField section of 0/U. In this case you have to know the face center coordinates for each cell and the faces indexes. Faces in the patch are ordered by face indexes, so you have to write the boundary values in the same order.

Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Post-doctoral Fellow
Research Center for Computational Mechanics (CIMEC) - CONICET/FICH-UNL
T.E.: 54-342-4511594 Ext. 1005
Güemes 3450 - (3000) Santa Fe
Santa Fe - Argentina
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   September 8, 2010, 02:09
Default
  #3
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 8
maysmech is on a distinguished road
Quote:
Originally Posted by santiagomarquezd View Post
Maysmech, groovBC is your friend:

http://openfoamwiki.net/index.php/Contrib_groovyBC

but you can write the boundary condition by hand using octave. You have to specify a nonuniform field with one vector per patch face in the boundaryField section of 0/U. In this case you have to know the face center coordinates for each cell and the faces indexes. Faces in the patch are ordered by face indexes, so you have to write the boundary values in the same order.

Regards.
Thanks for your reply.
your suggestions seems hard labor. is it other way to define B.C?
maysmech is offline   Reply With Quote

Old   September 8, 2010, 08:05
Default
  #4
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 418
Rep Power: 14
santiagomarquezd will become famous soon enough
Maysmech, there isn't a BC in FOAM that allows to load a profile directly putting the expression, this is the main objective of groovyBC. Because this tools is not included in original FOAM suite, you have to compile it. The other option is valid in all cases too, but more often used in simple ones.

Good luck.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Post-doctoral Fellow
Research Center for Computational Mechanics (CIMEC) - CONICET/FICH-UNL
T.E.: 54-342-4511594 Ext. 1005
Güemes 3450 - (3000) Santa Fe
Santa Fe - Argentina
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   September 8, 2010, 11:13
Default
  #5
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 8
maysmech is on a distinguished road
Quote:
Originally Posted by santiagomarquezd View Post
Maysmech, there isn't a BC in FOAM that allows to load a profile directly putting the expression, this is the main objective of groovyBC. Because this tools is not included in original FOAM suite, you have to compile it. The other option is valid in all cases too, but more often used in simple ones.

Good luck.
Thanks Santiago,
if i want use 2nd option, how should i use it?
i have less than 10 data for inlet. and i can expand it for inlet grids which has more than 200 grid with different sizes in excel software.
where can i define inlet B.C. only for inlet and what should be its format? other B.C. have standard types(fixed value, symmetry and ...)
Best,
maysmech is offline   Reply With Quote

Old   September 8, 2010, 16:41
Default
  #6
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 418
Rep Power: 14
santiagomarquezd will become famous soon enough
Maysmech, the only difficult thing with the second option is to know of index of patch faces. If the patch is meshed with an structured mesh, it probably be by row or column. For example if you have 20 faces in five rows of 4 faces each one, probably the numbering is 0-3 in the first row, etc.
This difficult appears due mesh info in /constant/polymesh doesn't include cells centers, this info is obtained on the fly at running time. Obviously you can obtain this info writing a simple tool.
Supposing you would have only one patch with 2 faces, you have to fill the boundaryField section like this:

boundaryField
{
inlet
{
type fixedValue;
value nonuniform List<vector>
2
(
(0 0 1)
(0 0 0.95)
);
}
}

The velocity vector have to be calculated from coordinates and velocity profile function.

Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Post-doctoral Fellow
Research Center for Computational Mechanics (CIMEC) - CONICET/FICH-UNL
T.E.: 54-342-4511594 Ext. 1005
Güemes 3450 - (3000) Santa Fe
Santa Fe - Argentina
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   September 10, 2010, 16:04
Thumbs up
  #7
Member
 
kiran Ambilpur
Join Date: Jun 2010
Posts: 34
Rep Power: 7
kiran is on a distinguished road
Send a message via Skype™ to kiran
Hi maysmech and santigo

use command writeCellcenters then use Cycellcenters then give velocity profile as santigo explained

this will fix your problem. its bit lengthy process but an easier way.

Regards
Ambilpur Kiran
kiran is offline   Reply With Quote

Old   September 10, 2010, 16:18
Default
  #8
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 418
Rep Power: 14
santiagomarquezd will become famous soon enough
kiran, I didn't know writeCellCentres command, it's good info. Strictly you need to know the faces center coordinates to calculate values in a patch. Is there a commando to do so? What is the other command you mentioned (Cycellcenters)?

Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Post-doctoral Fellow
Research Center for Computational Mechanics (CIMEC) - CONICET/FICH-UNL
T.E.: 54-342-4511594 Ext. 1005
Güemes 3450 - (3000) Santa Fe
Santa Fe - Argentina
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   September 10, 2010, 16:29
Thumbs up
  #9
Member
 
kiran Ambilpur
Join Date: Jun 2010
Posts: 34
Rep Power: 7
kiran is on a distinguished road
Send a message via Skype™ to kiran
Hi santiago
writeCellCenters command will generate three files namely Cx cellcenters, Cycellcenters and Czcellcenters in 0 directory.
so in order to give velocity profile u need only Y cell centers so use Cycellcenters file to give the velocity vectors.

so the problem is solved

Regards
Ambilpur Kiran
kiran is offline   Reply With Quote

Old   September 10, 2010, 16:40
Default
  #10
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 8
maysmech is on a distinguished road
Dear Kiran,

thank you very much for your help,

The command you told is very useful to know about order, position and coordination of needed cells.
i want to define inlet boundary conditions so i think i need boundary face coordinates and finding them becomes hard when grids have different sizes.
Is it any idea to find them?
maysmech is offline   Reply With Quote

Old   September 10, 2010, 16:42
Default
  #11
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 418
Rep Power: 14
santiagomarquezd will become famous soon enough
Kiran

Quote:
Originally Posted by kiran View Post
Hi santiago
writeCellCenters command will generate three files namely Cx cellcenters, Cycellcenters and Czcellcenters in 0 directory.
so in order to give velocity profile u need only Y cell centers so use Cycellcenters file to give the velocity vectors.
Aha, I tried the tool and it prints face cell centroids coordinates too. This is the info needed for B.C.

Thanx.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Post-doctoral Fellow
Research Center for Computational Mechanics (CIMEC) - CONICET/FICH-UNL
T.E.: 54-342-4511594 Ext. 1005
Güemes 3450 - (3000) Santa Fe
Santa Fe - Argentina
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   September 10, 2010, 16:52
Default
  #12
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 8
maysmech is on a distinguished road
Quote:
Originally Posted by santiagomarquezd View Post



Aha, I tried the tool and it prints face cell centroids coordinates too. This is the info needed for B.C.

Thanx.
You mean it prints cell center coordinates for internal field and face center coordinate for boundaries?
maysmech is offline   Reply With Quote

Old   September 10, 2010, 17:00
Default
  #13
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 418
Rep Power: 14
santiagomarquezd will become famous soon enough
Quote:
Originally Posted by maysmech View Post
You mean it prints cell center coordinates for internal field and face center coordinate for boundaries?
Yes, I tried with an example, and it did it.

Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Post-doctoral Fellow
Research Center for Computational Mechanics (CIMEC) - CONICET/FICH-UNL
T.E.: 54-342-4511594 Ext. 1005
Güemes 3450 - (3000) Santa Fe
Santa Fe - Argentina
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   September 12, 2010, 13:18
Lightbulb
  #14
Member
 
kiran Ambilpur
Join Date: Jun 2010
Posts: 34
Rep Power: 7
kiran is on a distinguished road
Send a message via Skype™ to kiran
hi maysmech

use that command then it generates three files as i explained earlier.

Open CyCellcenters file the scroll down u will find the cellcenters in the inlet, copy those to excel sheet.
These are your y distance in the boundary layer equation (you can choose any boundary layer equation accordind to your requirement). (in fact these are the Y locations from the boundary eg from wall )
so simply write the formula(boundary layer equation) in the another column to calculate velocity at that cellcenter.
The point where your velocity increases more than free stream or given inlet condition stop there and give the U~=(0.99u).

similarly take the cells from bottom reverse the formula then do it(if mesh is same then take same number of cells from bottom if not do as i explained).

this is what I can explain you at Maximum level.

hope you will try to do this and solve your problem.

Regards & Best of Luck
Ambilpur Kiran
kiran is offline   Reply With Quote

Old   September 12, 2010, 21:06
Default
  #15
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 418
Rep Power: 14
santiagomarquezd will become famous soon enough
I mostly agree, but the cy values bust be taken from inlet boundary, and the results in boundary of U too.

Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Post-doctoral Fellow
Research Center for Computational Mechanics (CIMEC) - CONICET/FICH-UNL
T.E.: 54-342-4511594 Ext. 1005
Güemes 3450 - (3000) Santa Fe
Santa Fe - Argentina
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Reply

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
[UDF] Relative coordinates in logarithmic velocity profile cfdworker Fluent UDF and Scheme Programming 24 February 23, 2015 05:33
UDF error - parabolic velocity profile - 3D turbine Zaqie Fluent UDF and Scheme Programming 8 May 11, 2014 08:34
[boundary condition] logarithmic velocity profile cfdworker FLUENT 2 April 17, 2009 23:36
Velocity Profile Jeff FLUENT 1 November 24, 2008 09:21
problem with velocity inlet profile file Duncan FLUENT 3 November 21, 2005 08:28


All times are GMT -4. The time now is 00:48.