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)

alki March 13, 2009 01:58

Hi Jose, it works perfectly
 
Hi Jose,

it works perfectly. Thank you.


regards

Johannes

vinu June 7, 2009 23:08

Hi

I am using OpenFOAM 1.4.1. I did as Bernhard Gschaider said. But got the following error message. Does anyone know what went wrong?.

[caelinux@rgdlab1 setParabolicInlet]$ wmake
Making dependency list for source file setParabolicInlet.C
could not open file fvPatchFieldFields.H for source file setParabolicInlet.C
SOURCE=setParabolicInlet.C ; g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/home/caelinux/OpenFOAM/OpenFOAM-1.4.1/src/cfdTools/lnInclude -I/home/caelinux/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/caelinux/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGccDPOpt/setParabolicInlet.o
setParabolicInlet.C:36:32: error: fvPatchFieldFields.H: No such file or directory
setParabolicInlet.C: In function ‘int main(int, char**)’:
setParabolicInlet.C:71: error: ‘fvPatchVectorFieldField’ was not declared in this scope
setParabolicInlet.C:71: error: ‘Upatches’ was not declared in this scope
make: *** [Make/linuxGccDPOpt/setParabolicInlet.o] Error 1

brugiere_olivier June 16, 2009 09:13

Hi all,

I want to create an intersection between a patch and a plane. I've find this part of code and I put some lines but that it doesn't work.
// Create a patch set intesecting a plane
point pnt(4.5,2,2.25);
vector spanwiseDirection(0,0,1);
plane pl1(pnt,spanwiseDirection);
cuttingPlane cutPlane(mesh.boundaryMesh().findPatchID("mur_bas" ),pl1);
const labelList& cutCells = cutPlane.cells();
word setName("someCells");
cellSet currentSet(mesh, setName, cutCells);

the error's message is :

wallGradU.C: In function âint main(int, char**)â:
wallGradU.C:121: error: no matching function for call to âFoam::cuttingPlane::cuttingPlane(Foam::label, Foam::plane&)â
/home/users/brugiere/OpenFOAM/OpenFOAM-1.4.1/src/sampling/lnInclude/cuttingPlane.H:142: note: candidates are: Foam::cuttingPlane::cuttingPlane(const Foam::primitiveMesh&, const Foam::plane&, const Foam::labelList&)
/home/users/brugiere/OpenFOAM/OpenFOAM-1.4.1/src/sampling/lnInclude/cuttingPlane.H:133: note: Foam::cuttingPlane::cuttingPlane(const Foam::primitiveMesh&, const Foam::plane&)
/home/users/brugiere/OpenFOAM/OpenFOAM-1.4.1/src/sampling/lnInclude/cuttingPlane.H:112: note: Foam::cuttingPlane::cuttingPlane(const Foam::plane&)
/home/users/brugiere/OpenFOAM/OpenFOAM-1.4.1/src/sampling/lnInclude/cuttingPlane.H:58: note: Foam::cuttingPlane::cuttingPlane(const Foam::cuttingPlane&)
make: *** [Make/linux64GccDPOpt/wallGradU.o] Error 1

thank's for your messages

Olivier

heavy_user January 5, 2010 13:02

nvm................

haghajani February 10, 2010 15:02

Make setParabolicVelocity work for OF1.5
 
for those who may still interested in setParabolicVelocity

you should do the following two minor correction to make it work with OF-1.5
scalar maxVel(....args()[2])..
word ... args()[1]);
:)
Best,
Hamed

cfd_noob February 19, 2010 11:18

Error Setting parabolicVelocity as BC in round Inlet
 
Hi folks,

I am using OF 1.6 (stable) and have compiled the parabolicVelocity lib. I am having trouble with the simulation as such.
It inlet is a 2D pipe in the XY-Plane. The direction of the flow is in Z-Direction with an initial velocity U of 6.6 m/s.

The initial "0/U" file looks this way:

INJET
{
type parabolicVelocity;
n (0 0 1);
y (1 1 0);
maxValue 6.6;
value uniform (0 0 0);
}

However, the results I am getting are completely wrong! The U(z) distribution (Z-Plane => X=0 Y=0) at the INJET is not even circular (the INJET is a pipe). On the other hand, the distribution of the U(z) velocity in the Y=0 and X=0, not even not symmetrical but also incoherent.

