CINXE.COM
Integrating Along Streamlines and Extracting Particle Statistics
<!DOCTYPE html> <html lang="de"> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta charset="utf-8"> <meta name="google-site-verification" content="z5hDfT_E7CX17oo2FoMdd5iDrIa5uO2zGiCVzApxl3w" /> <meta name='yandex-verification' content='6172511f3cfa98fc' /> <script type="text/javascript" src="/js/cm-onetrust.js""></script> <!-- OneTrust Cookies Consent Notice start --> <script nonce="FJCWEv1qYfJwjoVU4jtifA==" type="text/javascript" src="https://cdn.cookielaw.org/consent/68ae42f9-4d03-4a87-b882-6e06e2619017/OtAutoBlock.js" ></script> <script nonce="FJCWEv1qYfJwjoVU4jtifA==" src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" data-document-language="true" type="text/javascript" charset="UTF-8" data-domain-script="68ae42f9-4d03-4a87-b882-6e06e2619017" ></script> <script type="text/javascript" nonce="FJCWEv1qYfJwjoVU4jtifA=="> function OptanonWrapper() { } </script> <!-- OneTrust Cookies Consent Notice end --> <script type="text/plain" class='optanon-category-C0001' src="/js/onetrust/cat1.js"></script> <script type="text/plain" class='optanon-category-C0002' src="/js/onetrust/cat2.js"></script> <script type="text/plain" class='optanon-category-C0003' src="/js/onetrust/cat3.js"></script> <script type="text/plain" class='optanon-category-C0004' src="/js/onetrust/cat4.js"></script> <title>Integrating Along Streamlines and Extracting Particle Statistics</title> <meta name="description" content="Learn how to integrate along streamlines and extract particle statistics when simulating fluid flow in COMSOL&nbsp;Multiphysics&reg; (incl. step-by-step screenshots.)"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="alternate" href="https://cn.comsol.com/support/learning-center/article/21351" hreflang="zh" /> <link rel="alternate" href="https://www.comsol.com/support/learning-center/article/21351" hreflang="en" /> <link rel="alternate" href="https://www.comsol.de/support/learning-center/article/21351" hreflang="de" /> <link rel="alternate" href="https://www.comsol.fr/support/learning-center/article/21351" hreflang="fr-FR" /> <link rel="alternate" href="https://www.comsol.it/support/learning-center/article/21351" hreflang="it" /> <link rel="alternate" href="https://www.comsol.jp/support/learning-center/article/21351" hreflang="ja" /> <link rel="alternate" href="https://www.comsol.ru/support/learning-center/article/21351" hreflang="ru" /> <script nonce="FJCWEv1qYfJwjoVU4jtifA=="> var consoleOverride = window.console; window.console.log = function() { return }; window.innerOnError = function(msg, url, lineNo, columnNo, error) { var message = { message: msg, scriptUrl: url, line: lineNo, column: columnNo, error: error, documentUrl: window.location.href, }; var msgString = JSON.stringify(message); httpRequest = new XMLHttpRequest(); if (!httpRequest) { return false; } httpRequest.open('POST', '/js/onerror'); httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); httpRequest.send('msg=' + encodeURIComponent(msgString)); }; window.onerror = function(msg, url, lineNo, columnNo, error) { try { var string = msg.toLowerCase(); var substring = "script error"; //dont log script errors console.log(string.indexOf(substring)); if (string.indexOf(substring) == -1){ window.innerOnError(msg, url, lineNo, columnNo, error); } } catch(error) { //do nothing for now } return false; }; </script> <script nonce='FJCWEv1qYfJwjoVU4jtifA=='>window.cmCssVersion = 'bootstrap3';</script> <link href="/images/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon"> <link href="/css/bootstrap3-external-10067177315.css" media="all" rel="stylesheet" type="text/css"> <link href="/css/prism/prism.css,/css/jquery-ui/css/ui-lightness/jquery-ui-1.10.3.custom.css,/css/navigation.css,/css/navigation-bs3-10067177315.css" media="screen" rel="stylesheet" type="text/css"> <link href="/css/print-10067177315.css" media="print" rel="stylesheet" type="text/css"><script type="text/javascript" src="/js/jquery.min.js,/js/support/learning-center-article.js,/js/cm-sticky-sidebar.js,/js/prism/prism.js,/js/bootstrap3/bootstrap.min.js,/js/bootstrap-modal.js,/js/jquery-cookie/cookie.js,/js/jquery-ui/js/jquery-ui.js,/js/topnav.js,/js/general.js,/js/jquery.lazyload.js,/js/newsfeed.js,/js/modernizr/webp-26986901287.js"></script> <!--[if lt IE 9]><script type="text/javascript" src="/js/html5-26986901287.js"></script><![endif]--> <script type="text/javascript" src="//use.typekit.net/zhi5ori.js"></script><script type="text/javascript" nonce="FJCWEv1qYfJwjoVU4jtifA==">try{Typekit.load();}catch(e){}</script> <script nonce="FJCWEv1qYfJwjoVU4jtifA==">var jsTrans = {"read-more":"Mehr lesen","read-less":"Weniger lesen","next-btn":"N\u00e4chste","prev-btn":"Zur\u00fcck","close-btn":"Schlie\u00dfen"};</script> <script script type='text/plain' class='cm-category-C0002' nonce="FJCWEv1qYfJwjoVU4jtifA=="> var isComsolVisitor = document.cookie.match('isComsolVisitor=true'); var _gaq = {push: function() {}}; if (!isComsolVisitor) { var _gaq = { push: function (p) { try {console.log('faux gaq: ', p);} catch (e) {} } } var ga = function () {}; //stop contact page from sending info to GA } else { (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g; let n=s.querySelector('[nonce]');n&&a.setAttribute('nonce',n.nonce||n.getAttribute('nonce')); m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-828192-6', 'auto'); ga('require', 'displayfeatures'); ga('send', 'pageview'); } </script> <!-- Global site tag (gtag.js) - Google Analytics --> <script type="text/plain" class="optanon-category-C0002" nonce="FJCWEv1qYfJwjoVU4jtifA==" async src="https://www.googletagmanager.com/gtag/js?id=G-CGKNW1TWF3"></script> <script type="text/plain" class="cm-category-C0002" nonce="FJCWEv1qYfJwjoVU4jtifA=="> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-CGKNW1TWF3'); const event = new Event("ga4_loaded"); window.dispatchEvent(event); </script><script type="text/plain" nonce="FJCWEv1qYfJwjoVU4jtifA==" class="optanon-category-C0004"> !function(w, d) { if (!w.rdt) { var p = w.rdt = function() { p.sendEvent ? p.sendEvent.apply(p, arguments) : p.callQueue.push(arguments); }; p.callQueue = []; var t = d.createElement("script"); t.src = "https://www.redditstatic.com/ads/pixel.js"; t.async = true; var s = d.getElementsByTagName("script")[0]; s.parentNode.insertBefore(t, s); } }(window, document); rdt('init', 'a2_g8leh335h9kp'); rdt('track', 'PageVisit'); </script> <!-- End Reddit Pixel --><script type="text/plain" nonce="FJCWEv1qYfJwjoVU4jtifA==" class="optanon-category-C0004"> var _paq = window._paq = window._paq || []; _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="https://analytics.comsol.com/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', '4']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); })(); window.matomoEvent = function (params) { //params = ['trackEvent', 'event category', 'event action', 'event name', 'event value'] _paq.push(params); } </script> <meta property="twitter:card" content="summary_large_image" /> <meta property="twitter:site" content="@COMSOL_Inc" /> <meta property="og:title" content="Integrating Along Streamlines and Extracting Particle Statistics" /> <meta property="og:card" content="summary" /> <meta property="og:type" content="summary_large_image" /> <meta property="og:url" content="https://www.comsol.de/support/learning-center/article/21351" /> <meta property="og:description" content="Learn how to integrate along streamlines and extract particle statistics when simulating fluid flow in COMSOL Multiphysics® (incl. step-by-step screenshots.)" /> <meta property="og:site_name" content="COMSOL" /> <meta property="og:image" content="https://cdn.comsol.com/su/4/0/7/6/1/residence-time-social-share.png" /> <script type="application/ld+json" nonce="FJCWEv1qYfJwjoVU4jtifA=="> { "@context": "http://schema.org", "@type": "WebSite", "url": "http://www.comsol.de", "potentialAction": { "@type": "SearchAction", "target": "http://www.comsol.de/search/?s={search_term_string}", "query-input": "required name=search_term_string" } } </script> </head> <body class="site-de "> <!--googleoff: index--> <div class="nav-toolbar"> <a class="topnav-brand active" href="/"><img class="img-responsive center-block conf-comsol-logo logo-mTop" src="https://cdn.comsol.com/company/logo/comsol-logo-130x20.png" alt="COMSOL"></a> <!-- toggele search bar --> <div class="pull-right float-end nav-toolbar-links" style="display: none" data-cm-search-bar="search"> <div class="topnav-searchbar"> <form class="" role="search" action="/search/"> <input type="text" class="hidden-search-input" data-cm-hidden-search data-hj-whitelist gaq-name="topNavDesktop" value="" name="s" placeholder="Search"><button class="search-submit" type="submit"><i class="fa fa-search"></i></button><span class="search-close" data-cm-search-toggle><i class="fa fa-times fa" aria-hidden="true"></i></span> </form> </div> </div> <!-- toolbar --> <ul class="pull-right float-end nav-toolbar-links" data-cm-search-bar="nav"> <li class="tn-link" ><a href="/contact">Kontakt</a></li> <li class="tn-link location-select"> <div> <div class="location-btn" data-cm-lang-toggle> Deutsch<span> <i class="fa fa-map-marker fa-solid fa-location-dot"></i></span> </div> <ul style="display: none;" data-cm-lang-list> <li> <a tabindex="-1" href="http://www.comsol.de/support/learning-center/article/21351?setlang=1" >Deutsch</a> </li> <li> <a tabindex="-1" href="http://www.comsol.com/support/learning-center/article/21351?setlang=1" >English</a> </li> <li> <a tabindex="-1" href="http://www.comsol.fr/support/learning-center/article/21351?setlang=1" >Français</a> </li> <li> <a tabindex="-1" href="http://www.comsol.it/support/learning-center/article/21351?setlang=1" >Italiano</a> </li> <li> <a tabindex="-1" href="http://www.comsol.jp/support/learning-center/article/21351?setlang=1" >日本語</a> </li> <li> <a tabindex="-1" href="http://cn.comsol.com/support/learning-center/article/21351?setlang=1" >中文</a> </li> </ul> </div> </li><li class="tn-link tn-login-username" data-cm-logged-in style="display:none"> <em><a href="/access/" data-cm-access-full-name data-hj-suppress></a></em><span class="footerDivider">|</span> </li><li class="tn-link tn-logout-btn" data-cm-logged-in style="display:none"> <a href="/access/logout/">Abmelden</a> </li><li class="tn-link" data-cm-logged-out> <a href="/access/login">Anmelden</a> </li><li class="tn-link topnav-search" data-cm-search-toggle><i class="fa fa-search" for="focus-input" aria-hidden="true" ></i></li> </ul> </div><!-- nav-toolbar--> <!-- navbar --> <div class="nav-primary-links"> <ul class="pull-right float-end bottom-nav-links"> <li class="bn-link"><a href="/products" class="nav-link" >Produkte</a></li> <li class="bn-link"><a href="/videos" class="nav-link">Videos</a></li> <li class="bn-link"><a href="/events" class="nav-link">Events</a></li> <li class="bn-link"><a href="/blogs" class="nav-link">Blog</a></li> <li class="bn-link"><a href="/support/learning-center" class="nav-link">Learning Center</a></li> <li class="bn-link"><a href="/support" class="nav-link">Support</a></li> </ul> </div><!-- nav-prim --> <!-- mobile --> <div class="top-tool mobile-nav-toolbar"> <!-- toggle search --> <div class="topnav-searchbar pull-right float-end" style="display: none" data-cm-search-bar="search"> <form class="" role="search" action="/search/"> <input type="search" gaq-name="topNavDesktop" value="" name="s" placeholder="Search"><button class="search-submit" type="submit" ><i class="fa fa-search"></i></button><span class="search-close" data-cm-search-toggle><i class="fa fa-times" aria-hidden="true"></i></span> </form> </div> <div class="mobile-top" data-cm-search-bar="nav"> <a class="topnav-brand active" href="/"><img class="img-responsive center-block conf-comsol-logo" src="https://cdn.comsol.com/company/logo/comsol-logo-130x20.png" alt="COMSOL"></a> <!-- menu and drop down --> <div class="menu-btn pull-right float-end" data-cm-menu-toggle> Menu </div> <div class="mobile-nav-primary-links" style="display: none;" data-cm-menu-list> <ul class="mobile-bottom-nav-links"> <li><a href="/products" class="nav-link">Produkte</a></li> <li><a href="/videos" class="nav-link">Videos</a></li> <li><a href="/events" class="nav-link">Events</a></li> <li><a href="/blogs" class="nav-link">Blog</a></li> <li><a href="/support/learning-center" class="nav-link">Learning Center</a></li> <li><a href="/support" class="nav-link">Support</a></li> </ul> </div> <!-- --> <!-- search --> <div class="tn-link topnav-search pull-right float-end" data-cm-search-toggle><i class="fa fa-search" aria-hidden="true"></i></div> </div> </div><!-- mobile --> <div class="bottom-tool mobile-nav-toolbar"> <ul class="pull-right float-end nav-toolbar-links"> <li class="tn-link tn-login-username" data-cm-logged-in style="display:none"> <em><a href="/access/" data-cm-access-full-name data-hj-suppress></a></em><span class="footerDivider">|</span> </li><li class="tn-link tn-logout-btn" data-cm-logged-in style="display:none"> <a href="/access/logout/">Abmelden</a> </li> <li class="tn-link" data-cm-logged-out> <a href="/access/login">Anmelden</a> </li> <li class="bn-link" ><a href="/contact" class="nav-link">Kontakt</a></li> <li class="bn-link"> <div class="location-select"> <div class="location-btn mobile-btn-location" data-cm-lang-toggle> <span><i class="fa fa-map-marker fa-solid fa-location-dot"></i></span> </div> <ul style="display: none;" data-cm-lang-list><!-- continents --> <!-- --> <li> <a tabindex="-1" href="http://www.comsol.de/support/learning-center/article/21351?setlang=1" >Deutsch</a> </li> <li> <a tabindex="-1" href="http://www.comsol.com/support/learning-center/article/21351?setlang=1" >English</a> </li> <li> <a tabindex="-1" href="http://www.comsol.fr/support/learning-center/article/21351?setlang=1" >Français</a> </li> <li> <a tabindex="-1" href="http://www.comsol.it/support/learning-center/article/21351?setlang=1" >Italiano</a> </li> <li> <a tabindex="-1" href="http://www.comsol.jp/support/learning-center/article/21351?setlang=1" >日本語</a> </li> <li> <a tabindex="-1" href="http://cn.comsol.com/support/learning-center/article/21351?setlang=1" >中文</a> </li> </ul> </div> </li> </ul> </div> <!--</nav> --> <!--googleon: index--> <div class="content"> <div class="contentWindow"> <script type="text/javascript" nonce="FJCWEv1qYfJwjoVU4jtifA=="> window._wq = window._wq || []; _wq.push({ id: "_all", onReady: function(video) { var div = $('<div class="wistia-play-head">'); var text = "Click to play animation"; if (typeof jsTrans["click-to-play"] != "undefined") { text = jsTrans["click-to-play"]; } div.append($('<span>' + text + ' ▶</span>')); $('[data-cm-playbutton]').find(video.container).append(div).addClass('wistia-animation-wrapper'); div.click(function() { video.play(); }); video.bind('play', function() { div.hide(); }); video.bind('pause', function() { div.show(); }); }}); </script> <!-- Article template --> <div class="slc"> <div class="container"> <div class="spacer"></div> <!-- Page header --> <header class="header__default article__header"> <div class="header__top"> <h1>Learning Center</h1> </div> <div class="header__bottom header__bottom--padding"> </div> <div class="lc-back"> <i class="fa fa-angle-left"></i> <a href="/support/learning-center">BACK TO LEARNING CENTER</a> </div> </header> <!--/ Page header --> <div class="spacer"></div> <!-- <div class="article-body"> --> <style> .content { overflow-x: hidden; } </style> <div class="row"> <div class="col-sm-12"> <div class="lc-article"> <div class="lc-article__content line-numbers" data-cm-sticky-top data-cm-content> <h2>Integrating Along Streamlines and Extracting Particle Statistics</h2> <hr> <p>Given a computed steady-state flow field, it is often desirable to compute quantities such as the residence time distribution function of the fluid within the domain, as well as other statistical data related to the distribution of times that it takes the fluid to pass through the domain. This article addresses such situations.</p> <h3>Modeling Notes</h3> <p>This example is presented in the context of a steady-state laminar flow field, representing the flow through a small device, as visualized in the image below. A fluid inlet is defined on one side of the domain, with a parabolic velocity profile, and a uniform pressure outlet defined on the other side. The <em>Laminar Flow</em> interface is used, and the model is solved as a stationary problem.</p> <p><img src="https://cdn.comsol.com/su/1/8/4/3/1/steady-state-laminar-flow.png" alt="Simulation results showing steady-state laminar flow field through a small device, visualized in a rainbow color table with black arrows." /><br /> <em>The computed steady-state laminar flow field through a device.</em></p> <p>Beginning with a model that has a steady-state flow solution, add a <em>Particle Tracing for Fluid Flow</em> interface. Within the settings, specify to use a <em>Massless</em> formulation for the particles, and specify to store the particle status data. Within the <em>Particle Properties</em>, specify the particle velocity to be the flow field components, <code>u,v</code>, which is equivalent to defining a computational particle that traces streamlines.</p> <p><img src="https://cdn.comsol.com/su/1/8/3/5/1/particle-tracing-fluid-flow-settings.png" alt="A screenshot of the Settings window for the Particle Tracing for Fluid Flow interface, with the Particle Release and Propagation and Additional Variables sections expanded." /><br /> <em>Settings for the</em> Particle Tracing for Fluid Flow <em>interface. Massless formulation is used. Particle status data is stored.</em></p> <p><img src="https://cdn.comsol.com/su/1/8/3/4/1/particle-properties-settings-window.png" alt="A screenshot of the settings for the Particle Properties feature, with the Particle Properties section expanded." /><br /> Particle Properties <em>settings. The particle velocity is the fluid velocity.</em></p> <p>An <em>Inlet</em> condition is defined at the same boundary as the fluid inlet, and particles are released at time zero. The distribution of particles along this boundary is set to be proportional to the fluid velocity, since there are more particles of fluid passing through the domain where the inlet velocity is higher.</p> <p><img src="https://cdn.comsol.com/su/1/8/3/6/1/inlet-boundary-condition-settings.png" alt="A screenshot of the Settings window for the Inlet boundary condition, with the Initial Position and Initial Value of Auxiliary Dependent Variables sections expanded." /> <br><em>Settings for the particle</em> Inlet <em>condition.</em></p> <p>As the computational particle moves along this streamline, an additional <em>Auxiliary Dependent Variable</em> is used to monitor the time for each particle as it moves through the domain and gets to the outlet boundary. As shown in the screenshot below, the <em>Auxiliary Dependent Variable</em> defines <code>t_particle</code>, with units of time. By integrating the source term, <code>R = 1</code>, with respect to time, this variable will track the time as the particle is traced through the domain. Once the particle reaches the outlet, this variable is frozen to the exit time. A <em>Particle Counter</em> feature is also applied at the boundary to monitor statistics of the particles as they leave the modeling domain.</p> <p><img src="https://cdn.comsol.com/su/1/8/3/3/1/auxiliary-dependent-variable-settings.png" alt="A screenshot of the Settings window for the Auxiliary Dependent Variable feature, with the Auxiliary Dependent Variable and Units sections expanded." /> <br><em>An</em> Auxiliary Dependent Variable <em>is defined on each particle.</em></p> <p>A separate study is used to compute the particle paths and uses the results from the first study. The output times specify how long to trace the particles, and how many output time steps are saved. It is not known ahead of time how long it will take for the particles to traverse the modeling domain, so the maximum time has to be studied. The intermediate output time steps, between the start and end time, only need to be saved if a visualization of the residence time is desired.</p> <p><img src="https://cdn.comsol.com/su/1/8/4/1/1/time-dependent-study-settings.png" alt="A screenshot of the Settings window for the Time Dependent study, with the Physics and Variables Selection and Values of Dependent Variables sections expanded." /> <br><em>Settings for the second study, which computes the particle paths.</em></p> <h3>Results Extraction</h3> <p>To visualize the residence time, add a <em>Particle Trajectories</em> plot and color it using the particle time variable. This plot will look more smooth as more output time steps are saved. If this plot is not desired, save only the start and end times as the output times.</p> <p><img src="https://cdn.comsol.com/su/1/8/4/2/1/laminar-flow-residence-time-variable.png" alt="Simulation results for the flow through a device, with the streamlines visualized in rainbow and colored by the residence time variable." /> <br><em>Visualization of streamlines, colored by the residence time variable.</em></p> <p>It is also possible to plot those particles that have not yet left the modeling domain. These particles follow streamlines that pass very close to a wall, where the velocity approaches zero, leading to a trapping effect. This can be reduced with mesh refinement near the walls, although this is not always desirable due to the increased computational cost for solving the fluid flow problem. In reality, there will be some diffusion as well, but this is ignored when using the massless particle tracing formulation. One approach is to filter these remaining particles out of the results, and the <em>Particle Counter</em> feature creates a logical variable, defined on each particle, <code>fpt.pcnt1.rL</code>, which is true if the particle reaches the outlet.</p> <p><img src="https://cdn.comsol.com/su/1/8/3/8/1/leftover-particles-simulation-end.png" alt="A view of the laminar flow model at the end of the simulation, visualized in gray with the remaining particles shown in red." /> <em>Visualization of those particles left within the computational domain at the end of the simulation time.</em></p> <p><br>To plot the residence time distribution function, use the <em>Histogram</em> plot type, and plot either the <em>Auxiliary Dependent Variable</em> of the particle time or the <em>Particle Status</em> stop time. Use the <em>Sum of values</em> normalization of the output. To plot the cumulative distribution, use the same kind of <em>Histogram</em> plot, with <em>Peak</em> normalization, with the <em>Cumulative</em> option enabled. Plot for the last time stored. The <em>Filter</em> subnode is added to the <em>Histogram</em> plots to filter on the <em>Particle Counter</em> logical expression.</p> <p><img src="https://cdn.comsol.com/su/1/8/3/9/1/histogram-plot-residence-time.png" alt="A screenshot of the Settings window for the Histogram plot for the residence time distribution function, with the Expression, Bins, and Output sections expanded." /> <br>Histogram <em>plot settings for residence time distribution function.</em></p> <p><br><img src="https://cdn.comsol.com/su/1/8/4/0/1/histogram-plot-cumulative.png" alt="A screenshot of the Settings window for the Histogram plot for the cumulative distribution function, with the Expression, Bins, and Output sections expanded." /> <br>Histogram <em>plot settings for cumulative distribution function.</em></p> <p><br><img src="https://cdn.comsol.com/su/1/8/3/2/1/residence-time-vs-cumulative-distribution.png" alt="Side-by-side histogram plots comparing the residence time distribution and cumulative distribution for a fluid flow model." /> <br><em>Plots of residence time distribution (left) and cumulative distribution (right).</em></p> <p><br>To compute the mean residence time, use nonlocal coupling operators via <em>Results</em> > <em>Derived Values</em> > <em>Global Evaluation</em>. The expression <code>fpt.fptop1(fpt.pcnt1.rL*t_particle)/fpt.fptop1(fpt.pcnt1.rL)</code> will average the residence time variable over all particles that have left the modeling domain. Here, <code>fpt.fptop1</code> is a predefined operator to compute a sum over all particles. The same operator can be used to compute the variance, as well as construct other metrics.</p> <p>The supplementary model file with this example is available below.</p> <div class="row article-bottom"> <div class="col-md-12"> <hr> <div style="font-size:.9em; margin:0 15px"> <em><p>Submit feedback about this page or <a href="/support">contact support here</a>.</p> </em> <div class="spacer"></div> </div> </div> </div> </div><!-- /article__content --> <div class="lc-article__sidebar" data-cm-sidebar > <div class="lc-article__sidebar-nav article-aside__container" data-cm-sticky-sidebar> <h4 class="aside__heading" data-cm-aside-heading="onThisPage" style="display:none"> On This Page:</h4> <h4 class="aside__heading" data-cm-aside-heading="files" style="display:none"> Reference Files for Download:</h4> <nav data-cm-on-this-page class="on-this-page-nav" style="display:none"> <ul data-cm-on-this-page-list class="nav-menu"> </ul> </nav> <!--/ On this page - topics --> <hr data-cm-nav-files-split style="display:none"> <!-- Downloadable files --> <div class="aside__downloads" data-cm-excercise-files> <h5 class="downloads__heading" data-cm-excercise-files-heading style="border:none">Reference Files for Download:</h5> <ul class="downloads__menu"> <li class="downloads__menu__item" title="ResidenceTime.mph" data-cm-download-file> <a href="https://cdn.comsol.com/su/1/8/3/1/1/ResidenceTime.mph"; target="_blank" rel="noopener"> <i class="fa fa-download" aria-hidden="true"></i> <div>ResidenceTime.mph<br>(27 MB)</div> </a> </li> </ul> </div> <!--/ Downloadable files --> <div class="lc-side-menu-toggle" data-cm-side-menu-toggle> <i class="fa fa-arrow-right" data-cm-side-menu-toggle-arrow></i> <i class="fa fa-arrow-left" style="display:none" data-cm-side-menu-toggle-arrow></i> </div> </div> </div><!-- /article__sidebar --> <div class="sidebar-navbar-curtain" data-cm-sticky-sidebar-curtain></div> </div><!-- /article --> </div><!-- /col --> </div><!-- /row --> <div class="doublespacer"></div> </div><!-- container --> </div> <!-- /slc --> <!--googleoff: index--> <!--googleon: index--> </div> </div> <!--googleoff: index--> <div class="footer-sitemap" role="footer"> <div class="ftr-main"> <div class="ftr-sections"> <ul> <li class=" ftr-link-header">Produktinformationen</li> <li class="ftr-link"><a href="/products" class=" nav-link " >Produkte</a></li> <!-- <li class="ftr-link"><a href="/features-benefits/" class=" nav-link " >Features and Vorteile</a></li> --> <li class="ftr-link"><a href="/products/specifications/" class=" nav-link " >Spezifikationstabelle</a></li> <li class="ftr-link"><a href="/products/licensing/" class=" nav-link " >Lizenzoptionen</a></li> <li class="ftr-link"><a href="/system-requirements/" class=" nav-link " >Systemanforderungen</a></li> <li class="ftr-link"><a href="/release-history" class=" nav-link " >Release-Historie</a></li> </ul> </div ><div class="ftr-sections"> <ul> <li class="ftr-link-header">Anwendungsbeispiele</li> <li class="ftr-link"><a href="/models/" class=" nav-link " >Modelle und Apps</a></li> <li class="ftr-link"><a href="/videos?type%5B%5D=videotype-product&type%5B%5D=videotype-modeldemo&s=" class=" nav-link " >Produkt Demo Videos</a></li> <li class="ftr-link"><a href="/stories" class=" nav-link " >User Stories</a></li> <li class="ftr-link"><a href="/papers-presentations" class=" nav-link " >Veröffentlichungen und Forschung</a></li> <li class="ftr-link"><a href="/books" class=" nav-link " >Bücher</a></li> </ul> </div ><div class="ftr-sections"> <ul> <li class="ftr-link-header">Lernen</li> <li class="ftr-link"><a href="/support/learning-center" class=" nav-link " >Learning Center</a></li> <li class="ftr-link"><a href="/events/training-courses" class=" nav-link " >Trainingskurse</a></li> <li class="ftr-link"><a href="/forum/" class=" nav-link " >Diskussionsforum</a></li> <li class="ftr-link"><a href="/community/exchange/" class=" nav-link " >Application Exchange</a></li> <li class="ftr-link"><a href="/blogs" class=" nav-link " >COMSOL Blog</a></li> <li class="ftr-link"><a href="/multiphysics" class=" nav-link " >Multiphysics Cyclopedia</a></li> </ul> </div ><div class="ftr-sections"> <ul> <li class="ftr-link-header">Events</li> <li class="ftr-link"><a href="/events/webinars" class=" nav-link " >Webinare</a></li> <li class="ftr-link"><a href="/events/comsol-days/" class=" nav-link " >COMSOL Days</a></li> <li class="ftr-link"><a href="/events" class=" nav-link " >Alle Events</a></li> <li class="ftr-link"><a href="/conference/" class=" nav-link " >COMSOL Conference</a></li> </ul> </div ><div class="ftr-sections"> <ul> <li class="ftr-link-header">Support und Service</li> <li class="ftr-link"><a href="/support" class=" nav-link " >Support Center</a></li> <li class="ftr-link"><a href="/support/cases/" class=" nav-link " >Meine Supportfälle</a></li> <li class="ftr-link"><a href="/support/knowledgebase/browse/900/" class=" nav-link " >Knowledge Base</a></li> <li class="ftr-link"><a href="/partners-consultants" class=" nav-link " >Partner und Consultants</a></li> <li class="ftr-link"><a href="/documentation/" class=" nav-link " >Dokumentation</a></li> <li class="ftr-link"><a href="/product-download/" class=" nav-link " >Produkt Download</a></li> </ul> </div ><div class="ftr-sections"> <ul> <li class="ftr-link-header">Unternehmen</li> <li class="ftr-link"><a href="/company/" class=" nav-link " >Über COMSOL</a></li> <li class="ftr-link"><a href="/company/careers/" class=" nav-link " >Karriere</a></li> <li class="ftr-link"><a href="/press-releases" class=" nav-link " >Presse</a></li> <li class="ftr-link"><a href="/contact" class=" nav-link " >Kontakt</a></li> </ul> </div> </div> <!-- <div class="ftr-social"> <div class="footerSocialIcon"><a href="http://www.linkedin.com/company/comsol-inc-" target="_blank"><img src="//cdn.comsol.com/social/In-White-14px.png"></a></div> <div class="footerSocialIcon"><a href="https://plus.google.com/115989417062257642064?prsrc=3" rel="publisher" target="_top" style="text-decoration:none;"> <img src="//ssl.gstatic.com/images/icons/gplus-16.png" alt="Google+" style="border:0;width:16px;height:16px;"/></a></div> <div class="footerSocialIcon"><a href="https://twitter.com/COMSOL_Inc" target="_blank"><img src="//cdn.comsol.com/social/Twitter_Social_Icon_Rounded_Square_White.png" width="32px"></a></div> <div class="footerSocialIcon"><a href="https://www.facebook.com/multiphysics" target="_blank"><img src="//cdn.comsol.com/social/FB-f-Logo__white_29.png"></a></div> <div class="footerSocialIcon"><a href="//www.comsol.com/blogs/" target="_blank"><i class="fa fa-rss-square fa-lg" aria-hidden="true"></i></div> </div> --> <hr class="footerhr"> <div class="ftr-legal"> <ul> <li class="footerAcess"> <div data-cm-logged-in style="display:none"> <em><a href="/access/" data-cm-access-full-name data-hj-suppress></a></em> <span class="footerDivider"> | </span> <a href="/access/logout/">Abmelden</a> </div> <div data-cm-logged-out> <a href="/access/">Anmelden</a> </div> </li> <li class="footerDivider"> | </li> <li><a href="/company/privacy/" class=" nav-link " >Datenschutzerklärung</a></li> <li class="footerDivider"> | </li> <li><a href="/trademarks/" class=" nav-link " >Warenzeichen</a></li> <li class="footerDivider"> | </li> <li> <!-- OneTrust Cookies Settings button start --> <span id="ot-sdk-btn" class="ot-sdk-show-settings"> Cookie Settings</span> <!-- OneTrust Cookies Settings button end --> </li> <li class="footerCopyright">© 2025 by COMSOL. Alle Rechte vorbehalten</li> </ul> </div> </div> <!--googleon: index--> <script type="text/plain" class="cm-category-C0004" nonce="FJCWEv1qYfJwjoVU4jtifA=="> /* <![CDATA[ */ var google_conversion_id = 1068323926; var google_custom_params = window.google_tag_params; var google_remarketing_only = true; /* ]]> */ </script> <script type="text/plain" class="optanon-category-C0004" nonce="FJCWEv1qYfJwjoVU4jtifA==" src="//www.googleadservices.com/pagead/conversion.js"> </script> <noscript> <div style="display:inline;"> <img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/1068323926/?value=0&guid=ON&script=0"/> </div> </noscript> <script type="text/plain" nonce="FJCWEv1qYfJwjoVU4jtifA==" class="optanon-category-C0004"> _linkedin_partner_id = "1950202"; window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || []; window._linkedin_data_partner_ids.push(_linkedin_partner_id); </script> <script type="text/plain" nonce="FJCWEv1qYfJwjoVU4jtifA==" class="cm-category-C0004"> (function(l) { if (!l){window.lintrk = function(a,b){window.lintrk.q.push([a,b])}; window.lintrk.q=[]} var s = document.getElementsByTagName("script")[0]; var b = document.createElement("script"); b.type = "text/javascript";b.async = true; b.nonce = "FJCWEv1qYfJwjoVU4jtifA=="; b.src = "https://snap.licdn.com/li.lms-analytics/insight.min.js"; s.parentNode.insertBefore(b, s);})(window.lintrk); </script> <noscript> <img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=1950202&fmt=gif" /> </noscript> </body> </html> <!-- generated: Sun, 19 Jan 2025 10:14:55 +0000 ++ '1737281695' ++ E ++ gentime: 0.054 -->