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.

How to calculate migration flux magnitude?

Please login with a confirmed email address before reporting spam

Hello,

I have a model in which diffusion, convection, and migration are present. To calculate total, diffusive, and convection flux magnitude I can just evaluate tds.tfluxMag_c (total), tds.cfluxMag_c (convective), and tds.dfluxMag_c (diffusive) on the boundary of interest. However, tds.mfluxMag_c does not work for migration. How can I find the migration flux magnitude given these other values?

I can find normal migration flux using tds.nmflux_c, but would like the magnitude.


1 Reply Last Post 2021年2月16日 GMT-5 08:01
Daniel Ahlman COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 2021年2月16日 GMT-5 08:01

Hi Scott,

The Transport of Diluted Species interface defines a vector variable tds.mflux_c for the flux due to migration of the species "c". In a cartesian model (1D, 2D, 3D) the vector components are: tds.mflux_cx tds.mflux_cy tds.mflux_cz

You can evaluate the magnitude of the vector by plottting: sqrt(tds.mflux_cx^2+tds.mflux_cy^2+tds.mflux_cz^2)

Unfortunatley there is no pre-defined post processing variable for the magnitude of the flux due to migration in the Transport in Diluted Species interface. We will add it for the next version.

Note however that this is the magnitude of the vector (independent of the direction). If you want the flux across a boundary, you should use the normal flux variable (tds.nmflux_c) which is defined using a dot product
tds.nmflux_c =(tds.mflux_cx, tds.mflux_cy, tds.mfluxcz) (nx, ny, nz) = tds.mfluxcx*nx+tds.mfluxcy*ny+tds.mfluxcz*nz
where (nx, ny, nz) is the boundary normal.

To look for variables (which may not be available in the postprocessing variables list) you can enable the Equation View for all nodes and search among all variables available in the following manner:

  • Click the Show More Options button in the Model Builder window (the eye icon)
  • In the pop-up window displayed, click to enable Equation View
  • Use CTRL+f to open the Find window
  • Type for example "mflux" in the input field and click the Find button
  • => A Find Results window is opened with all hits (usually located under the Graphics window)
  • The entries in the table in the Find Results window can be double-clicked. This will show the corresponding variable definition in the Setting window.
Hi Scott, The Transport of Diluted Species interface defines a vector variable tds.mflux_c for the flux due to migration of the species "c". In a cartesian model (1D, 2D, 3D) the vector components are: tds.mflux_cx tds.mflux_cy tds.mflux_cz You can evaluate the magnitude of the vector by plottting: sqrt(tds.mflux_cx^2+tds.mflux_cy^2+tds.mflux_cz^2) Unfortunatley there is no pre-defined post processing variable for the magnitude of the flux due to migration in the Transport in Diluted Species interface. We will add it for the next version. Note however that this is the magnitude of the vector (independent of the direction). If you want the flux across a boundary, you should use the normal flux variable (tds.nmflux_c) which is defined using a dot product tds.nmflux_c =(tds.mflux_cx, tds.mflux_cy, tds.mfluxcz) \cdot (nx, ny, nz) = tds.mfluxcx\*nx+tds.mfluxcy\*ny+tds.mfluxcz\*nz where (nx, ny, nz) is the boundary normal. To look for variables (which may not be available in the postprocessing variables list) you can enable the Equation View for all nodes and search among all variables available in the following manner: * Click the Show More Options button in the Model Builder window (the eye icon) * In the pop-up window displayed, click to enable Equation View * Use CTRL+f to open the Find window * Type for example "mflux" in the input field and click the Find button * => A Find Results window is opened with all hits (usually located under the Graphics window) * The entries in the table in the Find Results window can be double-clicked. This will show the corresponding variable definition in the Setting window.

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.