CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Same variable in different domains (https://www.cfd-online.com/Forums/cfx/77123-same-variable-different-domains.html)

caravell78 June 14, 2010 08:01

Same variable in different domains
 
Dear All, I have two fluid domains that are not physically connected to each other. Now, I need to define as boundary condition on both surfaces of such domains the flux of a gas species, which is a function of the molar fractions on both surfaces:

flux = a*(x@domain1 - x@domain2)

However, I didn't find in CFX manual anything related to how to refer to the same variable (molar fraction, in this case) in different subdomains.

How could I solve this problem???

ghorrocks June 14, 2010 18:44

Sounds easy, flux=a*(areaAve(mf)@interface1-areaAve(mf)@interface2) should do it.

caravell78 June 15, 2010 01:06

Same variable in different domains
 
Dear Ghorrocks, first of all, thanks a lot for your fast reply.

Then, if I 've correctly understood, the expression you provided me
calculates the average value of the molar fraction on both surfaces.
Therefore, a constant flux is evaluated along the surfaces.

However, since such surfaces are quite long, I expect a profile of molar
fractions, corresponding to a non-constant profile of flux along the
surfaces.

Can I change your expression to apply it also to my case?

ghorrocks June 15, 2010 07:04

You can't easily change it to match up node by node. You could split your region into sections and match the sections up and do averages by section, this is easy. Another possibility is to make the pair of connecting faces a periodic pair and define a mass fraction source/sink across it. You might also have to use a momentum sink to stop the flow. This is a little harder but still should be possible.

caravell78 June 15, 2010 21:51

Same variable in different domains
 
Actually, I treated the surface as a wall with a kind of "chemical reaction"
to express the loss of mass due to flux, so I don't have to worry about
the momentum sink.
About the node correspondence, I think I have to use a User Fortran
Function to match the nodes... I thought there was a simpler way, but
evidently this is not the case.
I hope future CFX versions will implement this kind of boundary
correspondence in order to avoid for the user to use customized external
functions.

Anyway, thanks again for your advices...

ghorrocks June 15, 2010 22:21

Quote:

About the node correspondence, I think I have to use a User Fortran
Function to match the nodes... I thought there was a simpler way, but
evidently this is not the case.
Yes, that's right. Try the periodic boundary approach first, you may be able to get that working. If that does not work you have to go fortran.

Quote:

I hope future CFX versions will implement this kind of boundary
correspondence in order to avoid for the user to use customized external
functions.
No chance. Your application is quite specialised so there will not be much demand for it. But put a feature request in, it will never happen unless it is requested.

caravell78 June 17, 2010 22:14

Same variable in different domains
 
Dear Ghorrocks, I read in the ANSYS manual that it's possible to couple
two solvers. Actually my system can be considered as composed of two
completely separated sub-systems, except for the boundary conditions
at the interfaces, which are coupled to each other.

Now, in your opinion, is it possible to run two different cfx solvers by
coupling the boundary conditions? I have the necessary licenses, but
I didn't find in the manual an example on how to do that?

Thanks in advance

ghorrocks June 17, 2010 23:56

The solver coupling is between a CFD and FEA solver. Not two CFD simulations - there is no point in coupling two CFD simulations, just run them as one. Do not try to couple two solvers, that is a poor way of doing it, it won't work.

Have you tried doing it with periodic boundary conditions? I have mentioned it three times now.....

caravell78 June 18, 2010 00:47

Periodic Boundary conditions
 
I'm trying just now with setting periodic BCs. However, I have a doubt.

My system is composed of two co-axial cylinders (same length), one into
the other and separated by certain distance (the external surfaces are
distant from each other).

I added a "Domain Interface" to link the two surfaces, set up their
correspondence in the GGI mode and set up "Additional Interface Model"
as "No Slip Wall".

However, no other options are available, so: how can I set the flux value
of a species at the interface?

Actually the periodicity must exist for the species compositions and flux,
but not for the absolute pressures, that are different in each side...

ghorrocks June 18, 2010 06:02

Can you explain what you are trying to do? A drawing would be nice.

caravell78 June 18, 2010 06:18

OK, sorry for my previous non-clear explanations...

My system is a tube-in-tube device, where one multicomponent
mixture flows in the annulus, whilst another multicomponent mixture flows
in the inner tube (the streams direction is not important).

The inner tube is a membrane, through which some species of the
mixtures selectively pass with different rates (selectivities) from tube
to annulus.

All the fluxes can be expressed by the following formula:

Flux(Species(i)) = a(i) * (PartialPressureInTube(Species(i)) - PartialPressureInAnnulus(Species(i))),

calculated on the corresponding surfaces.

My problem is how to express in CFX the fluxes of the species,
because I don't know how to pick the required variables from
the other side...

later I'll send an image of the system...

ghorrocks June 18, 2010 06:43

OK, I see. You may also be able to do this with a thin surface or maybe an interface where you turn momentum transfer off but allow a mass fraction flux. Lots of options.

caravell78 June 18, 2010 06:56

I understand what you said, and actually I used a Domain Interface, disabling the momentum transfer and enabling the mass flux. However,
the problem about flux unfortunately still remains...


All times are GMT -4. The time now is 09:37.