CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Nearest wall Distance (https://www.cfd-online.com/Forums/cfx/149297-nearest-wall-distance.html)

miz_miz March 2, 2015 03:40

Nearest wall Distance
 
Hi everyone,

i want to create a CEL using the nearest wall distance, when i use the variable wall distance and run my CFX-Pre, it stopped because wall distance is equal to zero.
if anyone has any solution so i can implement the nearest wall distance, can he just help me.

Thanks :)

ghorrocks March 2, 2015 04:48

Are you using the SST turbulence model?

From your other threads (http://www.cfd-online.com/Forums/cfx...cell-wall.html) it appears you want this distance so you can get the gradient of the concentration field at the wall. Is this correct? If so, then why not just get the gradient of the concentration field directly using the built in functions?

miz_miz March 2, 2015 05:01

Yes i'm using the SST turbulence model

no my approximation needs the nearest wall distance

ghorrocks March 2, 2015 05:24

The wall distance variable is calculated at the start of the fist iteration and, if transient at the start of all subsequent time steps where the mesh has moved. So it will not exist for the initial condition but should exist from then on (providing the SST or related turbulence model is used as it invokes the wall distance calculation).

Also I am not sure whether wall distance exists on the boundaries or in the volume nodes. I just had a quick look in the VARIABLES files and it seems to suggest it is a volume variable. If this is the case this makes it difficult as mapping boundary nodes to nearest volume nodes would be tricky to do.

Your other post says that you are trying to implement
J = (D/deltaY)*(Ci-Cwall)

Where I presume deltaY is the wall distance and Ci-Cwall is the difference between the interior and wall concentrations. If this is the case, then isn't (Ci-Cwall)/deltaY the wall normal gradient of concentration, so you can rewrite your equation as

J = D/WNG

Where WNG is the wall normal gradient of concentration? Then you do not need the wall distance at all.

miz_miz March 2, 2015 05:31

thank you i'll try to implement the normal gradient of concentration and if i have question i'll ask you ;)

miz_miz March 2, 2015 05:43

when i use Conservative Volume Fraction.Gradient i get an error message which say :

Non-scalar variable 'oxygen.Conservative Volume Fraction.Gradient' referenced in parameter 'Flux' in object '/FLOW:Flow Analysis 1/DOMAIN:Default Domain/BOUNDARY:WallSource/BOUNDARY SOURCE/FLUID:oxygen/SOURCES/EQUATION SOURCE:continuity'.
Non-scalars are only allowed as arguments to integrated quantity functions.

ghorrocks March 2, 2015 06:00

Hang on there - you are using the volume fraction gradient to work out a concentration gradient! A volume fraction is not a concentration, do not get them confused.

You can specify which direction you want the gradient with gradient x/y/z.

miz_miz March 2, 2015 06:07

I asked Ansys help and they told me to have the concentration at each cell near the wall i should use the conservative volume fraction.

miz_miz March 2, 2015 06:24

what if the geometry is the elbow which gradient i choose X/Y or Z ??

ghorrocks March 2, 2015 06:45

A multiphase flow is one which contains multiple phases. So oxygen bubbles in water is an example. And you model volume fractions and the phases move around with an interface drag model (so drag on the oxygen bubbles moves them about).

A multicomponent flow is one which contains a single fluid phase, but it is made up of multiple components. Examples include air (which is nitrogen gas, oxygen gas and small amounts of other gases) or oxygen dissolved in water (totally dissolved in the liquid that is, NOT as bubbles). Everything is in one phase. But the concentrations are measured as mass fractions and the mass fractions can move around with convection and diffusivity.

So if the oxygen exists in bubbles then you have a multiphase flow. If the oxygen is dissolved in water then you have a multicomponent flow. If the oxygen is both bubbles and dissolved in water then you have both a multiphase and a multicomponent flow and things get complex.

You need to get the basic model right before you do anything. Is your flow multiphase, multicomponent or both?

Opaque March 2, 2015 08:39

Just to add to Glenn's suggestions. The normal gradient at the boundary is by definition, grad(phi).normal. Using CEL, you can write it at

MyGraddotN = MyPhi.Gradient X * Normal X + MyPhi.Gradient Y * Normal Y + MyPhi.Gradient Z * Normal Z

Such expression is valid for any boundary orientation.

On the concentration variable. For multicomponent flow, CEL provides 3 variables for a given material component (or specie). For example, O2.Mass Fraction, O2.Mass Concentration, O2.Molar Concentration.

But as Glenn's said, you should first clear what your are trying achieve (in my view your mathematical model), how to achieve it using CFX, a cclear understanding of what each variable means and their context, and then how to implement with the available tools.

Best of luck,

miz_miz March 2, 2015 10:10

as i said, i have in my inlet water and bubbles of oxygen.
and i'm trying to add a source term at each cell which depends on the concentration at each cell and the near wall distance.
i contacted the ANSYS-support and they told me to use the conservative volume fraction for my concentration at each cell.
the question is to use the gradient of the conservative volume fraction or to use the distance near wall, but to have the distance near wall it depend on my SST modèle and i don't know how i can get that.
So i tried the gradient method as told me Glenn, the only thing is my normal is radial so how can i get the gradient depending on this normal (because i'm modeling an elbow)

Opaque March 2, 2015 11:08

Not to be controversial, but you have not addressed Glenn's concerns: is it a multicomponent model you have ? multiphase ? or multicomponent+multiphase ? Without that information, it is very difficult for anyone in the forum to provide you with useful tips.

In addition, the definition of how to compute the normal gradient I provided is generic. Please take a closer look and you will see that barring any limitation in the software it should give you what you need.

miz_miz March 2, 2015 11:14

it's a multiphase flow

Opaque March 2, 2015 14:04

If I understood correctly, you have setup two fluid phases in ANSYS CFX, one for water as a pure substance, and one for O2 as another pure substance.

You are now trying to include a source term due to the gradient of O2 at the boundary, correct ? To which equation will you add such source term ?

Once you decide what equation is the source term for, do you know the other state conditions for the source ? For example, velocity, turbulence, temperature , etc.

For the sake of checking the source term would be applied correctly and that your setup is already in a good state, you can just make the source term a constant value and see if the solution makes any sense. Once you are in control of the model, you can make the source strength a function of the gradient or whatever else is meaningful to you.

miz_miz March 2, 2015 14:07

i add a source term the continuity
when i add a constant it works and it's correct ! my real problem is to put a function of the gradient


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