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.

Bug in diluted species?

Please login with a confirmed email address before reporting spam

Hi,
I perform a simulation in 1D and in 2D and get different results. However I also realized that I get different results for Version 43b and 5.
My problem is, that as soon as I activate the convection term in diluted species I get a maximal concentration of my species of exactly half of the outer concentration.
I starting to think this is a bug since it makes phyicaly no sens to me.
And with the 1D model of version 5 I get exactly the predicted result.

The plots for the 1D model with and without convection are attached.

I already asked about that problem in this thread and posted the models there.
www.comsol.com/community/forums/general/thread/83343

Is there anyone who can help me solving this problem?
Thank you very much!
Tobias


5 Replies Last Post 15.07.2015, 21:11 GMT-4
Daniel Ahlman COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 06.07.2015, 10:37 GMT-4
Hi Tobias,

It should to be noted that the Flux feature prescribes the total flux (diffusive and convective, when present).

* In the case of diffusion only, the prescribed, k_k*(TracerKonz-c), will "shut off" and go to zero when c approaches TracerKonz. This will occur eventually since the boundary flux is higher than the diffusive transport from the boundary into the domain.

* Including convection, and using the setup in your model (including convection into the domain and using a very small diffusion coefficient) it can be shown that the concentration on the wall will tend to be half the maximal concentration (TracerKonz).

The flux condition prescribed on the Flux boundary in this case corresponds to;

"natural boundary flux" = "convective boundary flux" + "prescribed flux"

"natural boundary flux"; results from integration by parts of the equation. In this case it is the diffusive flux; D*grad(c) dot nvec
"convective boundary flux"; a term added by the interface in order to be able to prescribe the total flux. Here it is c*u dot nvec (where the velocity vector u is prescribed as to k_k*e_z on the entire domain)
"prescribed flux" = k_k*(TracerKonz-c)

nvec = the normal vector in this case -1*e_z

=> -D*d(c)/dy = -c*k_k + k_k*(TracerKonz-c)

In the current setup the diffusion coefficient is small compared to the convection. The Peclet number k_k*h/D_k is about 100. This implies the diffusion will be small at the boundary. Assuming it is zero leads to
c = TracerKonz/2

Setting up the same problem in 1D I get the same result.



Hi Tobias, It should to be noted that the Flux feature prescribes the total flux (diffusive and convective, when present). * In the case of diffusion only, the prescribed, k_k*(TracerKonz-c), will "shut off" and go to zero when c approaches TracerKonz. This will occur eventually since the boundary flux is higher than the diffusive transport from the boundary into the domain. * Including convection, and using the setup in your model (including convection into the domain and using a very small diffusion coefficient) it can be shown that the concentration on the wall will tend to be half the maximal concentration (TracerKonz). The flux condition prescribed on the Flux boundary in this case corresponds to; "natural boundary flux" = "convective boundary flux" + "prescribed flux" "natural boundary flux"; results from integration by parts of the equation. In this case it is the diffusive flux; D*grad(c) dot nvec "convective boundary flux"; a term added by the interface in order to be able to prescribe the total flux. Here it is c*u dot nvec (where the velocity vector u is prescribed as to k_k*e_z on the entire domain) "prescribed flux" = k_k*(TracerKonz-c) nvec = the normal vector in this case -1*e_z => -D*d(c)/dy = -c*k_k + k_k*(TracerKonz-c) In the current setup the diffusion coefficient is small compared to the convection. The Peclet number k_k*h/D_k is about 100. This implies the diffusion will be small at the boundary. Assuming it is zero leads to c = TracerKonz/2 Setting up the same problem in 1D I get the same result.

Daniel Ahlman COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 06.07.2015, 10:55 GMT-4
I would recommend that you review your application of convective transport in this case. If you do have convection inside one of the domains shouldn't the velocity go to zero on the external walls?

In your earlier post you indicated that the added convection represents some kind of enhanced diffusion.
"The convection here represents a bias enhanced term of the tracer diffusion and is no a gas diffusion. It is simply using the same partial differential equation."
Could you represent this by increasing the diffusion coefficient instead?

Or should only the the flux expression be edited.

