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

how to set up inlet velocity profile

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 31, 2013, 10:09
Default how to set up inlet velocity profile
  #1
Member
 
Join Date: Feb 2012
Posts: 59
Rep Power: 14
Raymond.Leoi is on a distinguished road
Hey,

I am setting up a polynomial velocity profile (say, Ux = C1+C2*y+C3*y^2) for a velocity inlet. Any idea for it?

Cheers,
Raymond
Raymond.Leoi is offline   Reply With Quote

Old   July 31, 2013, 10:36
Default
  #2
Senior Member
 
kilroy's Avatar
 
Join Date: Mar 2013
Location: USA
Posts: 120
Rep Power: 13
kilroy is on a distinguished road
Hello Raymond,

I am not sure but maybe you can do that with swak4Foam (groovyBC). You may want to look into that.

Best,
kilroy
kilroy is offline   Reply With Quote

Old   July 31, 2013, 10:50
Default
  #3
Member
 
Join Date: Feb 2012
Posts: 59
Rep Power: 14
Raymond.Leoi is on a distinguished road
Thanks, Kilroy. Unfortunately, I couldn't find it in the OF version used.

Actually, the question is similar to setting up the inlet velocity profile for fully-dveloped laminar flow.

Quote:
Originally Posted by kilroy View Post
Hello Raymond,

I am not sure but maybe you can do that with swak4Foam (groovyBC). You may want to look into that.

Best,
kilroy
Raymond.Leoi is offline   Reply With Quote

Old   July 31, 2013, 11:26
Default
  #4
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 23
Lieven will become famous soon enough
Hi Raymond,

Have a look at http://www.openfoam.org/version2.1.0...conditions.php
the functionality you are looking for, is already available in OF.

Cheers

L
Lieven is offline   Reply With Quote

Old   July 31, 2013, 11:32
Default
  #5
Member
 
Join Date: Feb 2012
Posts: 59
Rep Power: 14
Raymond.Leoi is on a distinguished road
Thanks, L. Well, I suppose the polynomial example for scalar variables. Is it also applicable for vector variables like velocity?

Quote:
Originally Posted by Lieven View Post
Hi Raymond,

Have a look at http://www.openfoam.org/version2.1.0...conditions.php
the functionality you are looking for, is already available in OF.

Cheers

L
Raymond.Leoi is offline   Reply With Quote

Old   July 31, 2013, 11:43
Default
  #6
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 23
Lieven will become famous soon enough
That's a very good question, I have no clue

I would say, have a look at the sources and see if that tells you a bit more. Otherwise, I'm pretty sure you can use the codedFixedValue boundary condition but this will be a bit more challenging. Then the groovyBC might be easier to use (never used it myself so can't help you with that).

Cheers,

L
Lieven is offline   Reply With Quote

Old   July 31, 2013, 12:01
Default
  #7
Senior Member
 
kilroy's Avatar
 
Join Date: Mar 2013
Location: USA
Posts: 120
Rep Power: 13
kilroy is on a distinguished road
Quote:
Originally Posted by Raymond.Leoi View Post
Thanks, Kilroy. Unfortunately, I couldn't find it in the OF version used.

Actually, the question is similar to setting up the inlet velocity profile for fully-dveloped laminar flow.
Raymond,

swak4Foam doesn't come with standard OpenFoam. You need to add it seperately. Please see the link below for details:

http://openfoamwiki.net/index.php/Contrib/swak4Foam

Best,
kilroy
kilroy is offline   Reply With Quote

Old   August 21, 2013, 12:08
Default
  #8
Member
 
Join Date: Feb 2012
Posts: 59
Rep Power: 14
Raymond.Leoi is on a distinguished road
I made up a parabolic profile for velocity inlet using groovyBC as
Code:
inletL
{
type groovyBC;
variables "yp=pts().y;minY=min(yp);maxY=max(yp);rad=0.5*(max Y-minY);vavg=0.23;";
valueExpression "2.0*vavg*(1.0-pow(pos().y/rad,2))*normal()";
value uniform (10 0 0);
}
Also,
Code:
libs ( "libOpenFOAM.so" "libgroovyBC.so" );
is declared in controlDict. But I got the following error
Code:
Create mesh for time = 0
Reading field p
Reading field U

--> FOAM FATAL IO ERROR: 
keyword boundaryField is undefined in dictionary "/home/parallels/OpenFOAM/..../0/U"

file: /home/parallels/OpenFOAM/..../0/U from line 17 to line 48.

From function dictionary::subDict(const word& keyword) const
in file db/dictionary/dictionary.C at line 461.

FOAM exiting
Anything wrong I made?

Last edited by wyldckat; August 22, 2013 at 08:18. Reason: Added [CODE][/CODE]
Raymond.Leoi is offline   Reply With Quote

