CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

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

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

Like Tree2Likes
  • 2 Post By charlotte

Reply
 
LinkBack Thread Tools Display Modes
Old   January 2, 2012, 13:11
Default 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: 8
Marc10 is on a distinguished road
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<class Type>
void Foam::partialSlipFvPatchField<Type>::evaluate
(
    const Pstream::commsTypes
)
{
    if (!this->updated())
    {
        this->updateCoeffs();
    }

    tmp<vectorField> nHat = this->patch().nf();

    Field<Type>::operator=
    (
        (1.0 - valueFraction_)
       *transform(I - sqr(nHat), this->patchInternalField())
    );

    transformFvPatchField<Type>::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
Marc10 is offline   Reply With Quote

Old   October 31, 2012, 16:15
Default
  #2
New Member
 
Charlotte
Join Date: Oct 2009
Posts: 16
Rep Power: 8
charlotte is on a distinguished road
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 and axyz0390 like this.
charlotte is offline   Reply With Quote

Old   July 4, 2013, 08:12
Default
  #3
Senior Member
 
Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 5
Sherlock_1812 is on a distinguished road
Quote:
Originally Posted by charlotte View Post
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++,

Thanks in advance
__________________
Regards,

Srivaths
Sherlock_1812 is offline   Reply With Quote

Old   August 16, 2013, 21:24
Default
  #4
New Member
 
Charlotte
Join Date: Oct 2009
Posts: 16
Rep Power: 8
charlotte is on a distinguished road
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 View Post
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
charlotte is offline   Reply With Quote

Old   February 13, 2014, 08:51
Default
  #5
Senior Member
 
Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 5
Sherlock_1812 is on a distinguished road
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
Sherlock_1812 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
boundary conditions for simpleFoam calculation foam_noob OpenFOAM Running, Solving & CFD 8 July 1, 2015 08:07
Water subcooled boiling Attesz CFX 7 January 5, 2013 04:32
inlet velocity boundary condition murali CFX 5 August 3, 2012 08:56
slip velocity on boundary (V.P.M) Lee, Juhee Main CFD Forum 3 October 22, 1998 15:30


All times are GMT -4. The time now is 19:52.