|
[Sponsors] |
March 23, 2006, 05:54 |
Hi,
basic question:
How do
|
#1 |
Member
Anja Stretz
Join Date: Mar 2009
Posts: 92
Rep Power: 17 |
Hi,
basic question: How do you implement a velocity profile on an area for an inlet? Anja |
|
March 23, 2006, 06:45 |
Have a look at the documentati
|
#2 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33 |
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 |
|
March 23, 2006, 06:57 |
Hi,
take a look at the disc
|
#3 |
Senior Member
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19 |
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 |
|
March 24, 2006, 08:47 |
Hi Fabian,
more basic quest
|
#4 |
Member
Anja Stretz
Join Date: Mar 2009
Posts: 92
Rep Power: 17 |
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 |
|
March 24, 2006, 09:28 |
Hi,
I have this folder in t
|
#5 |
Senior Member
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19 |
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 |
|
March 24, 2006, 10:20 |
Hi Fabian,
I've just try to
|
#6 |
Senior Member
Francois Beaubert
Join Date: Mar 2009
Location: Lille, France
Posts: 147
Rep Power: 17 |
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 |
|
March 24, 2006, 10:36 |
Heya (sorry to butt in),
Yo
|
#7 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33 |
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 |
|
March 24, 2006, 10:57 |
Thank you Hrvoje for this pre
|
#8 |
Senior Member
Francois Beaubert
Join Date: Mar 2009
Location: Lille, France
Posts: 147
Rep Power: 17 |
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 |
|
March 27, 2006, 07:44 |
Hi Fabian,
for what do you
|
#9 |
Member
Anja Stretz
Join Date: Mar 2009
Posts: 92
Rep Power: 17 |
Hi Fabian,
for what do you need the following line scalarField y = centre.component(vector::Y); ?? Thanks again, again Anja |
|
March 28, 2006, 03:18 |
Hi anja,
with this line you
|
#10 |
Senior Member
Francois Beaubert
Join Date: Mar 2009
Location: Lille, France
Posts: 147
Rep Power: 17 |
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); |
|
March 28, 2006, 04:32 |
Hi Francois,
that means for
|
#11 |
Member
Anja Stretz
Join Date: Mar 2009
Posts: 92
Rep Power: 17 |
Hi Francois,
that means for a 3D inlet I have to write that line with x, y and z? |
|
March 28, 2006, 06:15 |
Hi Anja,
I am not sure, but
|
#12 |
Senior Member
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19 |
Hi Anja,
I am not sure, but I think you do not have to, because you refer to the 'inletPatchID'!? Greetings! Fabian |
|
March 28, 2006, 07:19 |
Hi Fabian,
what is that com
|
#13 |
Member
Anja Stretz
Join Date: Mar 2009
Posts: 92
Rep Power: 17 |
Hi Fabian,
what is that comment for: //VectorField& centresb = centres.boundaryField()[inletPatchID]; (It's in your ssimpleFoam.C) |
|
March 28, 2006, 09:02 |
Hi Anja,
sorry, I did not c
|
#14 |
Senior Member
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19 |
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 |
|
March 28, 2006, 09:17 |
Hi again,
okay.
My velocit
|
#15 |
Member
Anja Stretz
Join Date: Mar 2009
Posts: 92
Rep Power: 17 |
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? |
|
March 28, 2006, 09:43 |
Hi,
I assume that can be do
|
#16 |
Senior Member
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19 |
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. |
|
March 28, 2006, 09:57 |
Well, I mean I need Ux and Uy
|
#17 |
Member
Anja Stretz
Join Date: Mar 2009
Posts: 92
Rep Power: 17 |
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. |
|
March 28, 2006, 10:13 |
To find the centre for any pat
|
#18 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 |
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. |
|
March 29, 2006, 03:31 |
Do I have to declare Cp before
|
#19 |
Member
Anja Stretz
Join Date: Mar 2009
Posts: 92
Rep Power: 17 |
Do I have to declare Cp before?
If so, where and how? Thanks Anja |
|
March 29, 2006, 05:39 |
You need to declare both Cp an
|
#20 |
Senior Member
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21 |
You need to declare both Cp and area before the forAll loop.
vector Cp = vector::zero; scalar area = 0; |
|
|
|
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 |