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

snGrad at a boundary patch

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

Like Tree2Likes
  • 2 Post By EHo

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 28, 2011, 10:35
Default snGrad at a boundary patch
  #1
EHo
New Member
 
Join Date: Jul 2010
Posts: 6
Rep Power: 15
EHo is on a distinguished road
Hi all,

I'm trying to write the normal gradient of my temperature field T at a particular boundary patch = freeSurface to a file. I tried it like:

label patchIDsurf = mesh.boundaryMesh().findPatchID("freeSurface");
scalarField freeSurfaceTgrad(T.boundaryField()[patchIDsurf].snGrad());

and wrote the data to a file. The result is far from the value I can estimate in parafoam, not even the sign is true. I don't understand why! How doing it in the right way?

Best, Ernst
EHo is offline   Reply With Quote

Old   March 1, 2011, 08:33
Default
  #2
Senior Member
 
David Boger
Join Date: Mar 2009
Location: Penn State Applied Research Laboratory
Posts: 146
Rep Power: 17
boger is on a distinguished road
Is the sign always opposite to the one you expect, or it is mixed?
__________________
David A. Boger
boger is offline   Reply With Quote

Old   March 1, 2011, 09:02
Default
  #3
EHo
New Member
 
Join Date: Jul 2010
Posts: 6
Rep Power: 15
EHo is on a distinguished road
It's mixed and the ratio between the written data "gradTwritten" and the data from Paraview "gradTexpected" is gradTwritten/gradTexpected \approx -6e3.

In the meantime I thought is has maybe to do with the corresponding face area, but the face area is A = 5e-9.

Any more ideas?

Best, Ernst
EHo is offline   Reply With Quote

Old   March 1, 2011, 21:42
Default
  #4
Senior Member
 
David Boger
Join Date: Mar 2009
Location: Penn State Applied Research Laboratory
Posts: 146
Rep Power: 17
boger is on a distinguished road
Not obvious to me that you're doing anything wrong. What type of boundary condition is it, and what does your fvSchemes dictionary say about snGradSchemes? Anything unusal about your grid along that boundary?

Have you looked at wallHeatFlux.C or wallGradU.C? Looks like you already have similar logic, but the utilities calculate all of the boundaries and write them out together - maybe it would help you to look at some of the other boundaries too.
__________________
David A. Boger
boger is offline   Reply With Quote

Old   March 10, 2011, 07:12
Default
  #5
EHo
New Member
 
Join Date: Jul 2010
Posts: 6
Rep Power: 15
EHo is on a distinguished road
I think that it does not make any sense to calculate the surface normal gradient out of the data from a patch, because I guess that there is no data from neighbors and without neighbor cells there is no way to derive a gradient!?

Now I will try to do it like:

surfaceVectorField FvolGrad = fvc::interpolate(fvc::grad(Fvol));
vectorField FsurfGrad = FvolGrad.boundaryField()[patchID];
vectorField normal = patch().Sf()/patch().magSf();
scalarField snGradF = FsurfGrad & normal;

This works so far within a self-written BC to exclude the groovy BC and will try to implement this into my post-processing tool.

If it will not work, I'll be back!

So long
rajibroy and meth like this.
EHo is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Gmsh] gmsh and boundary layers kanuk OpenFOAM Meshing & Mesh Conversion 11 August 14, 2015 12:35
inlet velocity boundary condition murali CFX 5 August 3, 2012 08:56
[Other] StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 04:38
Cyclic boundary condition qtian OpenFOAM Running, Solving & CFD 3 November 12, 2008 21:23
Boundary conditions? Tom Main CFD Forum 0 November 5, 2002 01:54


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