CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   implement roughness boundary conditions for Spalart-Allmaras (

wei_wu June 25, 2009 17:34

implement roughness boundary conditions for Spalart-Allmaras
Hello, all

I'm a new foamer and need help on this problem.

I'm trying to apply the roughness boundary condition on the wall with S-A model.

the wall boundary condition will be : d(nutilda)/dn=nutilda/(d_+0.03*hs)
where d_ is the distance to the wall, which is a variable in the S_A model
hs is the roughness height

my question is howI can implement this new boundary condition.
here is my thought:
there is one basic fixedGradient boundary condition which maybe is a good prototype for me. I will change the evaluate member function in order to get value of (nutilda/(d_+0.03*hs)) for the gradient of nutilda , but I'm so clumsy at C++ and FOAM right now and don't know how to make it happen.

here is the evaluate function:
__________________________________________________ _______________________
template<class Type>
void fixedGradientFvPatchField<Type>::evaluate(const Pstream::commsTypes)
if (!this->updated())

this->patchInternalField() + gradient_/this->patch().deltaCoeffs()

__________________________________________________ ________________________

Thank you all

All times are GMT -4. The time now is 17:50.