I read on this thread that this code could also be used to set an initial parabolicVelocity profile for a 2D case, if the patch was 2D. This is my case.

Any help or any ideas why this might no be working?

best regards,

cfd_noob February 23, 2010 06:36

Anyone using this BC with openFoam 1.6?

heavy_user February 23, 2010 06:53

1 Attachment(s)
Hi Noob,

i have created a "tool" that writes an inlet profile.

In my case the inlet is in the x-y-plane, flowdirection is z.
You need to modify the equations and also change the name of the inlet.
(and pay attention to the flow direction and orientation of your case)

Then you compile it with wmake and you need to source it, then you should be able to execute the tool in the directory of your case.

I attached the files...

regards

cfd_noob February 28, 2010 08:44

Hi Heavy_User,

Thank you, I will try it out!

pbe_cfd March 8, 2010 11:41

Parabolic Profile and Lift&Drag Forces in OF-1.6
 
Hi,

I am working on benchmark problem "Flow Around Cylinder" and I am a freshman in OF world. I could obtain preliminary results for my geometry. Nevertheless, the results has to be improved by imposing a parabolic velocity on the inlet patch and the lift and drag forces has to be obtained for a quantitative comparison.

My main bottlenecks are
1) How to impose a parabolic profile in OF 1.6.
2) How to obtain lift and drag forces in OF 1.6.

Actually, bottleneck 1 is very well described by Bernhard in his several posts and I liked his way of implementation. Nevertheless, his code is good upto OF 1.4.1 (?). It gives following run time error when it's compiled and executed in OF 1.6.

////////////////////////////////////////////////////////////////////////////////////
#0 Foam::error::printStack(Foam::Ostream&) in "/home/user/ebayrakt/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::sigSegv::sigSegvHandler(int) in "/home/user/ebayrakt/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 ?? in "/lib64/libc.so.6"
#3 Foam::regIOobject::writeObject(Foam::IOstream::str eamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType) const in "/home/user/ebayrakt/OpenFOAM/ebayrakt-1.6/applications/bin/linux64GccDPOpt/setParabolicInlet"
#4 __libc_start_main in "/lib64/libc.so.6"
#5 Foam::regIOobject::writeObject(Foam::IOstream::str eamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType) const in "/home/user/ebayrakt/OpenFOAM/ebayrakt-1.6/applications/bin/linux64GccDPOpt/setParabolicInlet"
Segmentation fault
////////////////////////////////////////////////////////////////////////////////////

I tried to debug but it seems it will take ages for me to fix it without external support:). So, any suggestion is greatly appreciated.

About bottleneck 2, I've found a thread titled "Forces in v1.6" and I think that it is gonna solve the issue.

Cheers,
Evren

PS: May be, the code is all fine but naming convention or some libraries have been updated and it is just a matter of incompatibility of versions.:confused:

ngj March 8, 2010 11:46

Hi Evren

Make a search for groovyBC either here on the Forum or on the wiki, and you will find all you need.

Best regards,

Niels

pbe_cfd March 8, 2010 11:49

Hi Niels,

I'm gonna check it out and post my feedback.

Thanks,
Evren

pbe_cfd April 28, 2010 05:11

Hi all,

groovyBC seems to be a power tool to modify BCs, nevertheless it requires Bison to be installed. In my case, i just needed to implement parabolic BC at the inlet thus I preferred to follow the suggestions in the openfoamwiki (www.openfoamwiki.net). In wiki, under the title "Sig Turbomachinery / Tutorials", it is explained how to implement a parabolic BC in 2D. It's quite straight forward to modify it for 3D. And, if someone needs in 3D, I can send my source files.

Cheers,
evren

fsalvucci April 28, 2010 16:27

I have a problem with a customized 3D parabolic BC. I followed all the steps of the Sig Turbomachinery in wiki, but when i try to run the case, an error occurs. The write function is as follows:

