|
[Sponsors] |
February 28, 2011, 10:35 |
snGrad at a boundary patch
|
#1 |
New Member
Join Date: Jul 2010
Posts: 6
Rep Power: 15 |
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 |
|
March 1, 2011, 08:33 |
|
#2 |
Senior Member
David Boger
Join Date: Mar 2009
Location: Penn State Applied Research Laboratory
Posts: 146
Rep Power: 17 |
Is the sign always opposite to the one you expect, or it is mixed?
__________________
David A. Boger |
|
March 1, 2011, 09:02 |
|
#3 |
New Member
Join Date: Jul 2010
Posts: 6
Rep Power: 15 |
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 |
|
March 1, 2011, 21:42 |
|
#4 |
Senior Member
David Boger
Join Date: Mar 2009
Location: Penn State Applied Research Laboratory
Posts: 146
Rep Power: 17 |
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 |
|
March 10, 2011, 07:12 |
|
#5 |
New Member
Join Date: Jul 2010
Posts: 6
Rep Power: 15 |
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 |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |