# How to access gradient near the boundary for Navier slip bc?

 Register Blogs Members List Search Today's Posts Mark Forums Read

 January 2, 2012, 13:11 How to access gradient near the boundary for Navier slip bc? #1 New Member   Marc-Florian Uth Join Date: Jan 2010 Posts: 10 Rep Power: 9 Sponsored Links Hi! I am trying to implement a boundary condition based on the Navier slip model, where the velocity at the wall is a function of the velocity gradient at the wall: U = ls * du/dn For this, I have to access du/dn (the velocity gradient normal to the wall) in the field. Is there a function for this similar to this->patchInternalField()? As a starting point I use the partialSlip bc from OpenFoam. Code: ```template void Foam::partialSlipFvPatchField::evaluate ( const Pstream::commsTypes ) { if (!this->updated()) { this->updateCoeffs(); } tmp nHat = this->patch().nf(); Field::operator= ( (1.0 - valueFraction_) *transform(I - sqr(nHat), this->patchInternalField()) ); transformFvPatchField::evaluate(); }``` Here I guess I just have to replace the operator= argument with the above equation. But how can I access or calculate the gradient at or in the cell next to the wall? I appreciate any help! Thank you! marc

 October 31, 2012, 16:15 #2 New Member   Charlotte Join Date: Oct 2009 Posts: 16 Rep Power: 9 Hi Marc, Sorry for giving an answer so late, but I guess other people may be interested by the answer. The easiest to create this BC is to copy the one in: \$FOAM_SOLVERS/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip and replace the "valueFraction_" by "1/(1+slipLength_*this->patch().deltaCoeffs())" To get a better understanding, the distance from the boundary face center to near wall center is D=1/deltaCoeffs. nHat is the normal vector at the boundary. You want Uwall=l dU/dn = l (Uc-Uwall)/D So Uwall = (l/D)/(1+l/D)U = (1-1/(1+l/D))U To make sure that youget only a tangential component, you multiply by transform(I-nHat*nHat) Note that if you surface is curved, you may need some additional correction and you can check the Maxwell BC in the same folder to get an idea how to do it. Dzhordzhs, axyz0390 and Lei Wang like this.

July 4, 2013, 08:12
#3
Senior Member

Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 6
Quote:
 Originally Posted by charlotte Hi Marc, Sorry for giving an answer so late, but I guess other people may be interested by the answer. The easiest to create this BC is to copy the one in: \$FOAM_SOLVERS/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip and replace the "valueFraction_" by "1/(1+slipLength_*this->patch().deltaCoeffs())" To get a better understanding, the distance from the boundary face center to near wall center is D=1/deltaCoeffs. nHat is the normal vector at the boundary. You want Uwall=l dU/dn = l (Uc-Uwall)/D So Uwall = (l/D)/(1+l/D)U = (1-1/(1+l/D))U To make sure that youget only a tangential component, you multiply by transform(I-nHat*nHat) Note that if you surface is curved, you may need some additional correction and you can check the Maxwell BC in the same folder to get an idea how to do it.
Hi ,

I am asking this question in this thread because I'm dealing with a curved boundary patch and also require U on that curved patch to be given as a BC.

I've had a look at the maxwell BC, but my C++ isn't that good. So can i confirm if transform(I-nHat*nHat) will give the value of U along the curved patch?

Also with respect to this solver, why are the variables thermalCreep and curvature of the 'true/false' type? and what is accomodation factor?

Kindly excuse the barrage of questions as I'm new to OpenFOAM and C++,

__________________
Regards,

Srivaths

August 16, 2013, 21:24
#4
New Member

Charlotte
Join Date: Oct 2009
Posts: 16
Rep Power: 9
Hi Srivaths,

unfortunately, in my case I didn't need for a curved boundary face, so I never looked into the details. Like you, I'm not an expert in C++, but fortunately, Openfoam is written such that you don't really need to be an expert. So I was able to write a slip BC without learning the whole C++ language

Anyway, if you look at the maxwell BC, you can see that they make reference to a curvature class and I'm guessing you need to code sth similar to there. Since I was considering flat wall, I never try to understand that part...

I don't know much about the Maxwell BC: I think it's a slip BC with a temperature jump at the boundary based on Boltzmann's equation. I googled it and there is plenty of literature about it (http://www4.ncsu.edu/~ces/pdfversions/246.pdf for instance).

Sorry for not being more help, but I pretty much shared all my knowledge in my previous post ...

Charlotte

Quote:
 Originally Posted by Sherlock_1812 Hi , I am asking this question in this thread because I'm dealing with a curved boundary patch and also require U on that curved patch to be given as a BC. I've had a look at the maxwell BC, but my C++ isn't that good. So can i confirm if transform(I-nHat*nHat) will give the value of U along the curved patch? Also with respect to this solver, why are the variables thermalCreep and curvature of the 'true/false' type? and what is accomodation factor? Kindly excuse the barrage of questions as I'm new to OpenFOAM and C++, Thanks in advance

 February 13, 2014, 08:51 #5 Senior Member   Srivathsan N Join Date: Jan 2013 Location: India Posts: 101 Rep Power: 6 Charlotte, I'm getting back to this thread really late, because I was trying to work around a tangential gradient of velocity (for a curved surface). My question is this: What happens when I set refValue and valueFraction = 0 in mixedFixedValueSlip? I'm guessing that it will - return only the tangential gradient in the 'Return gradient at boundary part' - might also return a value of velocity for the patch in 'Evaluate the field on the patch' section (evaluated from the (1 - valueFraction...) part) How do I just get the former? a mixedFixedGradientSlip may be? __________________ Regards, Srivaths

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post foam_noob OpenFOAM Running, Solving & CFD 8 July 1, 2015 08:07 Attesz CFX 7 January 5, 2013 04:32 murali CFX 5 August 3, 2012 08:56 Lee, Juhee Main CFD Forum 3 October 22, 1998 15:30