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/)
-   -   how can define a depth-dependent property? (https://www.cfd-online.com/Forums/openfoam-solving/116458-how-can-define-depth-dependent-property.html)

adambarfi April 19, 2013 10:23

how can define a depth-dependent property?
 
Hi everybody,

If I want to define the viscosity or gravity acceleration or anything else as a function of depth, what should I do? in example, g=ay^2+b, where y is the height from bottom surface. I searched the internet but I couldn't find anything.

anybody knows how can I do it? can I use pos().y, which is used in groovyBC?

thanks a lot
Mostafa Mahmoudi

Lieven April 21, 2013 03:46

I don't know if it helps you, but you can access the coordinates as (e.g. z-coordinate)
Code:

const volScalarField& Cz = mesh.C().component(vector::Z);
You can use this in the computation of parameters as
Code:

g = a*sqr(Cs)+b
The createFields.H file is a good place to put this if g remains constant during the simulation.

I have never worked with groovyBC so I can't help you with that.

Cheers,

L

adambarfi April 21, 2013 08:40

Quote:

Originally Posted by Lieven (Post 422050)
I don't know if it helps you, but you can access the coordinates as (e.g. z-coordinate)
Code:

const volScalarField& Cz = mesh.C().component(vector::Z);
You can use this in the computation of parameters as
Code:

g = a*sqr(Cs)+b
The createFields.H file is a good place to put this if g remains constant during the simulation.

I have never worked with groovyBC so I can't help you with that.

Cheers,

L

Dear Lieven,

Thank you for your reply. I think your post is what I want. I will test it.

Best
Mostafa


All times are GMT -4. The time now is 13:58.