|
[Sponsors] |
Parabolic velocity profile Booundary condition |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 16, 2013, 18:30 |
Parabolic velocity profile Booundary condition
|
#1 |
New Member
Elisa
Join Date: Mar 2013
Posts: 11
Rep Power: 13 |
Hi!
I'd like to impose parabolic profile of velocity at inlet of my 3D Y-pipes shape because I'm simulating poiseuille flow. As the flow is driven by velocity I leave 'free' P at inlet, outlet and wall (zeroGradient). the internalField is uniform (0). I write the following 0/U file: FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { inlet { type codedFixedValue; value $internalField; redirectType ramp; code #{ scalar U_0=(0 0 0.049954); //mean U.This isn't the max velocity of the profile. scalar r=0.02; //mean Radius. in the 3 pipes radius are different. fixedValueFvPatchVectorField myPatch(*this); forAll(this->patch().Cf(),i) { myPatch[i]=vector(2*U_0*(1-Foam:Pow(this->patch().Cf()[i].x(),2)/pow(r,2)),0,0); } operator==(myPatch); #}; } outlet { type zeroGradient; } Walls { type fixedValue; value uniform (0 0 0); } } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** * * // There should be something wrong because I have and error runing icoFoam... Can you help me????? thank you so much. |
|
April 17, 2013, 03:02 |
|
#2 |
Member
Akshay Kumar
Join Date: Aug 2010
Location: India
Posts: 84
Rep Power: 16 |
Hey Elisa
Could you post the error message? Akshay |
|
April 17, 2013, 11:14 |
|
#3 |
New Member
Elisa
Join Date: Mar 2013
Posts: 11
Rep Power: 13 |
This is the error I have:
--> FOAM FATAL IO ERROR: Loading a shared library using case-supplied code is not enabled by default because of security issues. If you trust the code you can enable this facility be adding to the InfoSwitches setting in the system controlDict: allowSystemOperations 1 The system controlDict is either ~/.OpenFOAM/$WM_PROJECT_VERSION/controlDict or $WM_PROJECT_DIR/etc/controlDict file: /home/cosine/OpenFOAM/cosine-2.2.0/run/config1/0/U.boundaryField.inlet from line 35 to line 39. From function codedBase::updateLibrary() in file db/dynamicLibrary/dynamicCode/dynamicCode.C at line 81. FOAM exiting Any suggestion? |
|
April 17, 2013, 11:19 |
|
#4 |
Member
Akshay Kumar
Join Date: Aug 2010
Location: India
Posts: 84
Rep Power: 16 |
Hey Elisa
You need to enable the 'allowSystemOperations' switch if you want to use codestream. You should find this in the /etc/controlDict file as the error log suggests. It'll be in the InfoSwitches block. Just make it '1'. Try this and let me know if it's working. Cheers! Akshay |
|
April 17, 2013, 12:38 |
|
#5 |
New Member
Elisa
Join Date: Mar 2013
Posts: 11
Rep Power: 13 |
Yes, it seems working!
But I still have the problem in 0/U.boundaryField.inlet folder. Do you know the meaning of it? The error is the following: --> FOAM FATAL IO ERROR: Failed wmake "dynamicCode/ramp/platforms/linux64GccDPOpt/lib/libramp_4339e3a808a66e5078fd653aa8a6180bb899c643.s o" file: /home/cosine/OpenFOAM/cosine-2.2.0/run/config1/0/U.boundaryField.inlet from line 35 to line 39. From function codedBase::createLibrary(..) in file db/dynamicLibrary/codedBase/codedBase.C at line 202. FOAM exiting Thank you!!! |
|
April 17, 2013, 12:49 |
|
#6 |
Member
Akshay Kumar
Join Date: Aug 2010
Location: India
Posts: 84
Rep Power: 16 |
............
|
|
April 17, 2013, 15:58 |
|
#7 |
New Member
Elisa
Join Date: Mar 2013
Posts: 11
Rep Power: 13 |
Does it mean that you don't have any idea?
|
|
April 18, 2013, 00:29 |
|
#8 |
Member
Akshay Kumar
Join Date: Aug 2010
Location: India
Posts: 84
Rep Power: 16 |
Hey
Just a few small changes here. Works for me. #{ scalar U_0=0.049954; //mean U.This isn't the max velocity of the profile. scalar r=0.02; //mean Radius. in the 3 pipes radius are different. fixedValueFvPatchVectorField myPatch(*this); forAll(this->patch().Cf(),i) { myPatch[i]=vector(2*U_0*(1-Foam : : pow(this->patch().Cf()[i].x(),2)/Foam : : pow(r,2)),0,0); } operator==(myPatch); #}; I've intentionally given spaces between the Foam : : pow otherwise the smiley appears Cheers! Ak |
|
April 23, 2013, 11:52 |
|
#9 |
New Member
Elisa
Join Date: Mar 2013
Posts: 11
Rep Power: 13 |
Thank you so much!
Actually I'm really confused: now I have this kind of error: --> FOAM FATAL ERROR: Unknown functionEntry '' in "C:/Users/Administrator/Desktop/OpenFOAM/USRNAME-1. .0/Y/0/U" near line 48 Valid functionEntries are : 4 ( include includeIfPresent inputMode remove ) From function functionEntry::execute(const word& functionName, dictionary& arentDict, Istream&) in file db/dictionary/functionEntries/functionEntry/functionEntry.C at line 83. FOAM exiting what is the meaning of this error?? how can I try to fix it? Sorry for all my questions!!!! Last edited by Guenda; April 23, 2013 at 12:58. |
|
April 23, 2013, 13:26 |
|
#10 |
New Member
Elisa
Join Date: Mar 2013
Posts: 11
Rep Power: 13 |
I forgot to write that as soon as the simulation starts this warning appears:
--> FOAM Warning : From function IOstream::compressionEnum(const word&) in file db/IOstreams/IOstreams/IOstream.C at line 74 bad compression specifier 'off', using 'uncompressed' Create mesh for time = 0 |
|
April 24, 2013, 11:03 |
|
#11 |
Member
Akshay Kumar
Join Date: Aug 2010
Location: India
Posts: 84
Rep Power: 16 |
well well well...i'll need to look at your U file. send it across..and also your controlDict.
|
|
April 24, 2013, 12:50 |
|
#12 |
New Member
Elisa
Join Date: Mar 2013
Posts: 11
Rep Power: 13 |
I should have fixed the 'warning' changing in controlDict 'writeCompression off;' in 'uncompressed;'. I don't have that warning but I still have the error.
My 0/U file is: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { inlet { //type zeroGradient; //for simpleFOAM //type freestream; //freestreamValue uniform (0 0 0 4.94745); //uniche condizioni x cui si ha qlc: //type fixedValue; //pressureInletVelocity; //value uniform (0 0 0.049954); //codice matlab 1/3 //Profilo parabolico type codedFixedValue; value $internalField; redirectType ramp; code #{ scalar U_0=0.049954; //Umean scalar r=11.75; //radius fixedValueFvPatchVectorField myPatch(*this); forAll (this->patch().Cf(),i) { myPatch[i]=vector(2*U_0*(1-Foam:: pow(this->patch(),Cf()[i].x(),2)/Foam:: pow(r,2)),0,0); } operator==(myPatch); #}; } outlet { type zeroGradient; //freestream; //freestreamValue uniform (0 0 1.44048); //type fixedValue; //value uniform (0 0 0.0716); } wall { //type zeroGradient; type fixedValue; value uniform (0 0 0); } //defaultFaces //{ // type zeroGradient; // } } // ************************************************** *********************** // and controlDict: application icoFoam; startFrom startTime; startTime 0; stopAt endTime; endTime 0.5; deltaT 0.067909; writeControl timeStep; writeInterval 1; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression uncompressed; timeFormat general; timePrecision 6; thank you! |
|
May 14, 2013, 07:11 |
|
#13 |
New Member
Elisa
Join Date: Mar 2013
Posts: 11
Rep Power: 13 |
Now I am thinking: could my error come from the old version of OpenFOAM that I'm using? I mean, is it possibile to create a parbolic profile in the openFOAM 1.7.0 version??
Thank you!!! |
|
May 15, 2013, 04:02 |
|
#14 |
Senior Member
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18 |
Hi Guenda,
I think it is easier if you use swak4foam capability. Have a look at the following link (4.2.2 Swirl on inlet) http://openfoamwiki.net/index.php/Contrib_groovyBC Add following lines in your 0/U file: INLET { type groovyBCFixedValue; variables ( "velIn=0.05;" //velIn is the normal mean inlet velocity "c=sum(pos()*mag(Sf()))/sum(mag(Sf()));" //c is the centre of the patch "n=sum(normal())/mag(sum(normal()));" //n is the averaged patch normal "pp=pos()-c;" "r=mag(pp)+1.0e-10;" "R=max(r);" ); valueExpression "-velIn*normal()*(1-pow(r/R,2))"; value uniform (0.05 0 0); } And add following lines in your system/controlDict file: libs ( "libOpenFOAM.so" "libgroovyBC.so" "libgroovyStandardBCs.so" "libsimpleFunctionObjects.so" "libsimpleSwakFunctionObjects.so" "libswakFunctionObjects.so" ) ; Regards, Stephane. |
|
October 30, 2013, 07:14 |
|
#15 |
Member
sandy
Join Date: Mar 2013
Location: Cardiff, UK
Posts: 74
Rep Power: 13 |
Dear openfoam_user,
I had a look at your post no #14 in this thread. Because I need a 3D B.C parabolic for my inlet velocity, so I used your code for my solver interFoam with OF2.1.1. It works very well but I have a question about it. When I visualize the velicity profile with paraFoam, i do not get the parabolic profile for the time step 0, but once I start the simulation I get it directly for the first time step(after 0). Is this correct? should not we get it from the 0 time step we we visualize? Thank you so much in advance.. Sandy13, |
|
October 30, 2013, 07:21 |
|
#16 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
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 |
||
October 30, 2013, 07:54 |
|
#17 |
Senior Member
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18 |
Dear Sandy13,
I have checked one of my computations. You are right. At time step 0 sec you don't have the parabolic profile yet. Only the following velocity values are imposed (from my above example): value uniform (0.05 0 0). Best regards, Stephane. |
|
November 18, 2016, 03:18 |
Parabolic velocity profile for rectangular ducts
|
#18 | |
Senior Member
vidyadhar
Join Date: Jul 2016
Posts: 138
Rep Power: 10 |
Quote:
Hello Stephane, I am simulating flow through a T-junction (with one inlet & 2 outlets; with 2 inlets & 1 outlet as well). I need to implement fully developed condition at the inlet(s). I think the above code provided by you is for circular cross sections. But, the cross-section in my geometry is a square one. So, I request you to let me know how to provide the fully developed conditions at inlet for square cross-section pipes. Thanks & Regards, vidyadhar |
||
November 21, 2016, 06:20 |
|
#19 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
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 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
parabolic inlet velocity condition | ofslcm | OpenFOAM Programming & Development | 12 | February 5, 2014 01:30 |
velocity profile inlet boundary condition question | Lcw | FLUENT | 3 | August 3, 2012 06:53 |
2D air parabolic velocity profile | ilker | FLUENT | 2 | November 12, 2008 09:43 |
How to create a parabolic velocity profile | Nelson | FLUENT | 0 | July 7, 2005 03:49 |
Variables Definition in CFX Solver 5.6 | R P | CFX | 2 | October 26, 2004 03:13 |