Old   August 22, 2013, 08:21
Default
  #9
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Raymond,

OK, the error message says that "boundaryField" is missing. If you look at one of OpenFOAM's tutorial files, such as "incompressible/icoFoam/cavity/0/U", you'll see that the "boundaryField" is the keyword for the list of boundary conditions, as you can examine at this link: https://github.com/OpenFOAM/OpenFOAM...oam/cavity/0/U

Therefore, it looks like you somehow has a damaged "U" file, which you must fix, to make it more similar to the ones on OpenFOAM's tutorials.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   August 23, 2013, 06:16
Default
  #10
Member
 
Join Date: Feb 2012
Posts: 59
Rep Power: 14
Raymond.Leoi is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Hi Raymond,

OK, the error message says that "boundaryField" is missing. If you look at one of OpenFOAM's tutorial files, such as "incompressible/icoFoam/cavity/0/U", you'll see that the "boundaryField" is the keyword for the list of boundary conditions, as you can examine at this link: https://github.com/OpenFOAM/OpenFOAM...oam/cavity/0/U

Therefore, it looks like you somehow has a damaged "U" file, which you must fix, to make it more similar to the ones on OpenFOAM's tutorials.

Best regards,
Bruno
Many cheers, Bruno. It's sorted out. Eventually, GroovyBC works. BTW, normal() follows right-hand rule as most of other codes, doesn't it?
Raymond.Leoi is offline   Reply With Quote

Old   August 24, 2013, 20:41
Default
  #11
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by Raymond.Leoi View Post
BTW, normal() follows right-hand rule as most of other codes, doesn't it?
It should, but keep in mind that it might (probably) also take(s) into account which way is the inside of the simulation domain.
Nonetheless, I advise you to do some trial-and-error tests, just to confirm this
__________________
wyldckat is offline   Reply With Quote

Old   August 25, 2013, 07:06
Default
  #12
Member
 
Join Date: Feb 2012
Posts: 59
Rep Power: 14
Raymond.Leoi is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
It should, but keep in mind that it might (probably) also take(s) into account which way is the inside of the simulation domain.
Nonetheless, I advise you to do some trial-and-error tests, just to confirm this
Thanks for your suggestion. That's a good idea. It's for sure that the direction of normal() at boundaries points outwards.
Raymond.Leoi is offline   Reply With Quote

Old   August 26, 2013, 12:36
Default
  #13
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Raymond.Leoi View Post
Thanks for your suggestion. That's a good idea. It's for sure that the direction of normal() at boundaries points outwards.
Honestly: I've got to look that up every time myself. But basically it just passes through the definition that OpenFOAM uses. But I guess outwards. Because the boundary cell is the "owner" of the boundary face. And the normal of a face points from the "owner" to the "neighbour"
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   July 10, 2015, 10:51
Default groovyBC problems
  #14
New Member
 
Join Date: Jul 2015
Posts: 2
Rep Power: 0
bufs is on a distinguished road
Hi guys,

it's my first time using groovyBC, and I'm trying to set up an inlet velocity profile according to the following equation u = 2*y + y^2 in the x direction.

What I've done is edit the U file to include the following code for the inlet velocity

Code:
inlet
    {
        type               groovyBC;
    valueExpression    "(2*pos().y+pos().y*pos().y)*normal()";
    value              uniform (0 0 0);
    }
I've also edited the controlDict file in system to include

Code:
libs ("libOpenFOAM.so"
      "libsimpleSwakFunctionObjects.so"
      "libswakFunctionObjects.so"
      "libgroovyBC.so"
);
But once I run the code, after only few timesteps I get the following error messages

Code:
$ #0  Foam::error::printStack(Foam::Ostream&) in  "/usr/local/OpenFOAM/OpenFOAM-2.1.1//platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/usr/local/OpenFOAM/OpenFOAM-2.1.1//platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  
 at sigaction.c:0
#3   Foam::PBiCG::solve(Foam::Field<double>&,  Foam::Field<double> const&, unsigned char) const in  "/usr/local/OpenFOAM/OpenFOAM-2.1.1//platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4  
 in "/usr/local/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/bin/pimpleDyMFoam"
#5  
 in "/usr/local/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/bin/pimpleDyMFoam"
#6  
 in "/usr/local/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/bin/pimpleDyMFoam"
#7  __libc_start_main in "/lib64/libc.so.6"
#8  
 in "/usr/local/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/bin/pimpleDyMFoam"
Anyone has any idea of what I'm doing wrong?
bufs is offline   Reply With Quote

Old   July 17, 2015, 02:39
Default
  #15
Senior Member
 
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 213
Rep Power: 18
fabian_roesler is on a distinguished road
Hi

