CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDS Flux Boundary Condition (http://www.cfd-online.com/Forums/fluent/117826-uds-flux-boundary-condition.html)

 shashank312 May 15, 2013 21:25

UDS Flux Boundary Condition

The gradient of the UDS is zero at the boundary. How to implement this using DEFINE_PROFILE? Would C_UDSI_G work?

Do I misunderstand your question or did you overlook the menu items? You can set the boundary condition for UDS from the b.c. menu.

 shashank312 May 15, 2013 21:34

I overlooked the menu. I can specify the flux on the GUI. My bad.

 shashank312 May 15, 2013 21:39

On a different note, can I do the following?

Set C_UDSI_M1(c,t,0) = C_UDMI(c,t,0);
where C_UDMI(c,t,0) is a product of some constants, temperature and volume fraction gradient.

Solve for C_UDSI(c,t,0) using the DEFINE_UDS_UNSTEADY and DEFINE_DIFFUSIVITY.

Then do this: C_UDMI(c,t,1) = C_UDSI(c,t,0)*C_T(c,t);

Is yes, please let me know how.

I am not quite sure what you want to do.
Could not you solve the equation for (temperature X volume fraction gradient) instead of the volume fraction gradient?
Correct me if I am wrong. When you use DEFINE_UDS_UNSTEADY, the C_UDSI_M1 is not used. Why do you have to assign a value to it?

 shashank312 May 15, 2013 22:33

Okay, this is what I want to do. Maybe a diverted a little bit.

I find the interfacial mass source term (interfacial means where the vof of one of the phase is neither 1, nor zero and the vof gradient is not zero) and then I store that term in UDMI(c,t,0).

I need to solve the unsteady diffusion equation for the above mass source term, so that I get a "diffused" or "smeared" mass source term which I can store in a new location and use to specify my energy source term.

Then I do not find any problem in your last post.

 shashank312 May 15, 2013 22:51

Okay. Do you know how to implement it though on FLUENT in correct order, with the correct usage of macros?

 Maryam-A September 21, 2015 09:35

Hi every body.
I wanted to return gradient of UDS ( scalar is volume fraction of nanoparticle in my case) as boundary value.
by simplifying transport equation , my boundary condition on the wall is:

d(phi)/dx=-(DT/DB)*(dT/dx)

that UDS(c,t,0) is phi. As you see I wanted to return derivative not value of phi.

I'm beginner at UDF .
Could you please give me some advise.If following function is true to use why didn't work properly? It has problem by initializing!
I face with "fatal signal" while initializing.

{
cell_t c;
face_t f;
...
...
{
C_UDSI_G(c,t,0)[0]=-(D_T/D_B)*C_T_G(c,t)[0];

}
end_f_loop(f,t)
}

 Bruno Machado September 21, 2015 09:42

Maryam-A, you asked the same question in 5 different topics. Do not expect people to help you with this kind of behavior.

 Maryam-A September 21, 2015 12:27

I am so sorry.
That's all because of not knowing how to ask good question.
I'm beginner at UDF and having many problem in different tasks, but I think my explanation wasn't enough to ask in a good way :(
All following options are my problems and dont know how to ask well.

1-creating Gradient of UDSI for calculating Laplacian of T by using DEFINE_ ADJUST
2-returning derivative of UDSI instead of value boundary of UDSI by using DEFINE_PROFILE
3-recieved" fatal signal" while initializing and even at start of run

So sorry again:(

 Bruno Machado September 22, 2015 04:31

Quote:
 Originally Posted by Maryam-A (Post 565021) I am so sorry. That's all because of not knowing how to ask good question. I'm beginner at UDF and having many problem in different tasks, but I think my explanation wasn't enough to ask in a good way :( All following options are my problems and dont know how to ask well. 1-creating Gradient of UDSI for calculating Laplacian of T by using DEFINE_ ADJUST 2-returning derivative of UDSI instead of value boundary of UDSI by using DEFINE_PROFILE 3-recieved" fatal signal" while initializing and even at start of run 4-facing with N_UDS not found by using DEFINE_ ADJUST So sorry again:(
It is ok, we will try to help you, but ask same question in many topics ends up polluting the forum.

1- You will face problems if you use gradient macros in the DEFINE_ADJUST because in the first iteration it is not calculated yet. Consider using the gradients in the DEFINE_EXECUTE_AT_END(name) macro.
2- Create a profile that returns the value you want in a variable and use it to define the value of the gradient in the boundary conditions tab in fluent. Do not use something like C_UDSI_G(c,t,0) = 1.0; for example. It might cause you problem. Be careful because boundary conditions are not defined in the cell but in the faces. So face macros must be used.
3- This is probably because you are trying to use gradients in the DEFINE_ADJUST. If they are needed for the first iteration, you can put something like C_UDMI(c,t,grad_0)=C_UDSI(c,t,0)[0] (or [1] or [2] depending of the direction of your gradient) and in the DEFINE_ADJUST you can use the UDMI. Do not forget to initialize the UDMIs.