CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   User Scalar B/C (http://www.cfd-online.com/Forums/fluent/28370-user-scalar-b-c.html)

Greg Perkins March 27, 2001 21:46

User Scalar B/C
 
Does anyone know you to set a boundary condition for a user defined scalar, thi, as:

d/dn(thi) = 0

ie gradient of the scalar at boundary is zero.

According to the manual you can set: 1) thi = fixed value 2) flux of scalar = fixed value

For the general scalar

d/dxi(flux*thi) = S

I assume that this second option (2) is flux*thi = fixed value.

Has anyone come across this problem and worked outhouw to set d/dn(thi) = 0 at a boundary! Or used a udf to do it???

Any comments much appreciated.

Regards Greg

Ola Nordblom April 3, 2001 06:29

Re: User Scalar B/C
 
Hi Greg,

Perhaps I have misunderstood your question, what kind of boundary do you have? At a wall boundary, a zero gradient of the scalar means no diffusive transport, and a prescribed zero flux of the scalar as in your option (2) should be correct and correspond to a zero-gradient normal to the boundary. For boundaries with convective transport I have no suggestion.

Regards, Ola

Greg Perkins April 3, 2001 19:55

Re: User Scalar B/C
 
Yeah Ola,

I forgot to mention that I want to apply this boundary condition at an inlet or outlet.

In this case, I don't think that setting a zero flux of the scalar is the same as a zero gradient of the scalar at the boundary. Although, maybe I've missed something??

I should also mention I modify the flux term with a udf, so I don't use the normal flow flux for this scalar.

Thanks

Greg

Ola Nordblom April 5, 2001 12:10

Re: User Scalar B/C
 
Hi again,

If you can specify the boundary conditon so that no diffusive transport is included, then the b.c. should correspond to a zero gradient of the scalar. This should be true not only at walls, but at inlets and outlets as well. As usual, the manual doesn't describe exactly how diffusion is treated across different types of boundaries. At a velocity inlet, I think that you always get some diffusion when the boundary value of the scalar is given. To prevent diffusion you have to specify the transport as a flux instead and include only the convective part, i.e. rho*U*A*phi (in a UDF).

Regards,

Ola


Greg Perkins April 5, 2001 21:16

Re: User Scalar B/C
 
Thanks Ola,

I've had a bit more of a play and I appear to have got what I wanted to work - although just the first part.

In my case I was using a UDF to calculate the convective flux - and not using the internal F_FLUX used by fluent - since I want to solve for another simple flow model. It turned out that I had the fluxes around the wrong way when applying a upwind scheme to determine face variables. These things are a bit hit and miss, since Fluent have provided no documentation on how to calculate these face fluxes and their direction conventions. For example the UDS_FLUX returns one face flux, but this must be positive for one cell and negative for the adjacent cell. But there's no explanation of how a positive/negative flux is interpreted by Fluent if you understand what I mean. So I had to resort to trial and error.

In addition I also found that Fluent Inc tech support sent me an incorrect definition earlier which took a while to figure out.

When these changes, it appears to work and I can get a zero gradient at the inlet/outlet boundary.

In this case I set the diffusion co-efficient to zero.

Greg


Greg Perkins April 5, 2001 23:29

Re: User Scalar B/C
 
Thanks Ola,

I've had a bit more of a play and I appear to have got what I wanted to work - although just the first part.

In my case I was using a UDF to calculate the convective flux - and not using the internal F_FLUX used by fluent - since I want to solve for another simple flow model. It turned out that I had the fluxes around the wrong way when applying a upwind scheme to determine face variables. These things are a bit hit and miss, since Fluent have provided no documentation on how to calculate these face fluxes and their direction conventions. For example the UDS_FLUX returns one face flux, but this must be positive for one cell and negative for the adjacent cell. But there's no explanation of how a positive/negative flux is interpreted by Fluent if you understand what I mean. So I had to resort to trial and error.

In addition I also found that Fluent Inc tech support sent me an incorrect definition earlier which took a while to figure out.

When these changes, it appears to work and I can get a zero gradient at the inlet/outlet boundary.

In this case I set the diffusion co-efficient to zero.

Greg



All times are GMT -4. The time now is 16:23.