- **OpenFOAM**
(*http://www.cfd-online.com/Forums/openfoam/*)

- - **first order gradient scheme ??**
(*http://www.cfd-online.com/Forums/openfoam/76438-first-order-gradient-scheme.html*)

first order gradient scheme ??Hi.
I want to implement something seemingly simple, but I've managed to waste half a day on this already... All I want to do is to implement a gradient scheme for a scalar that is first order upwind. (ie; for a discrete jump in field values, I only want ONE cell to show a value for the gradient) presumably, something along the lines of: gradSchemes { grad(p) Gauss linearUpwind ; } should work, but this takes me down a path of error messages such as: request for surfaceScalarField Gauss from objectRegistry region0 failed available objects of type surfaceScalarField are 3 ( weightingFactors differenceFactors_ phi ) where following the suggested options leads to nothing useful. Any help sincerely appreciated. |

I do not know why you need a linear upwind differencing for the pressure gradient. Upwind is applied for the convection term in the N-S equation.
The error message means that the field in the grad operator (in your case p) is not a surfaceScalarField. I think gradSchemes { grad(p) Gauss linear; } will work in your case. Best, |

I never said I was solving NS equations, using the scalar
p perhaps confuses people.Let me graphically illustrate what I'm seeking: https://dl.dropbox.com/u/5754007/grad_s_scheme.jpg http://dl.dropbox.com/u/5754007/grad_s_scheme.pdf http://dl.dropbox.com/u/5754007/grad_s_scheme.pdf |

by just not giving up, I got what I wanted:
http://dl.dropbox.com/u/5754007/p_view.jpg the magic code: grad(s) faceLimited Gauss upwind phi 0; thanks to all who looked in on this. |

All times are GMT -4. The time now is 21:05. |