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

Velocity profile

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 23, 2006, 06:54
Default Hi, basic question: How do
  #1
Member
 
Anja Stretz
Join Date: Mar 2009
Posts: 92
Rep Power: 8
anja is on a distinguished road
Hi,

basic question:
How do you implement a velocity profile on an area for an inlet?

Anja
anja is offline   Reply With Quote

Old   March 23, 2006, 07:45
Default Have a look at the documentati
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
hjasak will become famous soon enough
Have a look at the documentation - we used to have a little tool that would take a graph and interpolate the data onto the inlet patch for the purpose you describe. The class used for it is called interpolateXY and lives in src/sampling/interpolateXY/interpolateXY.H but I cannot dig out the actual utility code at the moment. Anyway, with this class is is pretty easy to write it yourself.

Enjoy,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   March 23, 2006, 07:57
Default Hi, take a look at the disc
  #3
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 10
braennstroem is on a distinguished road
Hi,

take a look at the discussion:

http://www.cfd-online.com/OpenFOAM_D...tml?1142952871

with this I could write a nonuniform profile for my inlet. I attached my directory

simpleFoam.tar.gz

Hope this helps!
Fabian
braennstroem is offline   Reply With Quote

Old   March 24, 2006, 09:47
Default Hi Fabian, more basic quest
  #4
Member
 
Anja Stretz
Join Date: Mar 2009
Posts: 92
Rep Power: 8
anja is on a distinguished road
Hi Fabian,

more basic questions:
your folder "SimpleFoam" is a new application?
It contains the profile for your inlet.

How do you actually use this application?
I mean when you create a new case with OpenFoam, you get the three folders "0", "constant", "system". My question is how to implement the velocity profile/the new application in "0".

Thanks again
Anja
anja is offline   Reply With Quote

Old   March 24, 2006, 10:28
Default Hi, I have this folder in t
  #5
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 10
braennstroem is on a distinguished road
Hi,

I have this folder in the tutorial directory. Run 'wmake' in it; afterwards you should be able to use ssimpleFoam.

Usage: ssimpleFoam <root> <case> [-parallel]

Which changes the entries for the inlet in file 0/U.

Greetings!
Fabian
braennstroem is offline   Reply With Quote

Old   March 24, 2006, 11:20
Default Hi Fabian, I've just try to
  #6
Senior Member
 
Francois Beaubert
Join Date: Mar 2009
Location: Lille, France
Posts: 133
Rep Power: 8
francois is on a distinguished road
Hi Fabian,

I've just try to develop the same utility.
I've download your ssimpleFoam code but notice one difference from my own utility.

To get the coordinates for cell centre of inletPatchID you used:

const fvPatchVectorField& centre = mesh.C().boundaryField()[inletPatchID];

I was using this statement:

const fvPatchVectorField& centre = mesh.Cf().boundaryField()[inletPatchID];

I don't now which one is best or correct.
For me centre is a surfaceVectorField so according to fvMesh.H we should use mesh.Cf().boundaryField()[inletPatchID] no ?

In fact fvMesh.H it says:
*//- Return cell centres as volVectorField
*const volVectorField& C() const;

//- Return face centres as surfaceVectorField
*const surfaceVectorField& Cf() const;

I'm wrong ?
François
francois is offline   Reply With Quote

Old   March 24, 2006, 11:36
Default Heya (sorry to butt in), Yo
  #7
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
hjasak will become famous soon enough
Heya (sorry to butt in),

You'll get the same data from all of those. When you're using mesh.C() you are relying on the fact that the boundary field of the cell centre volVectorField gives face centres.

You can also do

mesh.boundary()[patchI].Cf();

and a few others - it's just the wrapping of the same data.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   March 24, 2006, 11:57
Default Thank you Hrvoje for this pre
  #8
Senior Member
 
Francois Beaubert
Join Date: Mar 2009
Location: Lille, France
Posts: 133
Rep Power: 8
francois is on a distinguished road
Thank you Hrvoje for this precision !

I will try to make a utility that reads a file with an inlet velocity profile in it and interpolate it on the mesh.

In your previous mail you mentioned a class that can do interpolation for profiles:

src/sampling/interpolateXY/interpolateXY.H

I will try to use it for my utility.

Thank's for taking some of your time to answer questions from newbies !

Francois
francois is offline   Reply With Quote

Old   March 27, 2006, 07:44
Default Hi Fabian, for what do you
  #9
Member
 
Anja Stretz
Join Date: Mar 2009
Posts: 92
Rep Power: 8
anja is on a distinguished road
Hi Fabian,

for what do you need the following line
scalarField y = centre.component(vector::Y); ??


Thanks again, again
Anja
anja is offline   Reply With Quote

Old   March 28, 2006, 03:18
Default Hi anja, with this line you
  #10
Senior Member
 
Francois Beaubert
Join Date: Mar 2009
Location: Lille, France
Posts: 133
Rep Power: 8
francois is on a distinguished road
Hi anja,

