Accessing surface normal gradient
Hello,
I am trying to access the surface normal gradient of a certain variable (i.e. a) (unstructured grid). fvc::snGrad(a) only gives me the absolute value, right? (surfaceScalarField). How do I get the surfaceVectorField version of that? And on top of that: How does this (hopefully existing) quantity behave on boundary surfaces of a cell? I imagine it being defined as (a(V1)-a(V2))/d. Now if a has a Diriclet condition on the boundary, how would that work? (Can't define a Neumann bc, the change of gradient on the boundary is crucial for my function). Would be great if someone could give me a hint here :) Thanks in advance. |
A surface*Normal*Gradient always only has a magnitude, because the direction is given by the face normal. snGrad(a) * mesh.Sf() I guess will give you the gradient vector.
|
mesh.Sf() also includes the face area rght? So I guess mesh.Sf()/mesh.magSf() should do it then? Thanks by the way!
Still though, how does it behave at boundaries? Would it use the value on the boundary instead of the neighboring volume? |
Right. About the boundary question - why would snGrad neglect your boundary conditions, no matter what you select?
|
Hi ,
I have a variable p for which I want to calculate the gradient normal to the surface in both x and y directions. Can anyone help me ? With regards |
I suggest you write your own tool by modifying gradU utility of OpenFOAM or you can use swak4foam, I guess.
Quote:
|
All times are GMT -4. The time now is 21:56. |