CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Impose flow in a cell zone (https://www.cfd-online.com/Forums/fluent/168932-impose-flow-cell-zone.html)

haow March 31, 2016 08:43

Impose flow in a cell zone
 
1 Attachment(s)
Hello, everyone,

I am trying to impose a cross flow velocity within a small volume. But I am not sure how to implement. My idea is to add fixed values or source terms. Is it right?

Attachment 46383

After setting a velocity in the cell zone, how is the boundary condition then? Still inlet and outlet?

Regards,

Hao

LuckyTran April 1, 2016 01:35

I think you should separate your region into a separate cell zone. And then apply the fixed values to only that cell zone.

It should talk to the rest of the domain with interfaces and this way you can apply regular boundary conditions to the rest of the domain.

haow April 1, 2016 08:35

1 Attachment(s)
Quote:

Originally Posted by LuckyTran (Post 592776)
I think you should separate your region into a separate cell zone. And then apply the fixed values to only that cell zone.

It should talk to the rest of the domain with interfaces and this way you can apply regular boundary conditions to the rest of the domain.


Yes, I will add the velocity on a sub domain, but I dont think 'fixed values' work, because I have to consider the interaction between cross flow velocity and in line velocity.

Attachment 46414
The dashed line is the cell zone

LuckyTran April 1, 2016 09:44

Sorry but when you say impose, you mean to force. So it seems like you are not actually trying to impose the velocity but to study the interaction of two flows. Then this is an entirely different problem and not related to fixed values and subdomains at all. This is way more complicated than it needs to be.

Why can't you do the obvious and just specify the cross-flow velocity at the boundary where it enters as a velocity inlet?

haow April 1, 2016 12:42

Quote:

Originally Posted by LuckyTran (Post 592885)
Sorry but when you say impose, you mean to force. So it seems like you are not actually trying to impose the velocity but to study the interaction of two flows. Then this is an entirely different problem and not related to fixed values and subdomains at all. This is way more complicated than it needs to be.

Why can't you do the obvious and just specify the cross-flow velocity at the boundary where it enters as a velocity inlet?


Sorry for my poor english. 'impose' may be not the right word here. The continuous cross flow here represents fish school, so it could have fixed direction but variable magnitude.

LuckyTran April 1, 2016 12:47

If you want the velocity to be purely in vertical direction, then you can fix the horizontal velocity to be 0. This way the direction is fixed but the magnitude is variable.

If you want the direction to be a combination of x,y,z velocities, that's much harder to do.

But note that as soon as you add fixed values, you eliminate the interaction between streams (or severely limit them). You can't have interaction of two streams with different directions with velocity direction fixed for one stream because that would violate momentum conservation. Or even if you did, it would require/result in fictitious forces.

haow April 1, 2016 13:02

Quote:

Originally Posted by LuckyTran (Post 592926)
If you want the velocity to be purely in vertical direction, then you can fix the horizontal velocity to be 0. This way the direction is fixed but the magnitude is variable.

If you want the direction to be a combination of x,y,z velocities, that's much harder to do.

But note that as soon as you add fixed values, you eliminate the interaction between streams (or severely limit them). You can't have interaction of two streams with different directions with velocity direction fixed for one stream because that would violate momentum conservation. Or even if you did, it would require/result in fictitious forces.

Yes, Fixed value is not the right choice here because I need to solve governing equation in all the domain.

How about adding source of momentum? If I set momentum source along the cross flow?

LuckyTran April 1, 2016 13:39

Quote:

Originally Posted by haow (Post 592932)
Yes, Fixed value is not the right choice here because I need to solve governing equation in all the domain.

How about adding source of momentum? If I set momentum source along the cross flow?

Fixed values can be the appropriate choice but it depends on what I mentioned earlier about the velocity direction.

I can't answer that because it's too vague what you are trying to implement. You want to add a momentum source, but what do you want to achieve with it?

Can you please just clearly and state what you are trying to model (but be concise), the boundary conditions, and constraints you are trying to impose? It can be pseudo-code and doesn't have to be 100% mathematically.

haow April 1, 2016 13:58

Quote:

Originally Posted by LuckyTran (Post 592941)
Fixed values can be the appropriate choice but it depends on what I mentioned earlier about the velocity direction.

I can't answer that because it's too vague what you are trying to implement. You want to add a momentum source, but what do you want to achieve with it?

Can you please just clearly and state what you are trying to model (but be concise), the boundary conditions, and constraints you are trying to impose? It can be pseudo-code and doesn't have to be 100% mathematically.

It is a group of fish moving from top to bottom (in the image). The flow from left side represents current flow in the ocean.
In the small cell zone:
1. use porous media to model the blockage of fish
2. add velocity in the cell zone to model the velocity of fish group

mmj_blackforce November 24, 2017 11:16

Quote:

Originally Posted by LuckyTran (Post 592941)
Fixed values can be the appropriate choice but it depends on what I mentioned earlier about the velocity direction.

Dear Lucky Tran,

I am trying to impose a gust in vertical direction thru y-momentum source udf as defined below.But the desired Y-velocity in the source region is not coming equal to 15 as defined in the udf. I think i made a mistake somewhere? can you please help if you find time.
Thanks in advance
# include "udf.h"

DEFINE_SOURCE(V-gust,cell,thread,dS,eqn)
{
real source=0.0;
real XGS=-7.5; /* X-center of source*/
real YGS=0.0; /* Y-center of source*/
real ZGS=0.0; /* Z-center of source*/
real X= 1.0; /* X, Y, Z dimensions are such so as to make the source-Volume=1m^3*/
real Y= 1.0;
real Z= 1.0;
real t = CURRENT_TIME;

real centroid[3];
C_CENTROID(centroid,cell,thread);
real x_loc=centroid[0];
real y_loc=centroid[1];
real z_loc=centroid[2];
if (t>1.0 && t<1.5)
{
if (fabs(x_loc-XGS)<X && fabs(y_loc-YGS)<Y && fabs(z_loc-ZGS)<Z)
{
real rho=C_R(cell,thread);
source=rho*(15-C_V(cell,thread))/CURRENT_TIMESTEP; /*15(m/s) is perturbation in Y direction*/
dS[eqn]=0.0;
}
}
else
{
source=0.0;
dS[eqn]=0.0;
}
return source;
}


All times are GMT -4. The time now is 18:27.