Alternatively if you want to apply an additional convective transport, but only want to prescribe the diffusive flux on the wall you can add the convective flux to the total flux expression.
I would recommend that you review your application of convective transport in this case. If you do have convection inside one of the domains shouldn't the velocity go to zero on the external walls? In your earlier post you indicated that the added convection represents some kind of enhanced diffusion. "The convection here represents a bias enhanced term of the tracer diffusion and is no a gas diffusion. It is simply using the same partial differential equation." Could you represent this by increasing the diffusion coefficient instead? Or should only the the flux expression be edited. Alternatively if you want to apply an additional convective transport, but only want to prescribe the diffusive flux on the wall you can add the convective flux to the total flux expression.

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 07.07.2015, 23:09 GMT-4
Hi Daniel,

I think I solved the problem… however I don’t anderstand it. The difference of 1D and 3D was not the dimension it was simply the position of the transport equation. Whenever the transport equation is located after the flux I get the correct simulation… also in 3D…

But there is one thin you write which I don’t anderstand.

You write that there should be another surface therm:

“"natural boundary flux" = "convective boundary flux" + "prescribed flux"

"natural boundary flux"; results from integration by parts of the equation. In this case it is the diffusive flux; D*grad(c) dot nvec
"convective boundary flux"; a term added by the interface in order to be able to prescribe the total flux. Here it is c*u dot nvec (where the velocity vector u is prescribed as to k_k*e_z on the entire domain)
"prescribed flux" = k_k*(TracerKonz-c)”

Where can I find this "convective boundary flux" term, since it is not mentioned in the equation section?

When I set the “k_k*(TracerKonz-c)” to 0. No flux is going into the material. If there would be a second term something should enter the material. I would expect the "convective boundary flux" not to be 0.

Thanks for your time!
Tobi
Hi Daniel, I think I solved the problem… however I don’t anderstand it. The difference of 1D and 3D was not the dimension it was simply the position of the transport equation. Whenever the transport equation is located after the flux I get the correct simulation… also in 3D… But there is one thin you write which I don’t anderstand. You write that there should be another surface therm: “"natural boundary flux" = "convective boundary flux" + "prescribed flux" "natural boundary flux"; results from integration by parts of the equation. In this case it is the diffusive flux; D*grad(c) dot nvec "convective boundary flux"; a term added by the interface in order to be able to prescribe the total flux. Here it is c*u dot nvec (where the velocity vector u is prescribed as to k_k*e_z on the entire domain) "prescribed flux" = k_k*(TracerKonz-c)” Where can I find this "convective boundary flux" term, since it is not mentioned in the equation section? When I set the “k_k*(TracerKonz-c)” to 0. No flux is going into the material. If there would be a second term something should enter the material. I would expect the "convective boundary flux" not to be 0. Thanks for your time! Tobi

Daniel Ahlman COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 10.07.2015, 11:48 GMT-4
Hi Tobias,

In order for the total flux to be specified, the Transport Properties node adds convective boundary flux contribution by default (using the variable cbf). You can see this addition in the Equation View of the Transport Properties node. The cbf variable is initialized as zero, which means that no flux is added.

The Flux feature re-sets the cbf variable to
c*(chds.u*chds.nrmesh+chds.v*chds.nphimesh+chds.w*chds.nzmesh)

implying that it will add a convective flux provided that the velocity is non zero on the wall in question.

Unfortunately this introduces and order dependency as well. If you add a Fluid Properties node under a FLux node, the cbf variable will be reset to zero.

Best regards
\Daniel
Hi Tobias, In order for the total flux to be specified, the Transport Properties node adds convective boundary flux contribution by default (using the variable cbf). You can see this addition in the Equation View of the Transport Properties node. The cbf variable is initialized as zero, which means that no flux is added. The Flux feature re-sets the cbf variable to c*(chds.u*chds.nrmesh+chds.v*chds.nphimesh+chds.w*chds.nzmesh) implying that it will add a convective flux provided that the velocity is non zero on the wall in question. Unfortunately this introduces and order dependency as well. If you add a Fluid Properties node under a FLux node, the cbf variable will be reset to zero. Best regards \Daniel

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 15.07.2015, 21:11 GMT-4
Hi Daniel,
Thank you very much for your explanation. Now the behavior makes sense.
Tobi
Hi Daniel, Thank you very much for your explanation. Now the behavior makes sense. Tobi

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.