CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Defining B.C. --> velocity profile (http://www.cfd-online.com/Forums/openfoam/79886-defining-b-c-velocity-profile.html)

maysmech September 7, 2010 12:52

Defining B.C. --> velocity profile
 
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?

santiagomarquezd September 7, 2010 21:21

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.

maysmech September 8, 2010 02:09

Quote:

Originally Posted by santiagomarquezd (Post 274359)
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?

santiagomarquezd September 8, 2010 08:05

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.

maysmech September 8, 2010 11:13

Quote:

Originally Posted by santiagomarquezd (Post 274433)
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,

santiagomarquezd September 8, 2010 16:41

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.

kiran September 10, 2010 16:04

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

santiagomarquezd September 10, 2010 16:18

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.

kiran September 10, 2010 16:29

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

maysmech September 10, 2010 16:40

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?

santiagomarquezd September 10, 2010 16:42

Kiran

Quote:

Originally Posted by kiran (Post 274808)
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.

maysmech September 10, 2010 16:52

Quote:

Originally Posted by santiagomarquezd (Post 274810)



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?

santiagomarquezd September 10, 2010 17:00

Quote:

Originally Posted by maysmech (Post 274811)
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.

kiran September 12, 2010 13:18

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

santiagomarquezd September 12, 2010 21:06

I mostly agree, but the cy values bust be taken from inlet boundary, and the results in boundary of U too.

Regards.


All times are GMT -4. The time now is 02:57.