Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

modeling diffusion of a species through a thin wall

Please login with a confirmed email address before reporting spam

Hello guys
I'm trying to model diffusion of a molecule through walls of a pipe. There is a laminar flow inside the pipe and the flow carries the mentioned molecule. This is how I built my model:

Geom1
|---- Incompressible Navier stokes (ns) ---> with independent variable: u
|---- convection and diffusion (cd1) -----> with independent variable: c1

Geom2
|---- convection and diffusion (cd2) -----> with independent variable: c2

I'm using the 2D-axial symmetry space dimension and I have the pipe as Geom1 and the surroundings as Geom2.
Obviously the boundary 1 of Geom2 overlaps the boundary 4 of Geom1.
I need to define the outward flux from Geom1 to Geom2 as: N0=mu*(c2-c1) in which mu is a constant.
Again, obviously, there is a similar boundary condition in the second geometry.
My problem is, the software doesn't recognize the variable c2 in Geom1 as well as variable c1 in Geom2.
I thought since they are overlapping on one of the boundaries I may use them as a global variable on that specific boundary. Do I need to define them as global variables?
What do you recommend?
I don't want to use identity condition like here: www.comsol.com/showroom/documentation/model/492/
Thanks,
Saman

4 Replies Last Post 2010/05/14 16:45 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010/05/12 23:29 GMT-4
You should be able to use coupling variables to connect the concentrations since they are in different geometries. Did you consider putting both domains into a single geometry? Then the concentrations would be available within each domain.

-- Steve
You should be able to use coupling variables to connect the concentrations since they are in different geometries. Did you consider putting both domains into a single geometry? Then the concentrations would be available within each domain. -- Steve

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010/05/13 7:11 GMT-4
Thanks Steve,
If I use one geometry, then I have to use permeable boundary condition between two sub-domains. I only want the diffusion equation to be solved in both sub-domain. But in one geometry there is no way to prevent flow from going into second sub-domain ( due to permeable B.C.)
I think that the only way is to have two separate geometries.
I also tried one diffusion physics for both geometries. But I don't know how to define a boundary condition based on concentrations on two sides of that wall. The flux on one of the boundaries should be: N0=mu*(c2-c1)
I'll try coupling and see how it goes.
Thanks again,
Saman
Thanks Steve, If I use one geometry, then I have to use permeable boundary condition between two sub-domains. I only want the diffusion equation to be solved in both sub-domain. But in one geometry there is no way to prevent flow from going into second sub-domain ( due to permeable B.C.) I think that the only way is to have two separate geometries. I also tried one diffusion physics for both geometries. But I don't know how to define a boundary condition based on concentrations on two sides of that wall. The flux on one of the boundaries should be: N0=mu*(c2-c1) I'll try coupling and see how it goes. Thanks again, Saman

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010/05/13 9:19 GMT-4

You should be able to use coupling variables to connect the concentrations since they are in different geometries.


Thanks again Steve. Coupling the variables worked. But it increases the solution time dramatically, which I think is the drawback of coupling since they are not intended to be used anywhere other than post-processing. But I can't complain.
I'm only wondering whether there is any easier solution for this problem.

Saman
[QUOTE] You should be able to use coupling variables to connect the concentrations since they are in different geometries. [/QUOTE] Thanks again Steve. Coupling the variables worked. But it increases the solution time dramatically, which I think is the drawback of coupling since they are not intended to be used anywhere other than post-processing. But I can't complain. I'm only wondering whether there is any easier solution for this problem. Saman

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010/05/14 16:45 GMT-4
You should be able to set up two domains in the same geometry, and use a separate physics application for each, giving you two separate concentration variables. Then you can set a flux boundary condition on each domain, and set it to the difference equation using the concentrations from the two domains (since you set up two physics, you will have two different concentration variables). You may have to adjust the sign of the equation to indicate that one boundary has a flux leaving, and the other has the flux entering.

I've done something similar in the past, but don't think I still have the model around.

Steve
You should be able to set up two domains in the same geometry, and use a separate physics application for each, giving you two separate concentration variables. Then you can set a flux boundary condition on each domain, and set it to the difference equation using the concentrations from the two domains (since you set up two physics, you will have two different concentration variables). You may have to adjust the sign of the equation to indicate that one boundary has a flux leaving, and the other has the flux entering. I've done something similar in the past, but don't think I still have the model around. Steve

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.