|
[Sponsors] |
August 26, 2016, 04:49 |
Wall BC varying with tube radius
|
#1 |
New Member
Giannokostas Konstantinos
Join Date: Aug 2016
Posts: 6
Rep Power: 9 |
Hello Everyone,
If i have a pipe flow and I want to impose a slip condition at the wall varying with local tube radius, cause the tube is not straight but it's radius is different from point to point. How can I insert R in this expression : Wall { type codedFixedValue; value uniform (0 0 0); redirectType rampedFixedValue; code #{ vector (0, 0 , f(R)*DUz/Dy); #}; } Thank you very much |
|
October 2, 2016, 13:50 |
|
#2 |
Senior Member
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 15 |
Hey Giannokostas
Look at these two samples. Hope you find the idea Before defining your vector, you need to define your function correctly. Code:
inlet { type codedFixedValue; value uniform (0 0 0); redirectType velocitySquareInlet; code #{ const fvPatch& boundaryPatch = patch(); const vectorField& Cf = boundaryPatch.Cf(); vectorField& field = *this; scalar min = 0.501; scalar max = 0.751; forAll(Cf, faceI) { if ( (Cf[faceI].z() > min) && (Cf[faceI].z() < max) && (Cf[faceI].y() > min) && (Cf[faceI].y() < max) ) { field[faceI] = vector(0.1, 0, 0); } } #}; } Code:
right { type codedFixedValue; value uniform 0; redirectType rampedFixedValue; code #{ (*this)==scalar(1.1*log(1.0)); // (*this)==vector(0.5*sin(3.141592)*this->db().time().value())/2,0,0); #}; Hope this helps. Last edited by babakflame; October 2, 2016 at 16:20. |
|
October 6, 2016, 03:52 |
|
#3 |
New Member
Sachin
Join Date: Sep 2016
Location: Poitiers,France
Posts: 17
Rep Power: 9 |
I am using codedFixedValue bc for implementing ΔV=0 ;where V=x2+y2+z2
my boundarycondition at 0/phi is: inlet { type codedFixedValue; value uniform 0; redirectType velocitySquareInlet; code #{ const fvPatch& boundaryPatch = patch(); const vectorField& Cf = boundaryPatch.Cf(); scalarField& field = *this; forAll(Cf, faceI) { ( (Cf[faceI].x()=0) && (Cf[faceI].y()=0) && (Cf[faceI].z()=0) ) { field[faceI] = ((Cf[faceI].x()*Cf[faceI].x()) +(Cf[faceI].y()*Cf[faceI].y()) +(Cf[faceI].z()*Cf[faceI].z())); } } #}; But in terminal I have error in BC does anyone have idea where I am wrong? thanks |
|
October 6, 2016, 16:34 |
|
#4 |
Senior Member
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 15 |
Hey Sachin
Can u post the error and describing your boundary a little more? Is it a scalar or vector?? You are trying to define a gradient. Isn't gradient a vector? Last edited by babakflame; October 6, 2016 at 17:42. |
|
October 7, 2016, 03:43 |
|
#5 |
New Member
Sachin
Join Date: Sep 2016
Location: Poitiers,France
Posts: 17
Rep Power: 9 |
Good morning Bobi,
I solved problem. actually it is a scalar and the solution is FoamFile { version 2.0; format ascii; class volScalarField; object phi; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 2 -3 0 0 -1 0]; internalField uniform 0; boundaryField { inlet { type codedFixedValue; value uniform 0; redirectType velocitySquareInlet; code #{ const fvPatch& boundaryPatch = patch(); const vectorField& Cf[/B] = boundaryPatch.Cf(); scalarField& field = *this; forAll(Cf, faceI) { { field[faceI] = ((Cf[faceI].x()*Cf[faceI].x()) +(Cf[faceI].y()*Cf[faceI].y()) +(Cf[faceI].z()*Cf[faceI].z())); } } #}; } I don't under one thing in the code is, my class is scalar. but in the code beginning, I have to write "const vectorField& CF" why? My field is scalar. now code is work perfectly....but still dont understand this function meaning. |
|
October 7, 2016, 10:36 |
|
#6 |
Senior Member
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 15 |
Hey Sachin
Good thing that u posted the final code for others. It would be even nicer if u use the link for code so as your posted code becomes distinguishable from other lines. cf() member function returns the location of the face center as a vector. So, when u want to use it to as a member function for an object (boundaryPatch) of class fvPatch, the result is a vectorField. I tried to describe it clearly. Hope this helped you. |
|
October 14, 2016, 06:09 |
Navier Slip condition
|
#7 |
New Member
Giannokostas Konstantinos
Join Date: Aug 2016
Posts: 6
Rep Power: 9 |
Hello everyone ,
Thanks for your replies i found them very useful. But still wonder , how can I insert a velocity component derivative (i.e. dUz/dy) to impose a Navier-Slip condition at the wall using the codeFixed utility.. Thank you K.G |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Basic Nozzle-Expander Design | karmavatar | CFX | 20 | March 20, 2016 08:44 |
Difficulty In Setting Boundary Conditions | Moinul Haque | CFX | 4 | November 25, 2014 17:30 |
U Tube Heat transfer- unable to get Nusselt No on wall | Gowrav | FLUENT | 0 | March 20, 2013 12:51 |
[Other] How to set up a dynamic mesh for a piston moving through a tube of variable diameter? | karkar | OpenFOAM Meshing & Mesh Conversion | 0 | July 4, 2012 06:54 |
Wall functions | Abhijit Tilak | Main CFD Forum | 6 | February 5, 1999 01:16 |