CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Parabolic inlet velocity profile (https://www.cfd-online.com/Forums/openfoam-solving/57793-parabolic-inlet-velocity-profile.html)

sega June 26, 2008 05:54

Hello davey david. I don't
 
Hello davey david.

I don't know why this problem is related to the parabolic inlet velocity?

I had a similar problem. I made a mistake with the pressure distribution. Do you have pdRefCell and pdRefValue entries in your fvSolution-file? Maybe these entries do not correspond to your mesh? You can try setting a reference value for the pressure directly at a boundary instead.

gschaider June 26, 2008 06:09

@sebastians question whether i
 
@sebastians question whether it is possible to use funkySetFields:
Yes. You can do something similar to http://openfoamwiki.net/index.php/Co...t-Room_Example (basically set a parabolic internal field, use that field on selected patches and afterwards clear the internal field and keep the values at the patches). Whether this is easier than programming a util is a matter of taste

Bernhard

suredross July 1, 2008 10:33

hello, i need to implement a
 
hello,
i need to implement a boundary condition on a patch(wall) and write out only those values.it is more of a slip condition enforced at the boundary(case is 2D).can the parabolic velocity boundary condition be modified to do this??any ideas and thoughts are welcome.

cheers
davey

sega July 1, 2008 13:24

Hello! So, I have worked a
 
Hello!

So, I have worked a little bit with the tool.
As a reminder I tried to change it so it would set the velocity components in y-direction instead of x.
It's compiling and looks like this:

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif setParabolicInlet.C

I would like to set the parabolic inflow to the boundary-patch inflow so I did this:

setParabolicInlet . . inflow 0.5305

Have a look at the output:

Exec : setParabolicInlet . . inflow 0.5305
Date : Jul 01 2008
Time : 19:13:59
Host : M1530
PID : 9011
Root : /home/sega/OpenFOAM/sega-1.4.1/run/nucleateBoiling
Case : .
Nprocs : 1
Create time

Create mesh for time = 0

Vector field U

Patching inlet
x [ 0 , 0 ] z [ -1.98553e-22 , 2.43404e-22 ]
=> x [ 0 , 0 ] z [ -1.98553e-22 , 4.41957e-22 ]
Writing modified field U

End

But it looks like the tool does nothing at all . Maybe beacuse of this strange x-interval?

I think I made some severe mistakes changing the directions. I hope you have some suggestions?

Thanks so far & Greetings from Germany.
Sebastian

gschaider July 1, 2008 13:53

Hi Sebastian! In your code
 
Hi Sebastian!

In your code the minX/maxX-line should now access component(0)

Bernhard

sega July 2, 2008 03:08

Yes, Thank you. I have changed
 
Yes, Thank you. I have changed it and now its working.

But I have some more problems setting the right parabolic inlet.

If I set
scalar vel=maxVel*(1-(x/1e-3)*(x/1e-3));
I get a parabolic profile, which is axi-symmetric (an arc). The length of the area I want so set up with the profile is 1mm, thus the 1e-3 in the denumerator. But the values are far too big (1e+6) and negative.

If I just set
scalar vel=maxVel*(1-x*x)
I get the "complete" parabolic profile, but with the right magnitude.

So, what I want is a half parabolic profile with the correct magnitude.

What may be wrong with the code?

gschaider July 2, 2008 03:48

The problem might be that the
 
The problem might be that the extent of the patch is calculated using the face centres, but in reality the face vertices should be used.

sega July 2, 2008 05:29

I dont know how and why this c
 
I dont know how and why this can effect the profile, but this sounds like a limitation.

As I just have 8 cells over the inflow-patch in x-direction I have written a small MATLAB-file which is calculating the values at the cellcenters an put them into a nonuniform List into the U-file by hand.

I'm not sure where this will lead, but I will get back to you.

gschaider July 3, 2008 05:13

Hi Sebastian! Well in your
 
Hi Sebastian!

Well in your case the utility thinks that the channel is 1/8th narrower than it actually is (misses half a cell on the left and on the right)

Bernhard

ivanyao July 8, 2008 21:26

hi, I have go through all the
 
hi,
I have go through all the messages.but I don't know how to compile the setParabolicInlet.I am doing a simulation about the compute wind engineering,I do the simulation in rhoturbFoam.my inlet velocity profile:U=U_0*(Z/Z_0)^0.25,"U_0","Z_0"are constants I provide."Z" is the height of the building.I am using OF1.4,and I have downloaded the parabolicVelocity_HJ_17Jan2007.tgz,but I don't know what I should do next.is there anyone help me step by step?that is very important to me.I would very very appreciate it.
thanks,Ivan

gschaider November 17, 2008 14:08

I have no idea. A debug-versio
 
I have no idea. A debug-version of OF would give us the line-number of the program at which this is occuring:
http://openfoamwiki.net/index.php/Main_FAQ#An_application_ends_with_a_segmentati on_fault._What_is_wrong.3F

Bernhard

rama0004 November 17, 2008 15:07

Thanks Bernhard I'll try.
 
Thanks Bernhard

I'll try.

carrie November 19, 2008 22:09

hi, I have compiled the lib
 
hi,
I have compiled the libs successfully,but when i type paraFoam <root> <case>,it show:
From function dlLibraryTable::open(const fileName& functionLibName)
in file db/dlLibraryTable/dlLibraryTable.C at line 79
could not load /home/ivan/OpenFOAM/ivan-1.4.1/lib/linuxGccDPOpt/libparabolicVelocity.so: undefined symbol: _ZN4Foam4word5debugE
what is problem?could anyone give me a hand?

markc December 16, 2008 07:03

Hello All, A question which
 
Hello All,

A question which is not exactly related to this thread but it looks like here are people who might be able to help me a bit further.
For some postprocessing utility I need to read in the value of the BC (fixedValue uniform) on some patch, usually U on Inlet patch.
So I ask the user to give the name of the inlet patch, the field to be read and than the utility should find in the times directory the correct value. E.g. if the the next BC for Inlet is given:
>>>
Inlet
{
type pressureInletVelocity;
value uniform (5 0 0);
}
>>>

the utility should return the vector (5 0 0);
Does anyone know how to perform this (simple) task?
Thanks in advance,

Brgds,

Mark

markc December 16, 2008 10:12

Radu, Thanks for your reply
 
Radu,

Thanks for your reply, very useful. I am getting closer, but still not there.
Now, if I imcorporate your snippet, during build I get the error message 'U' was not declared in this scope.

I also have a variable "fieldName", which is declared as const word. If I use this instead of U (to generalize the use of the final utility). In that case I get the error message that const class::Foam has no member named 'boundaryField'. Well, I understand the meaning of these messages but I do not know how to correct them.
Any advice here? Do I have to add some kind of createfield.H for U? This did not work so far as well.

Kind regards,

Mark

antonio_ing January 9, 2009 14:42

anyway i wave to write a B
 
anyway

i wave to write a BC that, taking a surface patch, each point with coordinates (x,y,z) must have a velocity omega*(-y,x,0). Can someone send me an example?

thanks again for all the help

hamsadhwani8 January 13, 2009 15:57

I have used the following piec
 
I have used the following piece of code as a InletVelocityProfile.H include file in my solver. The idea is to assign some section of the inlet a particular velocity and the rest something else. However, the 'for loop' does not seem to do anything! Can anyone comment on this?

InletVelocityProfile.H looks like this

label inletPatchID = mesh.boundaryMesh().findPatchID("inlet");

// Get reference to boundary value, patch centers
fvPatchVectorField& inletU = U.boundaryField()[inletPatchID];
const fvsPatchVectorField& inletFaceCentres = mesh.Cf().boundaryField()[inletPatchID];

scalarField y = inletFaceCentres.component(vector::Y);

forAll(inletU, faceI)
{
if (y >= 0.02)
{
inletU == 0.5*vector(1,0,0);
}
else
{
inletU == 0.0*vector(1,0,0);
}
}

hamsadhwani8 January 13, 2009 15:58

Ofcourse, I also have U.wr
 
Ofcourse, I also have

U.write() at the end of the include file.

Thanks
Sesha

santos January 14, 2009 10:13

Hi, It should work with:
 
Hi,

It should work with:

forAll(inletU, faceI)
{
if (y >= 0.02)
{
inletU[faceI] == 0.5*vector(1,0,0);
}
else
{
inletU[faceI] == 0.0*vector(1,0,0);
}
}

Regards,
Jose Santos

santos January 14, 2009 10:15

Also replace == with =.
 
Also replace == with =.


All times are GMT -4. The time now is 08:49.