void parabolicVelocityFvPatchVectorField::write(Ostream & os) const
{
fvPatchVectorField::write(os);
os.writeKeyword("maxValue")
<< maxValue_ << token::END_STATEMENT << nl;
os.writeKeyword("n")
<< n_ << token::END_STATEMENT << nl;
os.writeKeyword("y")
<< y_ << token::END_STATEMENT << nl;
os.writeKeyword("freq")
<< f_ << token::END_STATEMENT << nl;
os.writeKeyword("phi")
<< phi_ << token::END_STATEMENT << nl;
writeEntry("value", os);
}


In the 0/U files, i specify the boundary condition as:


inlet
{ type parabolicVelocity;
maxValue 0.452;
n (0 0 -1);
y (0 0 0);
freq 0;
phi 0;
}

And when i run the case, the following error occurs:

Cannot find 'value' entry on patch entrada of field U in file "./SmeriglioSilviaP/0/U"
which is required to set the values of the generic patch field.
(Actual type parabolicVelocity)
Please add the 'value' entry to the write function of the user-defined boundary-condition
or link the boundary-condition into libfoamUtil.so
file: ./SmeriglioSilviaP/0/U::boundaryField::entrada from line 35 to line 40.
From function genericFvPatchField<Type>::genericFvPatchField(con st fvPatch&, const Field<Type>&, const dictionary&)
in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 72.

FOAM exiting

So, i add in 0/U an entry after phi:

value (0 0 0); As is sugested in wiki tutorial, and says:

FOAM FATAL ERROR:
gradientInternalCoeffs cannot be called for a genericFvPatchField (actual type parabolicVelocity)
on patch entrada of field U in file "./SmeriglioSilviaP/0/U" You are probably trying to solve for a field with a generic boundary condition.
From function genericFvPatchField<Type>::gradientInternalCoeffs( ) const
in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 782.
FOAM exiting



Any ideas? I need help!








pbe_cfd April 29, 2010 09:19

Quote:

Originally Posted by fsalvucci (Post 256743)

FOAM FATAL ERROR:

gradientInternalCoeffs cannot be called for a genericFvPatchField (actual type parabolicVelocity)
on patch entrada of field U in file "./SmeriglioSilviaP/0/U" You are probably trying to solve for a field with a generic boundary condition.
From function genericFvPatchField<Type>::gradientInternalCoeffs( ) const
in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 782.
FOAM exiting

Any ideas? I need help!

May it be that you forget to add this line in the controlDict, so to tell OF which library it should use for this type of BCs (<case_dir>/system/) file
libs ("libmyBCs.so");

If you build the dynamic library with another name then you should change "libmyBCs.so" with yours. You can check your own build libraries in this directory: $FOAM_USER_LIBBIN

I hope this fixes your problem;)

fsalvucci April 29, 2010 10:32

Thanks for the reply. Actually, i added that line in the controlDict file. And everything is as should be (or seems to), the fact is that the library libmyBCs.so isn´t anywhere. Should i create it before? i think that adding in the Make/files file in the BC folder this:

parabolicVelocity.......C
LIB = $(FOAM_USER_LIBBIN)/libmyBCs

Is all i needed to do and that by this, when i compile, it creates the library, is that right?

Thanks!

pbe_cfd April 30, 2010 04:16

Quote:

Originally Posted by fsalvucci (Post 256867)
And everything is as should be (or seems to), the fact is that the library libmyBCs.so isn´t anywhere.

Then, the necessary dynamic library is not build. Then, you have to compile and build it.

And if you compile the source code as it's described in the wiki page, it should create libmyBC.so in this directory $(FOAM_USER_LIBBIN).

Quote:

Originally Posted by fsalvucci (Post 256867)
Should i create it before? i think that adding in the Make/files file in the BC folder this:

The make file contains only these two lines:
///////////////////////////////////////////////////
parabolicVelocityFvPatchVectorField.C
LIB = $(FOAM_USER_LIBBIN)/libmyBCs
///////////////////////////////////////////////////
So libmyBCs will be created in the specified directory. Of course your source file might have another name then, you should write the proper file name. And this should do the work for you. You build the library, you tell the solver where to find this library. So, this should be all...

Good luck ;-)
Evren

fsalvucci April 30, 2010 15:07

Thanks very much!!!!!! it seems that there where some errors in the code of the BC that didnt allow the compliation and building to finish succesfully and that caused that the library woudlnt be linked. I could run succesfully now, ill see if it is doing what it was supposed to do.
Thanks!

