# Near Wall Parallel Derivatives at First Grid Node

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

 December 28, 2011, 13:53 Near Wall Parallel Derivatives at First Grid Node #1 Senior Member   n/a Join Date: Sep 2009 Posts: 198 Rep Power: 9 Sponsored Links Good day to all here at the forum. I am trying to compute the near wall parallel derivatives for a wall function being implemented for my research. I know that SnGrad() gives the wall normal derivative--> dU/dn_wall, so how would I compute dP/dx at the first grid node? Cheers, Deji

 December 30, 2011, 03:20 #2 Senior Member   Join Date: Nov 2009 Location: Michigan Posts: 135 Rep Power: 9 have a look for alphaDynamicContact angle. Its somewhere in interfaceProperties.C or some file I cant remember. I has the code for calculating velocity vector parallel to wall. The logic behind the code is: parallel vector = total vector-normal vector normal vector you can get from snGrad etc. Let me know if you dont find the code

 December 30, 2011, 10:14 #3 Senior Member   n/a Join Date: Sep 2009 Posts: 198 Rep Power: 9 I will check it, thanks. Cheers, Deji

 January 3, 2012, 10:49 #4 Senior Member   n/a Join Date: Sep 2009 Posts: 198 Rep Power: 9 I am still looking for the code and yet to find it. I saw some things on the web regarding the multi-phase solver, but nothing yet on wall parallel derivatives. Can you point me in the right direction. Cheers, Deji

 January 3, 2012, 13:41 #5 Senior Member   Join Date: Nov 2009 Location: Michigan Posts: 135 Rep Power: 9 look at this: /opt/openfoam210/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle and http://www.cfd-online.com/Forums/ope...tml#post337703

 January 3, 2012, 16:20 #6 Senior Member   n/a Join Date: Sep 2009 Posts: 198 Rep Power: 9 Thanks much for the feedback Omkar. I did take a look at the code and it's not quite what I am hoping to implement. I am in the process of implementing an LES wall function that requires dP/dx and dU/dx, where x is the streamwise direction. Is there anyone on the forum that might have an idea on this?

 January 3, 2012, 16:32 #8 Senior Member   Join Date: Nov 2009 Location: Michigan Posts: 135 Rep Power: 9 sample command will then write the derivatives on wall. But for calculating at first grid point, you will have to access data at the cell center adjacent to wall. If this is what you want then I can show you how to calculate gradients at first grid point near the wall.

 January 3, 2012, 16:48 #9 Senior Member   n/a Join Date: Sep 2009 Posts: 198 Rep Power: 9 Thanks very much. Actually, yes I would like to calculate dP/dX and dU/dX at the first grid node off the wall. I should be able to access the adjacent wall cell using patchInternalField. So can you give me an example? Thanks.

 January 3, 2012, 16:58 #10 Senior Member   Join Date: Nov 2009 Location: Michigan Posts: 135 Rep Power: 9 Exactly. We will have to calculate gradient throughout the field and then use patchInternalfield(). I will try that and get back to you in a day.

 January 3, 2012, 17:17 #11 Senior Member   n/a Join Date: Sep 2009 Posts: 198 Rep Power: 9 Question, and I think you asked a similar one in the thread you posted: To get velocity adjacent to the wall: vectorField Uadj= U.patchInternalField() - U U is normally taken to be the PatchField volVectorField. So why is U subtracted from U.patchInternalField()?

 January 3, 2012, 17:30 #12 Senior Member   Join Date: Nov 2009 Location: Michigan Posts: 135 Rep Power: 9 my understanding of the code is that Uadj will give velocity relative to the wall. It is a little odd since velocity on the wall is zero so U will be zero. The code for dynamic contact angle might be generalized for moving wall cases in which velocity of adjacent cell center relative to the wall is what is needed in the formula for dynamic contact angle. This is my understanding of the code. The code developer did not reply further to my post else I was going to raise the same question.

 January 4, 2012, 10:19 #13 Senior Member   n/a Join Date: Sep 2009 Posts: 198 Rep Power: 9 Thank you very much Omkar, you gave me really good feedbacks. Thanks again. Cheers, Deji

 January 5, 2012, 14:35 #14 Senior Member   Join Date: Nov 2009 Location: Michigan Posts: 135 Rep Power: 9 you can write in the following way (tho not the cleanest way) volVectorField gradP(fvc::grad(P)); const fvPatchList& patches = mesh.boundary(); forAll(patches,patchi) { const fvPatch& currPatch = patches[patchi]; if(currPatch.name()=="nameOfTheDesiredPatch") { Info<

 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 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36 Yr0gErG FLUENT 3 June 12, 2013 02:12 restart FLUENT 0 March 5, 2011 10:55 Andrea CFX 2 October 11, 2004 05:12 Wenqing Zhang CFX 0 August 9, 2004 10:08