|
[Sponsors] |
Near Wall Parallel Derivatives at First Grid Node |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 28, 2011, 13:53 |
Near Wall Parallel Derivatives at First Grid Node
|
#1 |
Senior Member
n/a
Join Date: Sep 2009
Posts: 199
Rep Power: 17 |
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: 17 |
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: 199
Rep Power: 17 |
I will check it, thanks.
Cheers, Deji |
|
January 3, 2012, 10:49 |
|
#4 |
Senior Member
n/a
Join Date: Sep 2009
Posts: 199
Rep Power: 17 |
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: 17 |
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: 199
Rep Power: 17 |
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:30 |
|
#7 |
Senior Member
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 17 |
if you need gradients, then you can implement following in your code:
if (runTime.outputTime()) { volVectorField gradp(fvc::grad(p)); volScalarField gradpx ( IOobject ( "gradPx", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), gradp.component(vector::X) ); volScalarField gradpy ( IOobject ( "gradpy", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), gradp.component(vector::Y) ); volScalarField gradpz ( IOobject ( "gradpz", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), gradp.component(vector::Z) ); runTime.write(); } In the same way you can write reference for the code is "write.H" file in laplacianFoam tutorial. you will have to add these lines in your solver. I suggest you look through laplacianFoam solver code to understand better. |
|
January 3, 2012, 16:32 |
|
#8 |
Senior Member
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 17 |
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: 199
Rep Power: 17 |
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: 17 |
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: 199
Rep Power: 17 |
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: 17 |
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: 199
Rep Power: 17 |
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: 17 |
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<<gradP.boundaryField()[patchi].patchInternalField()<<endl; } } you can use OFstream class of OF to write to a file instead of Info. Please let me know if this works In my previous post I had explained way to write the components in three different files. I would like to know whether you are getting any difference betweenonly on boundaries) gradP written in the single file (it will be a vector with three components) gradPx, gradPy and gradPz written in individual files For some cases I am simulating, I observed difference in these values except for cases where the mesh is orthogonal everywhere. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Natural convection in a closed domain STILL NEEDING help! | Yr0gErG | FLUENT | 4 | December 2, 2019 01:04 |
Superlinear speedup in OpenFOAM 13 | msrinath80 | OpenFOAM Running, Solving & CFD | 18 | March 3, 2015 06:36 |
HELP! grid check failed in parallel fluent | restart | FLUENT | 0 | March 5, 2011 10:55 |
Multicomponent fluid | Andrea | CFX | 2 | October 11, 2004 06:12 |
distance from the wall to the first grid point | Wenqing Zhang | CFX | 0 | August 9, 2004 11:08 |