<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://dwsim.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Overriding_Calculated_Properties</id>
	<title>Overriding Calculated Properties - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://dwsim.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Overriding_Calculated_Properties"/>
	<link rel="alternate" type="text/html" href="https://dwsim.org/wiki/index.php?title=Overriding_Calculated_Properties&amp;action=history"/>
	<updated>2026-04-18T13:00:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://dwsim.org/wiki/index.php?title=Overriding_Calculated_Properties&amp;diff=129&amp;oldid=prev</id>
		<title>DanWBR at 21:19, 26 June 2019</title>
		<link rel="alternate" type="text/html" href="https://dwsim.org/wiki/index.php?title=Overriding_Calculated_Properties&amp;diff=129&amp;oldid=prev"/>
		<updated>2019-06-26T21:19:35Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 21:19, 26 June 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l79&quot; &gt;Line 79:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 79:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;[[File:Propovrr4.jpg]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;[[File:Propovrr4.jpg]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Run the simulation again and store the results. You can view the effect of the updated viscosity on the pipe pressure profile:&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Run the simulation again and store the results. You can view the effect of the updated viscosity on the pipe pressure profile:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>DanWBR</name></author>
		
	</entry>
	<entry>
		<id>https://dwsim.org/wiki/index.php?title=Overriding_Calculated_Properties&amp;diff=128&amp;oldid=prev</id>
		<title>DanWBR at 21:18, 26 June 2019</title>
		<link rel="alternate" type="text/html" href="https://dwsim.org/wiki/index.php?title=Overriding_Calculated_Properties&amp;diff=128&amp;oldid=prev"/>
		<updated>2019-06-26T21:18:54Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 21:18, 26 June 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l9&quot; &gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/table&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/table&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br/&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;h2&amp;gt;&amp;lt;span class=&amp;quot;mw-headline&amp;quot; id=&amp;quot;Introduction&amp;quot;&amp;gt;Introduction&amp;lt;/span&amp;gt;&amp;lt;/h2&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;h2&amp;gt;&amp;lt;span class=&amp;quot;mw-headline&amp;quot; id=&amp;quot;Introduction&amp;quot;&amp;gt;Introduction&amp;lt;/span&amp;gt;&amp;lt;/h2&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;Starting from DWSIM Version 5.1, you can override the calculated phase properties through Python scripts. This can be useful if the calculated property is far from the expected value, or if you need to include advanced mixing rules when calculating mixed phase properties.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;Starting from DWSIM Version 5.1, you can override the calculated phase properties through Python scripts. This can be useful if the calculated property is far from the expected value, or if you need to include advanced mixing rules when calculating mixed phase properties.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>DanWBR</name></author>
		
	</entry>
	<entry>
		<id>https://dwsim.org/wiki/index.php?title=Overriding_Calculated_Properties&amp;diff=127&amp;oldid=prev</id>
		<title>DanWBR: Created page with &quot;&lt;div id=&quot;mw-content-text&quot; lang=&quot;en&quot; dir=&quot;ltr&quot; class=&quot;mw-content-ltr&quot;&gt;&lt;table style=&quot;color: white; background-color: steelblue;&quot; cellpadding=&quot;10&quot; width=&quot;100%&quot;&gt; &lt;tr&gt; &lt;td colspan=...&quot;</title>
		<link rel="alternate" type="text/html" href="https://dwsim.org/wiki/index.php?title=Overriding_Calculated_Properties&amp;diff=127&amp;oldid=prev"/>
		<updated>2019-06-26T21:18:37Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;div id=&amp;quot;mw-content-text&amp;quot; lang=&amp;quot;en&amp;quot; dir=&amp;quot;ltr&amp;quot; class=&amp;quot;mw-content-ltr&amp;quot;&amp;gt;&amp;lt;table style=&amp;quot;color: white; background-color: steelblue;&amp;quot; cellpadding=&amp;quot;10&amp;quot; width=&amp;quot;100%&amp;quot;&amp;gt; &amp;lt;tr&amp;gt; &amp;lt;td colspan=...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;div id=&amp;quot;mw-content-text&amp;quot; lang=&amp;quot;en&amp;quot; dir=&amp;quot;ltr&amp;quot; class=&amp;quot;mw-content-ltr&amp;quot;&amp;gt;&amp;lt;table style=&amp;quot;color: white; background-color: steelblue;&amp;quot; cellpadding=&amp;quot;10&amp;quot; width=&amp;quot;100%&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td colspan=&amp;quot;1&amp;quot;&amp;gt; [[File:Dialog-warning.png|32px]] This tutorial requires intermediate Python programming skills.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;table style=&amp;quot;color: white; background-color: steelblue; margin-top: 5px&amp;quot; cellpadding=&amp;quot;10&amp;quot; width=&amp;quot;100%&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td colspan=&amp;quot;1&amp;quot;&amp;gt; [[File:Dialog-information.png|32px]] You&amp;#039;ll need at least &amp;lt;b&amp;gt;DWSIM v5.1 or newer&amp;lt;/b&amp;gt; on Windows, Linux or macOS to follow/reproduce the tasks within this tutorial.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&amp;lt;span class=&amp;quot;mw-headline&amp;quot; id=&amp;quot;Introduction&amp;quot;&amp;gt;Introduction&amp;lt;/span&amp;gt;&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Starting from DWSIM Version 5.1, you can override the calculated phase properties through Python scripts. This can be useful if the calculated property is far from the expected value, or if you need to include advanced mixing rules when calculating mixed phase properties.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&amp;lt;span class=&amp;quot;mw-headline&amp;quot; id=&amp;quot;Accessing_the_feature&amp;quot;&amp;gt;Accessing the feature&amp;lt;/span&amp;gt;&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&amp;lt;span class=&amp;quot;mw-headline&amp;quot; id=&amp;quot;Classic_UI&amp;quot;&amp;gt;Classic UI&amp;lt;/span&amp;gt;&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click on &amp;#039;Edit&amp;#039; menu item &amp;amp;gt; &amp;#039;Simulation Settings&amp;#039; &amp;amp;gt; &amp;#039;Basis&amp;#039; and, on the Added Property Packages section, select an added Property Package, click on &amp;#039;Advanced&amp;#039; and go to &amp;#039;Property Overrides&amp;#039;.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&amp;lt;span class=&amp;quot;mw-headline&amp;quot; id=&amp;quot;Cross-Platform_UI&amp;quot;&amp;gt;Cross-Platform UI&amp;lt;/span&amp;gt;&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Click on &amp;#039;Setup&amp;#039; menu item &amp;amp;gt; &amp;#039;Basis&amp;#039; and, on the Added Property Packages section, select an added Property Package, click on &amp;#039;Advanced&amp;#039; and go to &amp;#039;Property Overrides&amp;#039;.&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;[[File:Propovrr.jpg]]&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&amp;lt;span class=&amp;quot;mw-headline&amp;quot; id=&amp;quot;Override_Script_Samples&amp;quot;&amp;gt;Override Script Samples&amp;lt;/span&amp;gt;&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&amp;lt;span class=&amp;quot;mw-headline&amp;quot; id=&amp;quot;Solid_Density&amp;quot;&amp;gt;Solid Density&amp;lt;/span&amp;gt;&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If you have a solid phase in your simulation, try the following:&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;[[File:Propovrr2.jpg]]&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Click &amp;#039;Save&amp;#039; to store the override script on the Property Package. Solve the simulation and check the calculated value. This override will work on all Material Streams which are associated with the modified Property Package.&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;[[File:Propovrr3.jpg]]&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&amp;lt;span class=&amp;quot;mw-headline&amp;quot; id=&amp;quot;Water.2FHydrocarbon_Emulsion_Viscosity&amp;quot;&amp;gt;Water/Hydrocarbon Emulsion Viscosity&amp;lt;/span&amp;gt;&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;In this example, we will use a script to update the viscosity calculation method of the overall liquid phase when there are two liquid phases on the mixture, in order to take into account the emulsion effects in a pipe flow simulation.&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;We will replace the current method for liquid mixture viscosity (a simple mass fraction weighted average) by this emulsion equation:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;dl&amp;gt;&amp;lt;dd&amp;gt;&amp;lt;span style=&amp;#039;opacity:0.5&amp;#039;&amp;gt;[math]\mu = (\mu_w / \delta_w)[1+1.5\mu_h\delta_h(\mu_w+\mu_h)][/math]&amp;lt;/span&amp;gt;&amp;lt;/dd&amp;gt;&amp;lt;/dl&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;where &amp;lt;span style=&amp;#039;opacity:0.5&amp;#039;&amp;gt;[math]\mu[/math]&amp;lt;/span&amp;gt; is viscosity and &amp;lt;span style=&amp;#039;opacity:0.5&amp;#039;&amp;gt;[math]\delta[/math]&amp;lt;/span&amp;gt; is volumetric fraction. Subscripts &amp;lt;span style=&amp;#039;opacity:0.5&amp;#039;&amp;gt;[math]w[/math]&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;#039;opacity:0.5&amp;#039;&amp;gt;[math]h[/math]&amp;lt;/span&amp;gt; refer to water and hydrocarbon phase, respectively.&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Open the Property Override editor and enter the following script for the &amp;quot;OverallLiquid/viscosity&amp;quot; property:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# properties are nullable values, so we need to check if they have a value first.&lt;br /&gt;
&lt;br /&gt;
viscobj = matstr.GetPhase(&amp;#039;OverallLiquid&amp;#039;).Properties.viscosity&lt;br /&gt;
&lt;br /&gt;
if (viscobj &amp;amp;lt;&amp;amp;gt; None):&lt;br /&gt;
&lt;br /&gt;
	currval = viscobj&lt;br /&gt;
	&lt;br /&gt;
	# write current value to the flowsheet (Pa.s)&lt;br /&gt;
	flowsheet.WriteMessage(&amp;#039;current liquid mixture viscosity value (Pa.s): &amp;#039; + str(currval))&lt;br /&gt;
	&lt;br /&gt;
	# get viscosity of the liquid hydrocarbon phase&lt;br /&gt;
	mu_h = matstr.GetPhase(&amp;#039;Liquid1&amp;#039;).Properties.viscosity&lt;br /&gt;
	&lt;br /&gt;
	# get viscosity of the liquid water phase&lt;br /&gt;
	mu_w = matstr.GetPhase(&amp;#039;Liquid2&amp;#039;).Properties.viscosity&lt;br /&gt;
&lt;br /&gt;
	# get volumetric flow of the liquid hydrocarbon phase&lt;br /&gt;
	vflow_h = matstr.GetPhase(&amp;#039;Liquid1&amp;#039;).Properties.volumetric_flow&lt;br /&gt;
&lt;br /&gt;
	# get volumetric flow of the liquid water phase&lt;br /&gt;
	vflow_w = matstr.GetPhase(&amp;#039;Liquid2&amp;#039;).Properties.volumetric_flow&lt;br /&gt;
&lt;br /&gt;
	# calculate volumetric fraction of the liquid hydrocarbon phase&lt;br /&gt;
	vf_h = matstr.GetPhase(&amp;#039;Liquid1&amp;#039;).Properties.volumetric_flow / (vflow_h + vflow_w)&lt;br /&gt;
&lt;br /&gt;
	# calculate volumetric fraction of the liquid water phase&lt;br /&gt;
	vf_w = matstr.GetPhase(&amp;#039;Liquid2&amp;#039;).Properties.volumetric_flow / (vflow_h + vflow_w)&lt;br /&gt;
&lt;br /&gt;
	# update liquid mixture viscosity with the result from emulsion equation (Pa.s)&lt;br /&gt;
	propval = (mu_w/vf_w)*(1.0+1.5*mu_h*vf_h/(mu_w+mu_h))&lt;br /&gt;
&lt;br /&gt;
	flowsheet.WriteMessage(&amp;#039;updated liquid mixture (emulsion) viscosity value (Pa.s): &amp;#039; + str(propval))&lt;br /&gt;
&lt;br /&gt;
else:&lt;br /&gt;
&lt;br /&gt;
	propval = 0.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;[[File:Propovrr4.jpg]]&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Run the simulation again and store the results. You can view the effect of the updated viscosity on the pipe pressure profile:&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;[[File:Propovrr5.jpg]]&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Download the liquid viscosity override sample simulation from here: [http://dwsim.inforside.com.br/files/viscovrr.dwxmz viscovrr.dwxmz]&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>DanWBR</name></author>
		
	</entry>
</feed>