


{"id":159312,"date":"2021-06-09T15:20:23","date_gmt":"2021-06-09T15:20:23","guid":{"rendered":"\/forum\/forums\/topic\/problem-regarding-writing-udf-for-burns-et-al-model\/"},"modified":"2021-07-21T08:24:35","modified_gmt":"2021-07-21T08:24:35","slug":"problem-regarding-writing-udf-for-burns-et-al-model","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/problem-regarding-writing-udf-for-burns-et-al-model\/","title":{"rendered":"Problem regarding writing UDF for Burns et. al Model :-"},"content":{"rendered":"<div class=\"Item-Body\">\n<div class=\"Message userContent\">\n<p>I have written the UDF for Burns et. al Model: &#8211;<\/p>\n<p>#&nbsp;include&nbsp;&quot;udf.h&quot;<\/p>\n<p>DEFINE_VECTOR_EXCHANGE_PROPERTY(burnetal,cell,mixture,liquid,solid,Ftdvector)<\/p>\n<p>{<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;Thread&nbsp;*thread_l,&nbsp;*thread_s;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;real&nbsp;rho_l,rho_s,Sigmapq,alpha_l,alpha_s,term,Ftd,Ctd,Kpq;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;real&nbsp;px,py,pz,sx,sy,sz;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;real&nbsp;x_vel_l,y_vel_l,z_vel_l,x_vel_s,y_vel_s,z_vel_s,slip_x,slip_y,slip_z,slip;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;thread_l=THREAD_SUB_THREAD(mixture,liquid);<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;thread_s=THREAD_SUB_THREAD(mixture,solid);<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;\/*&nbsp;Calculation&nbsp;of&nbsp;Gradients&nbsp;*\/<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;alpha_l=C_VOF(cell,&nbsp;thread_l);&nbsp;\/*&nbsp;liquid&nbsp;phase&nbsp;volume&nbsp;fraction&nbsp;*\/<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;alpha_s=C_VOF(cell,&nbsp;thread_s);&nbsp;\/*&nbsp;Solid&nbsp;Phase&nbsp;Volume&nbsp;fraction&nbsp;*\/<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;rho_l=C_R(cell,thread_l);<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;rho_s=C_R(cell,thread_s);<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;Ctd=1;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;Sigmapq=.9;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;Kpq=alpha_l*rho_l*C_K(cell,&nbsp;thread_l)+alpha_s*rho_s*C_K(cell,&nbsp;thread_s);<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;term=Ctd*Kpq*C_MU_T(cell,thread_l)\/(rho_l*Sigmapq);<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;px=C_VOF_G(cell,thread_l)[0]\/alpha_l;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;py=C_VOF_G(cell,thread_l)[1]\/alpha_l;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;pz=C_VOF_G(cell,thread_l)[2]\/alpha_l;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;sx=C_VOF_G(cell,thread_s)[0]\/alpha_s;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;sy=C_VOF_G(cell,thread_s)[1]\/alpha_s;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;sz=C_VOF_G(cell,thread_s)[2]\/alpha_s;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;\/*&nbsp;Calculation&nbsp;of&nbsp;the&nbsp;Final&nbsp;Expression&nbsp;*\/<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;Ftdvector[0]=term*(sx-px);<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;Ftdvector[1]=term*(sy-py);<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;Ftdvector[2]=term*(sz-pz);<\/p>\n<p>}&nbsp;&nbsp;&nbsp;<\/p>\n<p>But I am getting a floating-point error after certain iterations and also unable to know why the formula used by ANSYS THEORY GUIDE for the Burns et. al model (Turbulent Dispersion) is different from that used in the original paper.<\/p>\n","protected":false},"template":"","class_list":["post-159312","topic","type-topic","status-closed","hentry"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"I have written the UDF for Burns et. al Model: -# include &quot;udf.h&quot;DEFINE_VECTOR_EXCHANGE_PROPERTY(burnetal,cell,mixture,liquid,solid,Ftdvector){ Thread *thread_l, *thread_s; real rho_l,rho_s,Sigmapq,alpha_l,alpha_s,term,Ftd,Ctd,Kpq; real px,py,pz,sx,sy,sz; real x_vel_l,y_vel_l,z_vel_l,x_vel_s,y_vel_s,z_vel_s,slip_x,slip_y,slip_z,slip; thread_l=THREAD_SUB_THREAD(mixture,liquid); thread_s=THREAD_SUB_THREAD(mixture,solid); \/* Calculation of Gradients *\/ alpha_l=C_VOF(cell, thread_l); \/* liquid phase volume fraction *\/ alpha_s=C_VOF(cell, thread_s); \/* Solid Phase Volume fraction *\/ rho_l=C_R(cell,thread_l); rho_s=C_R(cell,thread_s); Ctd=1; Sigmapq=.9; Kpq=alpha_l*rho_l*C_K(cell, thread_l)+alpha_s*rho_s*C_K(cell, thread_s); term=Ctd*Kpq*C_MU_T(cell,thread_l)\/(rho_l*Sigmapq); px=C_VOF_G(cell,thread_l)[0]\/alpha_l; py=C_VOF_G(cell,thread_l)[1]\/alpha_l; pz=C_VOF_G(cell,thread_l)[2]\/alpha_l; sx=C_VOF_G(cell,thread_s)[0]\/alpha_s; sy=C_VOF_G(cell,thread_s)[1]\/alpha_s; sz=C_VOF_G(cell,thread_s)[2]\/alpha_s; \/* Calculation of the Final Expression *\/ Ftdvector[0]=term*(sx-px); Ftdvector[1]=term*(sy-py); Ftdvector[2]=term*(sz-pz);} But I am getting a floating-point error after certain iterations and also unable to know why the formula used by ANSYS THEORY GUIDE for the Burns et. al model (Turbulent Dispersion) is different from that used in the original paper.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/problem-regarding-writing-udf-for-burns-et-al-model\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Ansys Learning Forum | Ansys Innovation Space\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Problem regarding writing UDF for Burns et. al Model :- | Ansys Learning Forum\" \/>\n\t\t<meta property=\"og:description\" content=\"I have written the UDF for Burns et. al Model: -# include &quot;udf.h&quot;DEFINE_VECTOR_EXCHANGE_PROPERTY(burnetal,cell,mixture,liquid,solid,Ftdvector){ Thread *thread_l, *thread_s; real rho_l,rho_s,Sigmapq,alpha_l,alpha_s,term,Ftd,Ctd,Kpq; real px,py,pz,sx,sy,sz; real x_vel_l,y_vel_l,z_vel_l,x_vel_s,y_vel_s,z_vel_s,slip_x,slip_y,slip_z,slip; thread_l=THREAD_SUB_THREAD(mixture,liquid); thread_s=THREAD_SUB_THREAD(mixture,solid); \/* Calculation of Gradients *\/ alpha_l=C_VOF(cell, thread_l); \/* liquid phase volume fraction *\/ alpha_s=C_VOF(cell, thread_s); \/* Solid Phase Volume fraction *\/ rho_l=C_R(cell,thread_l); rho_s=C_R(cell,thread_s); Ctd=1; Sigmapq=.9; Kpq=alpha_l*rho_l*C_K(cell, thread_l)+alpha_s*rho_s*C_K(cell, thread_s); term=Ctd*Kpq*C_MU_T(cell,thread_l)\/(rho_l*Sigmapq); px=C_VOF_G(cell,thread_l)[0]\/alpha_l; py=C_VOF_G(cell,thread_l)[1]\/alpha_l; pz=C_VOF_G(cell,thread_l)[2]\/alpha_l; sx=C_VOF_G(cell,thread_s)[0]\/alpha_s; sy=C_VOF_G(cell,thread_s)[1]\/alpha_s; sz=C_VOF_G(cell,thread_s)[2]\/alpha_s; \/* Calculation of the Final Expression *\/ Ftdvector[0]=term*(sx-px); Ftdvector[1]=term*(sy-py); Ftdvector[2]=term*(sz-pz);} But I am getting a floating-point error after certain iterations and also unable to know why the formula used by ANSYS THEORY GUIDE for the Burns et. al model (Turbulent Dispersion) is different from that used in the original paper.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/problem-regarding-writing-udf-for-burns-et-al-model\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2021-06-09T15:20:23+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2021-07-21T08:24:35+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Problem regarding writing UDF for Burns et. al Model :- | Ansys Learning Forum\" \/>\n\t\t<meta name=\"twitter:description\" content=\"I have written the UDF for Burns et. al Model: -# include &quot;udf.h&quot;DEFINE_VECTOR_EXCHANGE_PROPERTY(burnetal,cell,mixture,liquid,solid,Ftdvector){ Thread *thread_l, *thread_s; real rho_l,rho_s,Sigmapq,alpha_l,alpha_s,term,Ftd,Ctd,Kpq; real px,py,pz,sx,sy,sz; real x_vel_l,y_vel_l,z_vel_l,x_vel_s,y_vel_s,z_vel_s,slip_x,slip_y,slip_z,slip; thread_l=THREAD_SUB_THREAD(mixture,liquid); thread_s=THREAD_SUB_THREAD(mixture,solid); \/* Calculation of Gradients *\/ alpha_l=C_VOF(cell, thread_l); \/* liquid phase volume fraction *\/ alpha_s=C_VOF(cell, thread_s); \/* Solid Phase Volume fraction *\/ rho_l=C_R(cell,thread_l); rho_s=C_R(cell,thread_s); Ctd=1; Sigmapq=.9; Kpq=alpha_l*rho_l*C_K(cell, thread_l)+alpha_s*rho_s*C_K(cell, thread_s); term=Ctd*Kpq*C_MU_T(cell,thread_l)\/(rho_l*Sigmapq); px=C_VOF_G(cell,thread_l)[0]\/alpha_l; py=C_VOF_G(cell,thread_l)[1]\/alpha_l; pz=C_VOF_G(cell,thread_l)[2]\/alpha_l; sx=C_VOF_G(cell,thread_s)[0]\/alpha_s; sy=C_VOF_G(cell,thread_s)[1]\/alpha_s; sz=C_VOF_G(cell,thread_s)[2]\/alpha_s; \/* Calculation of the Final Expression *\/ Ftdvector[0]=term*(sx-px); Ftdvector[1]=term*(sy-py); Ftdvector[2]=term*(sz-pz);} But I am getting a floating-point error after certain iterations and also unable to know why the formula used by ANSYS THEORY GUIDE for the Burns et. al model (Turbulent Dispersion) is different from that used in the original paper.\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/problem-regarding-writing-udf-for-burns-et-al-model\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"name\":\"Topics\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/problem-regarding-writing-udf-for-burns-et-al-model\\\/#listItem\",\"name\":\"Problem regarding writing UDF for Burns et. al Model :-\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/problem-regarding-writing-udf-for-burns-et-al-model\\\/#listItem\",\"position\":3,\"name\":\"Problem regarding writing UDF for Burns et. al Model :-\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"name\":\"Topics\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#organization\",\"name\":\"Ansys Learning Forum\",\"description\":\"Ansys Innovation Space\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/problem-regarding-writing-udf-for-burns-et-al-model\\\/#webpage\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/problem-regarding-writing-udf-for-burns-et-al-model\\\/\",\"name\":\"Problem regarding writing UDF for Burns et. al Model :- | Ansys Learning Forum\",\"description\":\"I have written the UDF for Burns et. al Model: -# include \\\"udf.h\\\"DEFINE_VECTOR_EXCHANGE_PROPERTY(burnetal,cell,mixture,liquid,solid,Ftdvector){ Thread *thread_l, *thread_s; real rho_l,rho_s,Sigmapq,alpha_l,alpha_s,term,Ftd,Ctd,Kpq; real px,py,pz,sx,sy,sz; real x_vel_l,y_vel_l,z_vel_l,x_vel_s,y_vel_s,z_vel_s,slip_x,slip_y,slip_z,slip; thread_l=THREAD_SUB_THREAD(mixture,liquid); thread_s=THREAD_SUB_THREAD(mixture,solid); \\\/* Calculation of Gradients *\\\/ alpha_l=C_VOF(cell, thread_l); \\\/* liquid phase volume fraction *\\\/ alpha_s=C_VOF(cell, thread_s); \\\/* Solid Phase Volume fraction *\\\/ rho_l=C_R(cell,thread_l); rho_s=C_R(cell,thread_s); Ctd=1; Sigmapq=.9; Kpq=alpha_l*rho_l*C_K(cell, thread_l)+alpha_s*rho_s*C_K(cell, thread_s); term=Ctd*Kpq*C_MU_T(cell,thread_l)\\\/(rho_l*Sigmapq); px=C_VOF_G(cell,thread_l)[0]\\\/alpha_l; py=C_VOF_G(cell,thread_l)[1]\\\/alpha_l; pz=C_VOF_G(cell,thread_l)[2]\\\/alpha_l; sx=C_VOF_G(cell,thread_s)[0]\\\/alpha_s; sy=C_VOF_G(cell,thread_s)[1]\\\/alpha_s; sz=C_VOF_G(cell,thread_s)[2]\\\/alpha_s; \\\/* Calculation of the Final Expression *\\\/ Ftdvector[0]=term*(sx-px); Ftdvector[1]=term*(sy-py); Ftdvector[2]=term*(sz-pz);} But I am getting a floating-point error after certain iterations and also unable to know why the formula used by ANSYS THEORY GUIDE for the Burns et. al model (Turbulent Dispersion) is different from that used in the original paper.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/problem-regarding-writing-udf-for-burns-et-al-model\\\/#breadcrumblist\"},\"datePublished\":\"2021-06-09T15:20:23+00:00\",\"dateModified\":\"2021-07-21T08:24:35+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/\",\"name\":\"Ansys Learning Forum\",\"description\":\"Ansys Innovation Space\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Problem regarding writing UDF for Burns et. al Model :- | Ansys Learning Forum","description":"I have written the UDF for Burns et. al Model: -# include \"udf.h\"DEFINE_VECTOR_EXCHANGE_PROPERTY(burnetal,cell,mixture,liquid,solid,Ftdvector){ Thread *thread_l, *thread_s; real rho_l,rho_s,Sigmapq,alpha_l,alpha_s,term,Ftd,Ctd,Kpq; real px,py,pz,sx,sy,sz; real x_vel_l,y_vel_l,z_vel_l,x_vel_s,y_vel_s,z_vel_s,slip_x,slip_y,slip_z,slip; thread_l=THREAD_SUB_THREAD(mixture,liquid); thread_s=THREAD_SUB_THREAD(mixture,solid); \/* Calculation of Gradients *\/ alpha_l=C_VOF(cell, thread_l); \/* liquid phase volume fraction *\/ alpha_s=C_VOF(cell, thread_s); \/* Solid Phase Volume fraction *\/ rho_l=C_R(cell,thread_l); rho_s=C_R(cell,thread_s); Ctd=1; Sigmapq=.9; Kpq=alpha_l*rho_l*C_K(cell, thread_l)+alpha_s*rho_s*C_K(cell, thread_s); term=Ctd*Kpq*C_MU_T(cell,thread_l)\/(rho_l*Sigmapq); px=C_VOF_G(cell,thread_l)[0]\/alpha_l; py=C_VOF_G(cell,thread_l)[1]\/alpha_l; pz=C_VOF_G(cell,thread_l)[2]\/alpha_l; sx=C_VOF_G(cell,thread_s)[0]\/alpha_s; sy=C_VOF_G(cell,thread_s)[1]\/alpha_s; sz=C_VOF_G(cell,thread_s)[2]\/alpha_s; \/* Calculation of the Final Expression *\/ Ftdvector[0]=term*(sx-px); Ftdvector[1]=term*(sy-py); Ftdvector[2]=term*(sz-pz);} But I am getting a floating-point error after certain iterations and also unable to know why the formula used by ANSYS THEORY GUIDE for the Burns et. al model (Turbulent Dispersion) is different from that used in the original paper.","canonical_url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/problem-regarding-writing-udf-for-burns-et-al-model\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/problem-regarding-writing-udf-for-burns-et-al-model\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","position":1,"name":"Home","item":"https:\/\/innovationspace.ansys.com\/forum","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","name":"Topics"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","position":2,"name":"Topics","item":"https:\/\/innovationspace.ansys.com\/forum\/topics\/","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/problem-regarding-writing-udf-for-burns-et-al-model\/#listItem","name":"Problem regarding writing UDF for Burns et. al Model :-"},"previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/problem-regarding-writing-udf-for-burns-et-al-model\/#listItem","position":3,"name":"Problem regarding writing UDF for Burns et. al Model :-","previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","name":"Topics"}}]},{"@type":"Organization","@id":"https:\/\/innovationspace.ansys.com\/forum\/#organization","name":"Ansys Learning Forum","description":"Ansys Innovation Space","url":"https:\/\/innovationspace.ansys.com\/forum\/"},{"@type":"WebPage","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/problem-regarding-writing-udf-for-burns-et-al-model\/#webpage","url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/problem-regarding-writing-udf-for-burns-et-al-model\/","name":"Problem regarding writing UDF for Burns et. al Model :- | Ansys Learning Forum","description":"I have written the UDF for Burns et. al Model: -# include \"udf.h\"DEFINE_VECTOR_EXCHANGE_PROPERTY(burnetal,cell,mixture,liquid,solid,Ftdvector){ Thread *thread_l, *thread_s; real rho_l,rho_s,Sigmapq,alpha_l,alpha_s,term,Ftd,Ctd,Kpq; real px,py,pz,sx,sy,sz; real x_vel_l,y_vel_l,z_vel_l,x_vel_s,y_vel_s,z_vel_s,slip_x,slip_y,slip_z,slip; thread_l=THREAD_SUB_THREAD(mixture,liquid); thread_s=THREAD_SUB_THREAD(mixture,solid); \/* Calculation of Gradients *\/ alpha_l=C_VOF(cell, thread_l); \/* liquid phase volume fraction *\/ alpha_s=C_VOF(cell, thread_s); \/* Solid Phase Volume fraction *\/ rho_l=C_R(cell,thread_l); rho_s=C_R(cell,thread_s); Ctd=1; Sigmapq=.9; Kpq=alpha_l*rho_l*C_K(cell, thread_l)+alpha_s*rho_s*C_K(cell, thread_s); term=Ctd*Kpq*C_MU_T(cell,thread_l)\/(rho_l*Sigmapq); px=C_VOF_G(cell,thread_l)[0]\/alpha_l; py=C_VOF_G(cell,thread_l)[1]\/alpha_l; pz=C_VOF_G(cell,thread_l)[2]\/alpha_l; sx=C_VOF_G(cell,thread_s)[0]\/alpha_s; sy=C_VOF_G(cell,thread_s)[1]\/alpha_s; sz=C_VOF_G(cell,thread_s)[2]\/alpha_s; \/* Calculation of the Final Expression *\/ Ftdvector[0]=term*(sx-px); Ftdvector[1]=term*(sy-py); Ftdvector[2]=term*(sz-pz);} But I am getting a floating-point error after certain iterations and also unable to know why the formula used by ANSYS THEORY GUIDE for the Burns et. al model (Turbulent Dispersion) is different from that used in the original paper.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#website"},"breadcrumb":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/problem-regarding-writing-udf-for-burns-et-al-model\/#breadcrumblist"},"datePublished":"2021-06-09T15:20:23+00:00","dateModified":"2021-07-21T08:24:35+00:00"},{"@type":"WebSite","@id":"https:\/\/innovationspace.ansys.com\/forum\/#website","url":"https:\/\/innovationspace.ansys.com\/forum\/","name":"Ansys Learning Forum","description":"Ansys Innovation Space","inLanguage":"en-US","publisher":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#organization"}}]},"og:locale":"en_US","og:site_name":"Ansys Learning Forum | Ansys Innovation Space","og:type":"article","og:title":"Problem regarding writing UDF for Burns et. al Model :- | Ansys Learning Forum","og:description":"I have written the UDF for Burns et. al Model: -# include &quot;udf.h&quot;DEFINE_VECTOR_EXCHANGE_PROPERTY(burnetal,cell,mixture,liquid,solid,Ftdvector){ Thread *thread_l, *thread_s; real rho_l,rho_s,Sigmapq,alpha_l,alpha_s,term,Ftd,Ctd,Kpq; real px,py,pz,sx,sy,sz; real x_vel_l,y_vel_l,z_vel_l,x_vel_s,y_vel_s,z_vel_s,slip_x,slip_y,slip_z,slip; thread_l=THREAD_SUB_THREAD(mixture,liquid); thread_s=THREAD_SUB_THREAD(mixture,solid); \/* Calculation of Gradients *\/ alpha_l=C_VOF(cell, thread_l); \/* liquid phase volume fraction *\/ alpha_s=C_VOF(cell, thread_s); \/* Solid Phase Volume fraction *\/ rho_l=C_R(cell,thread_l); rho_s=C_R(cell,thread_s); Ctd=1; Sigmapq=.9; Kpq=alpha_l*rho_l*C_K(cell, thread_l)+alpha_s*rho_s*C_K(cell, thread_s); term=Ctd*Kpq*C_MU_T(cell,thread_l)\/(rho_l*Sigmapq); px=C_VOF_G(cell,thread_l)[0]\/alpha_l; py=C_VOF_G(cell,thread_l)[1]\/alpha_l; pz=C_VOF_G(cell,thread_l)[2]\/alpha_l; sx=C_VOF_G(cell,thread_s)[0]\/alpha_s; sy=C_VOF_G(cell,thread_s)[1]\/alpha_s; sz=C_VOF_G(cell,thread_s)[2]\/alpha_s; \/* Calculation of the Final Expression *\/ Ftdvector[0]=term*(sx-px); Ftdvector[1]=term*(sy-py); Ftdvector[2]=term*(sz-pz);} But I am getting a floating-point error after certain iterations and also unable to know why the formula used by ANSYS THEORY GUIDE for the Burns et. al model (Turbulent Dispersion) is different from that used in the original paper.","og:url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/problem-regarding-writing-udf-for-burns-et-al-model\/","article:published_time":"2021-06-09T15:20:23+00:00","article:modified_time":"2021-07-21T08:24:35+00:00","twitter:card":"summary_large_image","twitter:title":"Problem regarding writing UDF for Burns et. al Model :- | Ansys Learning Forum","twitter:description":"I have written the UDF for Burns et. al Model: -# include &quot;udf.h&quot;DEFINE_VECTOR_EXCHANGE_PROPERTY(burnetal,cell,mixture,liquid,solid,Ftdvector){ Thread *thread_l, *thread_s; real rho_l,rho_s,Sigmapq,alpha_l,alpha_s,term,Ftd,Ctd,Kpq; real px,py,pz,sx,sy,sz; real x_vel_l,y_vel_l,z_vel_l,x_vel_s,y_vel_s,z_vel_s,slip_x,slip_y,slip_z,slip; thread_l=THREAD_SUB_THREAD(mixture,liquid); thread_s=THREAD_SUB_THREAD(mixture,solid); \/* Calculation of Gradients *\/ alpha_l=C_VOF(cell, thread_l); \/* liquid phase volume fraction *\/ alpha_s=C_VOF(cell, thread_s); \/* Solid Phase Volume fraction *\/ rho_l=C_R(cell,thread_l); rho_s=C_R(cell,thread_s); Ctd=1; Sigmapq=.9; Kpq=alpha_l*rho_l*C_K(cell, thread_l)+alpha_s*rho_s*C_K(cell, thread_s); term=Ctd*Kpq*C_MU_T(cell,thread_l)\/(rho_l*Sigmapq); px=C_VOF_G(cell,thread_l)[0]\/alpha_l; py=C_VOF_G(cell,thread_l)[1]\/alpha_l; pz=C_VOF_G(cell,thread_l)[2]\/alpha_l; sx=C_VOF_G(cell,thread_s)[0]\/alpha_s; sy=C_VOF_G(cell,thread_s)[1]\/alpha_s; sz=C_VOF_G(cell,thread_s)[2]\/alpha_s; \/* Calculation of the Final Expression *\/ Ftdvector[0]=term*(sx-px); Ftdvector[1]=term*(sy-py); Ftdvector[2]=term*(sz-pz);} But I am getting a floating-point error after certain iterations and also unable to know why the formula used by ANSYS THEORY GUIDE for the Burns et. al model (Turbulent Dispersion) is different from that used in the original paper."},"aioseo_meta_data":{"post_id":"159312","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"content","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":true,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2024-10-28 20:30:43","updated":"2024-10-28 20:30:43","ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\/topics\/\" title=\"Topics\">Topics<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tProblem regarding writing UDF for Burns et. al Model :-\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/innovationspace.ansys.com\/forum"},{"label":"Topics","link":"https:\/\/innovationspace.ansys.com\/forum\/topics\/"},{"label":"Problem regarding writing UDF for Burns et. al Model :-","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/problem-regarding-writing-udf-for-burns-et-al-model\/"}],"acf":[],"custom_fields":[{"0":{"_bbp_author_ip":[""],"_bbp_old_reply_author_name_id":["Anonymous"],"_bbp_old_is_reply_anonymous_id":["false"],"_btv_view_count":["667"],"_bbp_likes_count":["0"],"_bbp_subscription":["240881","10486"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["159312"],"_bbp_forum_id":["27792"],"_bbp_engagement":["118","199","10486","22555","201690"],"_bbp_voice_count":["5"],"_bbp_reply_count":["20"],"_bbp_last_reply_id":["296223"],"_bbp_last_active_id":["296223"],"_bbp_last_active_time":["2023-08-03 01:09:37"]},"test":"prantikdas93gmail-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/159312","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/159312\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=159312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}