|
[Sponsors] |
July 31, 2013, 10:09 |
how to set up inlet velocity profile
|
#1 |
Member
Join Date: Feb 2012
Posts: 59
Rep Power: 14 |
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 |
|
July 31, 2013, 10:36 |
|
#2 |
Senior Member
Join Date: Mar 2013
Location: USA
Posts: 120
Rep Power: 13 |
Hello Raymond,
I am not sure but maybe you can do that with swak4Foam (groovyBC). You may want to look into that. Best, kilroy |
|
July 31, 2013, 10:50 |
|
#3 |
Member
Join Date: Feb 2012
Posts: 59
Rep Power: 14 |
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. |
|
July 31, 2013, 11:26 |
|
#4 |
Senior Member
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 23 |
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 |
|
July 31, 2013, 11:32 |
|
#5 | |
Member
Join Date: Feb 2012
Posts: 59
Rep Power: 14 |
Thanks, L. Well, I suppose the polynomial example for scalar variables. Is it also applicable for vector variables like velocity?
Quote:
|
||
July 31, 2013, 11:43 |
|
#6 |
Senior Member
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 23 |
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 |
|
July 31, 2013, 12:01 |
|
#7 | |
Senior Member
Join Date: Mar 2013
Location: USA
Posts: 120
Rep Power: 13 |
Quote:
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 |
||
August 21, 2013, 12:08 |
|
#8 |
Member
Join Date: Feb 2012
Posts: 59
Rep Power: 14 |
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); } Code:
libs ( "libOpenFOAM.so" "libgroovyBC.so" ); 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 Last edited by wyldckat; August 22, 2013 at 08:18. Reason: Added [CODE][/CODE] |
|
August 22, 2013, 08:21 |
|
#9 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
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
__________________
|
|
August 23, 2013, 06:16 |
|
#10 | |
Member
Join Date: Feb 2012
Posts: 59
Rep Power: 14 |
Quote:
|
||
August 24, 2013, 20:41 |
|
#11 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quote:
Nonetheless, I advise you to do some trial-and-error tests, just to confirm this
__________________
|
||
August 25, 2013, 07:06 |
|
#12 |
Member
Join Date: Feb 2012
Posts: 59
Rep Power: 14 |
Thanks for your suggestion. That's a good idea. It's for sure that the direction of normal() at boundaries points outwards.
|
|
August 26, 2013, 12:36 |
|
#13 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
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 |
|
July 10, 2015, 10:51 |
groovyBC problems
|
#14 |
New Member
Join Date: Jul 2015
Posts: 2
Rep Power: 0 |
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); } Code:
libs ("libOpenFOAM.so" "libsimpleSwakFunctionObjects.so" "libswakFunctionObjects.so" "libgroovyBC.so" ); 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" |
|
July 17, 2015, 02:39 |
|
#15 |
Senior Member
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 213
Rep Power: 18 |
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 |
|
March 10, 2018, 09:17 |
|
#16 | |
Member
Join Date: Oct 2017
Posts: 52
Rep Power: 9 |
Quote:
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"; } |
||
March 12, 2018, 03:49 |
Probem with temperature profile
|
#17 | |
Member
Join Date: Oct 2017
Posts: 52
Rep Power: 9 |
Quote:
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 |
||
March 17, 2018, 18:01 |
|
#18 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quote:
__________________
|
||
March 18, 2018, 09:43 |
|
#19 | |
Member
Join Date: Oct 2017
Posts: 52
Rep Power: 9 |
Quote:
|
||
March 18, 2018, 15:27 |
|
#20 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
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 I advise you to revise the expression you are trying to use. Perhaps the value "122.5" should be corrected for your own mesh? |
|
|
|
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 |