CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDS problem with wall boundary condition (http://www.cfd-online.com/Forums/fluent/38589-uds-problem-wall-boundary-condition.html)

 Alex F. November 12, 2005 12:14

UDS problem with wall boundary condition

As we know, face values of quantities in FLUENT are allocated in memory only for boundary faces (e.g., wall zones).

I wrote a UDF which adds a UDS equation to the system of equations. I have a problem with WALL boundary condition.

The problem is that FLUENT does not have access to face values of WALL boundary condition (e.g., F_R, F_U) and when calling these face values ACCESS_VIOLATION occured.

I did not see this problem for other kinds of boundary condition like OUTFLOW, VELOCITY INLET.

 RoM November 13, 2005 05:02

Re: UDS problem with wall boundary condition

F_U should be zero at walls (no slip) if not statet otherwise. Other face values can be calculated from cell gradient and vector cell_center->face_center (dr0). For density: face_density=NV_DOT(C_R_G(c0,t0),dr0).

RoM

 Alex F. November 13, 2005 06:52

Re: UDS problem with wall boundary condition

Dear RoM, Thanks for your prompt response.

FLUENT should automatically return F_U=0 at WALL boundary. But when F_U is called in the UDF for WALL boundary, ACCESS_VIOLATION occured.

There is a sample for DEFINE_UDS_FLUX in UDF manual in which F_R, F_U and F_V has been used. But when these functions want to return the value of WALL boundary ACCESS_VIOLATION occured.

 KP November 13, 2005 10:03

Re: UDS problem with wall boundary condition

Is there by any chance u want to code for wall force?? KP

 Alex F. November 13, 2005 14:28

Re: UDS problem with wall boundary condition

No, I want to calculate flux through wall. I used a face loop:

begin_f_loop(f,t)

{

flux=F_R(f,t)*F_U(f,t);

}end_f_loop(f,t) }

this will cause ACCESS_VIOLATION when "f" belongs to WALL boundary. Other type of boundary such as "Inlet", "Outflow" does not cause ACCESS_VIOLATION.

 RoM November 14, 2005 02:41

Re: UDS problem with wall boundary condition

You can use the F_FLUX(f,t) macro for that purpose.

RoM

 Luca November 14, 2005 04:26

Re: UDS problem with wall boundary condition

Dear Alex, the problem is that F_ macros, works only with the segregated solver.Luca

 RoM November 14, 2005 04:30

Re: UDS problem with wall boundary condition

F_R(f,t) crashes on segeregated solver when used on walls. I tried it.

RoM

 Luca November 14, 2005 04:40

Re: UDS problem with wall boundary condition

Yes I had the same problem. In the fluent users guide, it's written clearly that F_ are only for the segregated. So if you use the coupled 2nd order you can use the gradient to build wall variables. Luca

 RoM November 14, 2005 05:11

Re: UDS problem with wall boundary condition

@Luca, Do you have some experience with calculation of face data from cell data? I had some problems with it and started a thread one week ago, but nobody had an answer. Maybe you can help. Thats what i wrote:

I have got a problem with the calculation of face vaules from cell center values. For an interior face i could caculate the face value either from the c0 cell side or the c1 cell side, using the cell values and the gradient. For a species it looks like this

from c0

and from c1

dr is the vector from cell center to the face center. Both face values should be identical but unfortunatly they are not. I tried it on a sturcured meshe with full converged soultion. Is there any other way to get consistent values for the faces?

Thanks for any suggestions

RoM

 Luca November 14, 2005 06:16

Re: UDS problem with wall boundary condition

Dear RoM, I used only c0 to build wall pressure, so I haven't tested my routine on interior faces. Sorry. I hope the difference you found is not so large beetween using c0 or c1.It should depend on the gradient. Try using node based gradient and let me know how it works. Luca

 RoM November 14, 2005 06:23

Re: UDS problem with wall boundary condition

I will give it try. Thanks for the suggestion. The manual stated one should use reconstruction gradients (RG) to build face values from cell values but i never got this to work. Everytime i try to access a RG fluent gives a nice access violation. I wonder if RG are available at all.

RoM

 Luca November 14, 2005 06:31

Re: UDS problem with wall boundary condition

I found out that sometimes instead of using reconstructed gradient, you should use the default one. It depends on the solver you're using (segregated or coupled).Luca

 RoM November 14, 2005 06:39

Re: UDS problem with wall boundary condition

I only use the segragated solver so i think i am stuck with the default gradients.

Thanks, RoM

 User89 August 6, 2014 05:08