with this line you get the y component of the fvPatchVectorField centre to have your ordinate of the cells centre at the inlet:

// Get x and y coordinates for cell centre
const fvPatchVectorField& centre = mesh.Cf().boundaryField()[inletPatchID];
scalarField y = centre.component(vector::Y);
francois is offline   Reply With Quote

Old   March 28, 2006, 04:32
Default Hi Francois, that means for
  #11
Member
 
Anja Stretz
Join Date: Mar 2009
Posts: 92
Rep Power: 8
anja is on a distinguished road
Hi Francois,

that means for a 3D inlet I have to write that line with x, y and z?
anja is offline   Reply With Quote

Old   March 28, 2006, 06:15
Default Hi Anja, I am not sure, but
  #12
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 10
braennstroem is on a distinguished road
Hi Anja,

I am not sure, but I think you do not have to, because you refer to the 'inletPatchID'!?

Greetings!
Fabian
braennstroem is offline   Reply With Quote

Old   March 28, 2006, 07:19
Default Hi Fabian, what is that com
  #13
Member
 
Anja Stretz
Join Date: Mar 2009
Posts: 92
Rep Power: 8
anja is on a distinguished road
Hi Fabian,

what is that comment for:
//VectorField& centresb = centres.boundaryField()[inletPatchID];

(It's in your ssimpleFoam.C)
anja is offline   Reply With Quote

Old   March 28, 2006, 09:02
Default Hi Anja, sorry, I did not c
  #14
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 10
braennstroem is on a distinguished road
Hi Anja,

sorry, I did not clean the code. I wrote this using 'trial&error' method with code snips from the board...

//VectorField& centresb = centres.boundaryField()[inletPatchID];
//scalarField yb = centresb.component(vector::Y);

I think it is just another way to get


const fvPatchVectorField& centre = mesh.C().boundaryField()[inletPatchID];
scalarField y = centre.component(vector::Y);

but I am not sure.

Fabian
braennstroem is offline   Reply With Quote

Old   March 28, 2006, 09:17
Default Hi again, okay. My velocit
  #15
Member
 
Anja Stretz
Join Date: Mar 2009
Posts: 92
Rep Power: 8
anja is on a distinguished road
Hi again,

okay.
My velocity profile for the inlet is a 3D parabolic shape. That's why I want to refer all points of my inlet patch to the centre of the inlet, for defining the velocity value.

Does someone know how to do that?
anja is offline   Reply With Quote

Old   March 28, 2006, 09:43
Default Hi, I assume that can be do
  #16
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 10
braennstroem is on a distinguished road
Hi,

I assume that can be done using the 'vector(x,x,x)', like in:

INLET == 10 * pow(y*0.1,0.17) * vector (1,0,0);

This example writes just the u velocity.
braennstroem is offline   Reply With Quote

Old   March 28, 2006, 09:57
Default Well, I mean I need Ux and Uy
  #17
Member
 
Anja Stretz
Join Date: Mar 2009
Posts: 92
Rep Power: 8
anja is on a distinguished road
Well, I mean I need Ux and Uy (as Uz=0), but the value of the velocity for each point of the inlet depends on the distance to the centre of the inlet, as it is parabolic.

The question is how to find the centre of the inlet. Maybe there is a special command I could use.
Or can I just use the coordinates from my gambit mesh. But that would mean that the point of origin for my coordinate system is still the same.
anja is offline   Reply With Quote

Old   March 28, 2006, 10:13
Default To find the centre for any pat
  #18
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 19
niklas will become famous soon enough
To find the centre for any patch you need to do something like this.

(Cp is the Centre of the patch.)

forAll( faces )
{
Cp += centers[facei]*magSf[facei]);
area += magSf[facei]);
}
Cp /= area;

please do not copy/paste since this is just a schematic coding, but hopefully instructive.

I'm leaving the details to you.
niklas is offline   Reply With Quote

Old   March 29, 2006, 03:31
Default Do I have to declare Cp before
  #19
Member
 
Anja Stretz
Join Date: Mar 2009
Posts: 92
Rep Power: 8
anja is on a distinguished road
Do I have to declare Cp before?
If so, where and how?

Thanks
Anja
anja is offline   Reply With Quote

Old   March 29, 2006, 05:39
Default You need to declare both Cp an
  #20
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 12
eugene is on a distinguished road
You need to declare both Cp and area before the forAll loop.

vector Cp = vector::zero;
scalar area = 0;
eugene 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
Velocity profile John CFX 0 October 14, 2008 06:47
Velocity profile as an velocity intlet condition kees FLUENT 3 April 16, 2008 18:35
velocity profile as an velocity inlet condition KEES Main CFD Forum 0 April 15, 2008 11:26
velocity profile nabeel FLUENT 0 June 27, 2006 05:32
particle velocity and velocity profile HGG FLUENT 2 June 10, 2001 16:32


All times are GMT -4. The time now is 20:19.