Where dose this profile come from? Try to plot it in a spread sheet tool. It contains negative values and the peak (minimum value) is at y = -1.
From the error massage you can see, that the error is not withing your implementation of the profile in groovyBC but within your profile itself. The solver PBiCG can't solve for pressure because of the wired velocity profile.

Cheers

Fabian
fabian_roesler is offline   Reply With Quote

Old   March 10, 2018, 09:17
Default
  #16
Member
 
Join Date: Oct 2017
Posts: 52
Rep Power: 9
gouravjee is on a distinguished road
Quote:
Originally Posted by fabian_roesler View Post
Hi

Where dose this profile come from? Try to plot it in a spread sheet tool. It contains negative values and the peak (minimum value) is at y = -1.
From the error massage you can see, that the error is not withing your implementation of the profile in groovyBC but within your profile itself. The solver PBiCG can't solve for pressure because of the wired velocity profile.

Cheers

Fabian


Hello i have been working on a heat conduction problem and i am using groovyBC or providing a temperature profile as an input but it doesnt seem too work. can you help me withb this?

Code:
    front
    {
        type           groovyBC;
	valueExpression "2076000*exp(-pow((pos().x-122.5)/6.067,2))";
        fractionExpression	"0";

    }
gouravjee is offline   Reply With Quote

Old   March 12, 2018, 03:49
Default Probem with temperature profile
  #17
Member
 
Join Date: Oct 2017
Posts: 52
Rep Power: 9
gouravjee is on a distinguished road
Quote:
Originally Posted by Lieven View Post
That's a very good question, I have no clue

I would say, have a look at the sources and see if that tells you a bit more. Otherwise, I'm pretty sure you can use the codedFixedValue boundary condition but this will be a bit more challenging. Then the groovyBC might be easier to use (never used it myself so can't help you with that).

Cheers,

L
hello,
i have been working on a solidification/melting problem in which i am supposed to give a gaussian profile as a input heat flux i have written a code for that.but it is not giving me desired profile.
can you tell me where is the problem??
Code:
input
{
type codedFixedValue;
value uniform 573;
redirectType temperatureProfile;

code
#{

fixedValueFvPatchScalarField myPatch(*this);
forAll(this->patch().Cf(),i)
{
myPatch[i]=2076000*exp(-Foam::pow((this->patch().Cf()[i].x()-122.5)/6.067,2));
}
operator==(myPatch);
#};
}

Last edited by wyldckat; March 17, 2018 at 17:58. Reason: repaired the [CODE] block and ":p" that had been removed
gouravjee is offline   Reply With Quote

Old   March 17, 2018, 18:01
Default
  #18
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by gouravjee View Post
hello,
i have been working on a solidification/melting problem in which i am supposed to give a gaussian profile as a input heat flux i have written a code for that.but it is not giving me desired profile.
can you tell me where is the problem??
Quick questions:
  1. What is the x range of values?
  2. How do you know if the centres of the faces are within that range?
  3. Have you confirmed in ParaView is they are truly positioned in that range?
__________________
wyldckat is offline   Reply With Quote

Old   March 18, 2018, 09:43
Default
  #19
Member
 
Join Date: Oct 2017
Posts: 52
Rep Power: 9
gouravjee is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Quick questions:
  1. What is the x range of values?
  2. How do you know if the centres of the faces are within that range?
  3. Have you confirmed in ParaView is they are truly positioned in that range?
  1. x lies within 24.4 to 48.8.
  2. i have simply used blockMesh to do the task.
  3. i Have confirmed that the they are truly positioned in that range.
  4. All the value which get from this function are nonzero.
gouravjee is offline   Reply With Quote

Old   March 18, 2018, 15:27
Default
  #20
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by gouravjee View Post
  1. x lies within 24.4 to 48.8.
When I use the expression in LibreOffice Calc, with the values within that range, I get the following values:
Code:
24.4  5.89623239154312E-108
28.4  6.94161182559196E-99
32.4  3.42598751605742E-90
36.4  7.08844457133055E-82
40.4  6.14831116703849E-74
44.4  2.23563268446316E-66
48.4  3.40788382528878E-59
48.8  1.69835079530111E-58
Which means that it's not OpenFOAM's fault here.


I advise you to revise the expression you are trying to use. Perhaps the value "122.5" should be corrected for your own mesh?
wyldckat is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
3D UDF Paraboilc Velocity Profile (Can't Maintain) Sing FLUENT 12 August 7, 2017 07:25
extracting outlet velocity profile from one case to another case's inlet tonggysun OpenFOAM 2 September 13, 2013 05:19
FSI- Pipe- uniform velocity profile inlet Absy Main CFD Forum 0 April 6, 2010 04:01
Variables Definition in CFX Solver 5.6 R P CFX 2 October 26, 2004 03:13
what the result is negatif pressure at inlet chong chee nan FLUENT 0 December 29, 2001 06:13


All times are GMT -4. The time now is 18:46.