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

Near Wall Parallel Derivatives at First Grid Node

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

Reply
 
LinkBack Thread Tools Display Modes
Old   December 28, 2011, 13:53
Default Near Wall Parallel Derivatives at First Grid Node
  #1
Senior Member
 
n/a
Join Date: Sep 2009
Posts: 198
Rep Power: 8
deji is on a distinguished road
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
deji is offline   Reply With Quote

Old   December 30, 2011, 03:20
Default
  #2
Senior Member
 
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 8
doubtsincfd is on a distinguished road
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
doubtsincfd is offline   Reply With Quote

Old   December 30, 2011, 10:14
Default
  #3
Senior Member
 
n/a
Join Date: Sep 2009
Posts: 198
Rep Power: 8
deji is on a distinguished road
I will check it, thanks.

Cheers,
Deji
deji is offline   Reply With Quote

Old   January 3, 2012, 10:49
Default
  #4
Senior Member
 
n/a
Join Date: Sep 2009
Posts: 198
Rep Power: 8
deji is on a distinguished road
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
deji is offline   Reply With Quote

Old   January 3, 2012, 13:41
Default
  #5
Senior Member
 
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 8
doubtsincfd is on a distinguished road
look at this:
/opt/openfoam210/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle

and

http://www.cfd-online.com/Forums/ope...tml#post337703
doubtsincfd is offline   Reply With Quote

Old   January 3, 2012, 16:20
Default
  #6
Senior Member
 
n/a
Join Date: Sep 2009
Posts: 198
Rep Power: 8
deji is on a distinguished road
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?
deji is offline   Reply With Quote

Old   January 3, 2012, 16:30
Default
  #7
Senior Member
 
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 8
doubtsincfd is on a distinguished road
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.
doubtsincfd is offline   Reply With Quote

Old   January 3, 2012, 16:32
Default
  #8
Senior Member
 
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 8
doubtsincfd is on a distinguished road
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.
doubtsincfd is offline   Reply With Quote

Old   January 3, 2012, 16:48
Default
  #9
Senior Member
 
n/a
Join Date: Sep 2009
Posts: 198
Rep Power: 8
deji is on a distinguished road
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.
deji is offline   Reply With Quote

Old   January 3, 2012, 16:58
Default
  #10
Senior Member
 
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 8
doubtsincfd is on a distinguished road
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.
doubtsincfd is offline   Reply With Quote

Old   January 3, 2012, 17:17
Default
  #11
Senior Member
 
n/a
Join Date: Sep 2009
Posts: 198
Rep Power: 8
deji is on a distinguished road
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()?
deji is offline   Reply With Quote

Old   January 3, 2012, 17:30
Default
  #12
Senior Member
 
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 8
doubtsincfd is on a distinguished road
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.
doubtsincfd is offline   Reply With Quote

Old   January 4, 2012, 10:19
Default
  #13
Senior Member
 
n/a
Join Date: Sep 2009
Posts: 198
Rep Power: 8
deji is on a distinguished road
Thank you very much Omkar, you gave me really good feedbacks. Thanks again.

Cheers,
Deji
deji is offline   Reply With Quote

Old   January 5, 2012, 14:35
Default
  #14
Senior Member
 
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 8
doubtsincfd is on a distinguished road
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.
doubtsincfd 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
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36
Natural convection in a closed domain STILL NEEDING help! Yr0gErG FLUENT 3 June 12, 2013 02:12
HELP! grid check failed in parallel fluent restart FLUENT 0 March 5, 2011 10:55
Multicomponent fluid Andrea CFX 2 October 11, 2004 05:12
distance from the wall to the first grid point Wenqing Zhang CFX 0 August 9, 2004 10:08


All times are GMT -4. The time now is 23:42.