aldo.iannetti May 14, 2010 05:15

general profile inlet bc
 
Hi
I'm a new OF 1.6 user, I'd like to know how to implement an interpolated inlet velocity profile taken from an external data file. Is this possibility already there in OF 1.6?
thanks







Quote:

Originally Posted by hjasak (Post 190580)
Hi, I did one of those a while back - it is called parabolicVelocityFvPatchVectorField and should be somewhere on the discussion group. If you'd like the one updated to version 1.3, send me and E-mail and I'll give you the files.

Enjoy,

Hrv


pradeeppandeygbpec August 7, 2010 02:13

hello...all..
i need to prescribe parabolic velocity profile at inlet to a 3-D circular pipe . The pipe is along the x-Axis...ie. x-axis as its centerline.
I know the parabolic velocity profile for cylindrical coordinates system but how to implement the same in Cartesian coordinates....i need "u" as a function of x,y,z at inlet.
plz help me out...

ata August 8, 2010 06:29

Parabolic inlet velocity profile
 
Hi
I think you can use groovy boundary condition and transform cylindrical cordinate to cartesian.
Good luck

Ata

heavy_user August 9, 2010 06:08

Quote:

Originally Posted by pradeeppandeygbpec (Post 270629)
hello...all..
i need to prescribe parabolic velocity profile at inlet to a 3-D circular pipe . The pipe is along the x-Axis...ie. x-axis as its centerline.
I know the parabolic velocity profile for cylindrical coordinates system but how to implement the same in Cartesian coordinates....i need "u" as a function of x,y,z at inlet.
plz help me out...

Hi There,

i postet a while ago(further up somewhere) a "tool" that should be able to do that.
Just download and insert your equation...hope it works..

regards

gascortado January 21, 2011 14:08

setParabolicInlet.C
 
Hi. Does anyone have setParabolicInlet.C file previously posted? It is not available any more. If anyone can email it to gascortado@gmail.com I will greately appreciate it. Thanks

ngj January 22, 2011 14:01

Hi

You would be better off considering the tool swak4foam: http://openfoamwiki.net/index.php/Contrib/swak4Foam

Have a nice weekend,

Niels

kbambas May 2, 2011 04:44

information in parabolic inlet
 
Good morning evryone!
I 'm new in OpenFoam ,i want set parabolic inlet.I use the version 1.7.0. my geometry is a canal with attach in a tab.I have read in forom but i don't understand.
Please some help me to explain the procedure.
I try to english but my language is french.

desert_1250 August 25, 2011 15:38

Hi
 
Hi all, can every one tell me how to define U0=1-exp(-y^2) profile at the inlet BCs?


_____
Rasoul

gschaider August 25, 2011 17:31

Quote:

Originally Posted by desert_1250 (Post 321635)
Hi all, can every one tell me how to define U0=1-exp(-y^2) profile at the inlet BCs?

If you like C++-programming you can do it with codedFixedValue (only in 2.0). There was a discussion on that in the forum today

Or you can do it with groovyBC (now part of the swak4Foam-package). You find info about that either inthe Forum or on the Wiki

desert_1250 August 26, 2011 02:09

Quote:

Originally Posted by gschaider (Post 321658)
If you like C++-programming you can do it with codedFixedValue (only in 2.0). There was a discussion on that in the forum today

Or you can do it with groovyBC (now part of the swak4Foam-package). You find info about that either inthe Forum or on the Wiki


tanx for your reply, i have not any information about swak4Foam and not have enough time to study it, would you tell me the simplest way to set this BCs at the inlet? (i used OF.1.5-dev)

________
Rasoul

gschaider August 26, 2011 04:24

Quote:

Originally Posted by desert_1250 (Post 321685)
tanx for your reply, i have not any information about swak4Foam and not have enough time to study it, would you tell me the simplest way to set this BCs at the inlet? (i used OF.1.5-dev)

________
Rasoul

