CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Surface roughness (https://www.cfd-online.com/Forums/openfoam-solving/58050-surface-roughness.html)

leonardo.oliveira October 1, 2014 10:09

Hello Burak,

I've downloaded the roughnessToFoam application but I can't use it. It asks for a z0 file in the "0" folder and I don't know how to write it.

Can you upload some z0 file so I can use it as an example, or show me how to write it.

Thanks in advance.
Sorry for the bad English.

Burak_1984 October 13, 2014 15:45

Hi Leonardo

It has been a while since I ran this program.But as far as I remember the program didn't work for me either.So I cannot help you with the file.

What I did was to group my mesh to create patches like Mojtaba mentioned.Meshlab was a usefull tool for that.So the solution was more of a "manual" one than of an automatic one.

Wish you the best luck!

Regards
Burak

leonardo.oliveira October 15, 2014 07:08

Thanks for the reply man, I'will try what Mojtaba did.

Thank you.

Shuveksha July 12, 2021 10:29

Quote:

Originally Posted by niklas (Post 196228)
I have added surface roughness according to the fluent manual.
found for instance here http://web.njit.edu/topics/Prog_Lang_Docs/html/FLUENT/fluent/fluent5/ug/html/nod e195.htm

What I did was to add

Ks_
(
dimensioned<scalar>::lookupOrAddToDict
(
"Ks",
subDict("wallFunctionCoeffs"),
0.0
)
),

Cs_
(
dimensioned<scalar>::lookupOrAddToDict
(
"Cs",
subDict("wallFunctionCoeffs"),
0.0
)
),

to RASModel.H and the corresponding stuff in RASModel.C

and in wallViscosityI.H i modified the for-loop to

forAll(curPatch, facei)
{
label faceCelli = curPatch.faceCells()[facei];

scalar uStar = Cmu25*sqrt(k_[faceCelli]);
scalar yPlus = y_[patchi][facei]*uStar/nuw[facei];
scalar KsPlus = Ks_.value()*uStar/nuw[facei];

// hydrodynamically smooth
scalar logDB = 1.0;

if (KsPlus > 2.25)
{
// fully rough
if (KsPlus > 90.0)
{
logDB = 1.0 + Cs_.value()*KsPlus;
}
else
// transitional
{
scalar n = ::sin(0.4258*(log(KsPlus) - 0.811))
scalar a = (KsPlus - 2.25)/87.75 + Cs_.value()*KsPlus;
logDB = ::pow(a, n);
}
}

if (yPlus > yPlusLam_)
{
nutw[facei] =
nuw[facei]
*(yPlus*kappa_.value()/log(E_.value()*yPlus/logDB) - 1);
}
else
{
nutw[facei] = 0.0;
}
}

using the facts that
log(A)-log(B) = log(A/B)
log(A)*n = log(A^n)

you essentially just need to divide the wall constant E with the variable logDB.

Normally setting the constants to zero would revert to the normal smooth approach, but not here and that is easily fixed also.
But is there anything else I need to modify that I have missed or is this all I have to do?

N

Where do you write this program?


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