# Defining B.C. --> velocity profile

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

 September 7, 2010, 12:52 Defining B.C. --> velocity profile #1 Senior Member     Join Date: Jan 2010 Posts: 347 Blog Entries: 2 Rep Power: 17 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?

 September 7, 2010, 21:21 #2 Senior Member     Santiago Marquez Damian Join Date: Aug 2009 Location: Santa Fe, Santa Fe, Argentina Posts: 452 Rep Power: 24 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. Research Scientist Research Center for Computational Methods (CIMEC) - CONICET/UNL Tel: 54-342-4511594 Int. 7032 Colectora Ruta Nac. 168 / Paraje El Pozo (3000) Santa Fe - Argentina. http://www.cimec.org.ar

September 8, 2010, 02:09
#3
Senior Member

Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 17
Quote:
 Originally Posted by santiagomarquezd 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.
your suggestions seems hard labor. is it other way to define B.C?

 September 8, 2010, 08:05 #4 Senior Member     Santiago Marquez Damian Join Date: Aug 2009 Location: Santa Fe, Santa Fe, Argentina Posts: 452 Rep Power: 24 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. Research Scientist Research Center for Computational Methods (CIMEC) - CONICET/UNL Tel: 54-342-4511594 Int. 7032 Colectora Ruta Nac. 168 / Paraje El Pozo (3000) Santa Fe - Argentina. http://www.cimec.org.ar

September 8, 2010, 11:13
#5
Senior Member

Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 17
Quote:
 Originally Posted by santiagomarquezd 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,

 September 8, 2010, 16:41 #6 Senior Member     Santiago Marquez Damian Join Date: Aug 2009 Location: Santa Fe, Santa Fe, Argentina Posts: 452 Rep Power: 24 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 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. Research Scientist Research Center for Computational Methods (CIMEC) - CONICET/UNL Tel: 54-342-4511594 Int. 7032 Colectora Ruta Nac. 168 / Paraje El Pozo (3000) Santa Fe - Argentina. http://www.cimec.org.ar

 September 10, 2010, 16:04 #7 Member   kiran Ambilpur Join Date: Jun 2010 Location: India Posts: 50 Rep Power: 16 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

 September 10, 2010, 16:18 #8 Senior Member     Santiago Marquez Damian Join Date: Aug 2009 Location: Santa Fe, Santa Fe, Argentina Posts: 452 Rep Power: 24 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. Research Scientist Research Center for Computational Methods (CIMEC) - CONICET/UNL Tel: 54-342-4511594 Int. 7032 Colectora Ruta Nac. 168 / Paraje El Pozo (3000) Santa Fe - Argentina. http://www.cimec.org.ar

 September 10, 2010, 16:29 #9 Member   kiran Ambilpur Join Date: Jun 2010 Location: India Posts: 50 Rep Power: 16 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

 September 10, 2010, 16:40 #10 Senior Member     Join Date: Jan 2010 Posts: 347 Blog Entries: 2 Rep Power: 17 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?

September 10, 2010, 16:42
#11
Senior Member

Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 24
Kiran

Quote:
 Originally Posted by 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.
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.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar

September 10, 2010, 16:52
#12
Senior Member

Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 17
Quote:
 Originally Posted by santiagomarquezd 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?

September 10, 2010, 17:00
#13
Senior Member

Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 24
Quote:
 Originally Posted by maysmech 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.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar

 September 12, 2010, 13:18 #14 Member   kiran Ambilpur Join Date: Jun 2010 Location: India Posts: 50 Rep Power: 16 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

 September 12, 2010, 21:06 #15 Senior Member     Santiago Marquez Damian Join Date: Aug 2009 Location: Santa Fe, Santa Fe, Argentina Posts: 452 Rep Power: 24 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. Research Scientist Research Center for Computational Methods (CIMEC) - CONICET/UNL Tel: 54-342-4511594 Int. 7032 Colectora Ruta Nac. 168 / Paraje El Pozo (3000) Santa Fe - Argentina. http://www.cimec.org.ar