Unless you know the OpenFOAM-API by heart and program two boundary conditions every day (before breakfast) in my opinion groovyBC is the fastest way to get what you want (BTW: for your OF version you'll have to use "old school" groovyBC. Advantage: compilation is faster)

As you're very short on time: http://tinyurl.com/3fklrwd

desert_1250 August 26, 2011 12:20

Quote:

Originally Posted by gschaider (Post 321706)
Unless you know the OpenFOAM-API by heart and program two boundary conditions every day (before breakfast) in my opinion groovyBC is the fastest way to get what you want (BTW: for your OF version you'll have to use "old school" groovyBC. Advantage: compilation is faster)

As you're very short on time: http://tinyurl.com/3fklrwd


i successed to set the Bcs that i mentioned in the last posts by using nonuniform BCs. now i wanna to add osscillation to the inlet after reaching to the steady state. i know how to use oscillating bc, but dont know how to set it be continued from previous issue!!!??? on the other hand i wanna set unsteady BCs so that after a special time that the problem reached to the steady state, apply oscillation at the inlet. whoud you tell me how do it?? tanx

__________
Rasoul

desert_1250 August 27, 2011 03:25

can every one tell me how to exert (1-exp(-y^2)+0.5Cos2t) profile at the inlet BCs by groovy BCs?? i did not find any manual for groovyBC so that help me do it, i am very glad if intruduce me any documention a bout it.

_____
Rasoul

gschaider August 27, 2011 11:14

Quote:

Originally Posted by desert_1250 (Post 321873)
can every one tell me how to exert (1-exp(-y^2)+0.5Cos2t) profile at the inlet BCs by groovy BCs?? i did not find any manual for groovyBC so that help me do it, i am very glad if intruduce me any documention a bout it.

_____
Rasoul

You asked the same question in three threads in under an hour. Rule of thumb: usually this makes it LESS likely that anyone cares to answer. See also http://openfoamwiki.net/index.php/Ho..._Message_Board
(especially points 5&7)

desert_1250 August 27, 2011 13:10

tnx for your attention, you are right!!!
I've done my work with a combination of two other boundary conditions, without use groovyBC :))

alberto August 27, 2011 22:13

Ehhh...there are many examples on the download page of GroovyBC, so it's really a question of *reading* before asking.

desert_1250 August 28, 2011 02:11

Quote:

Originally Posted by alberto (Post 321939)
Ehhh...there are many examples on the download page of GroovyBC, so it's really a question of *reading* before asking.

you are right too :eek: someone else no idea ... :cool:

_______
Rasoul

sihaqqi March 22, 2013 10:00

Hello Håkan

I am going through your tutorial. I am using OpenFoam 2.1. I am a beginner and freshly started learning openFoam. I cannot find parabolicvelocity folder and relevant files in the path.
parabolicVelocity/parabolicVelocityFvPatchVectorField.C
parabolicVelocity/parabolicVelocityFvPatchVectorField.H

Can you please send them at sihaqqi@gmail.com. I shall be very grateful. I have tried to find them on internet but every link is useless.

Thanks and Regards

wyldckat January 2, 2014 18:17

Quote:

Originally Posted by sihaqqi (Post 415738)
I am going through your tutorial. I am using OpenFoam 2.1. I am a beginner and freshly started learning openFoam. I cannot find parabolicvelocity folder and relevant files in the path.
parabolicVelocity/parabolicVelocityFvPatchVectorField.C
parabolicVelocity/parabolicVelocityFvPatchVectorField.H

FYI: The way to get those files and build them (for any OpenFOAM version) is fully explained here: http://www.cfd-online.com/Forums/ope...tml#post446451 post #10

shivab February 6, 2020 05:13

Regarding parabolic velocity profile at inlet
 
Hello!

I am trying to give a parabolic velocity profile at the inlet.
I got the default code from Ansys fluent manual, how can I adjust it such as I get a particular velocity at inlet. Initially, I have taken up the code and interpreted and during initialization, I gave the velocity required.

Here is the code I used and any suggestions regarding the improvement of the code to get a required velocity?:

#include "udf.h"
DEFINE_PROFILE(x_velocity,thread,index)
{
real x[ND_ND];
real y;
face_t f;
begin_f_loop(f,thread)
{
F_CENTROID(x,f,thread);
y = x[1];
F_PROFILE(f,thread,index) = 20. - y*y/(.0745*.0745)*20.;
}
end_f_loop(f,thread)
}

Regards,
Shiva


All times are GMT -4. The time now is 12:00.