Wall BC varying with tube radius
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 |
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 { Code:
right Hope this helps. |
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 |
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? |
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. |
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. |
Navier Slip condition
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 |
All times are GMT -4. The time now is 14:54. |