


{"id":450754,"date":"2026-01-20T12:56:30","date_gmt":"2026-01-20T12:56:30","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/compile-the-udf-code-and-apply-it-to-the-dpm\/"},"modified":"2026-01-20T12:56:30","modified_gmt":"2026-01-20T12:56:30","slug":"compile-the-udf-code-and-apply-it-to-the-dpm","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/compile-the-udf-code-and-apply-it-to-the-dpm\/","title":{"rendered":"Compile the UDF code and apply it to the DPM."},"content":{"rendered":"<p>&lt;p&gt;I plan to compile the UDF code based on the content of the image and apply it to DPM. Could you please check if there are any errors in the provided code? The references are as follows.&lt;\/p&gt;&lt;p&gt;Xu W, Dong CJ, Li DS. Numerical simulation on influences of wind speed to leaking diffusion of liquid ammonia. Advanced Materials Research. 2015 Jan 27;1073:383-7.&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;<img decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/forum\/wp-content\/uploads\/sites\/2\/2026\/01\/20-01-2026-1768913476-mceclip0.png\" \/><img decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/forum\/wp-content\/uploads\/sites\/2\/2026\/01\/20-01-2026-1768913483-mceclip1.png\" \/>&lt;\/p&gt;&lt;div&gt;&lt;div&gt;#include &#8220;udf.h&#8221;&lt;\/div&gt;&lt;div&gt;#include &#8220;dpm.h&#8221;&lt;\/div&gt;&lt;div&gt;#include &#8220;dpm_mem.h&#8221;&lt;\/div&gt;&lt;br&gt;&lt;div&gt;\/* \u5b9a\u4e49\u5e38\u91cf *\/&lt;\/div&gt;&lt;div&gt;#define T_SAT 240.15 &nbsp; &nbsp; &nbsp; &nbsp;\/* \u84b8\u53d1\u6e29\u5ea6 -33&deg;C = 240.15 K *\/&lt;\/div&gt;&lt;div&gt;[cite_start]#define LATENT_HEAT 1.37e6 &nbsp;\/* \u6c28\u6c14\u5316\u6f5c\u70ed J\/kg [cite: 66] *\/&lt;\/div&gt;&lt;br&gt;&lt;div&gt;DEFINE_DPM_HEAT_MASS(multivap, tp, Cp, hgas, hvap, cvap_surf, Z, dydt, dzdt)&lt;\/div&gt;&lt;div&gt;{&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; int ns;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; Material *sp;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; \/* \u53d8\u91cf\u521d\u59cb\u5316 *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; int nc = TP_N_COMPONENTS(tp);&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; Thread *t0 = TP_CELL_THREAD(tp);&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; Material *gas_mix = THREAD_MATERIAL(DPM_THREAD(t0, tp));&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; cphase_state_t *c = &amp;(tp-&gt;cphase[0]);&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; real molwt[MAX_SPE_EQNS];&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; real Tp = TP_T(tp); &nbsp; &nbsp; &nbsp;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; real mp = TP_MASS(tp); &nbsp; &nbsp;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; real molwt_bulk = 0.; &nbsp; &nbsp;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; \/* \u8ba1\u7b97\u7c92\u5b50\u51e0\u4f55\u5c5e\u6027 *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; real Dp = DPM_DIAM_FROM_VOL(mp \/ TP_RHO(tp));&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; real Ap = DPM_AREA(Dp); &nbsp; [cite_start]\/* [cite: 63] *\/&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; \/* &#8212; 1. \u70ed\u4f20\u5bfc\u8ba1\u7b97 (\u4fdd\u6301\u539f\u903b\u8f91) &#8212; *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; real Pr = c-&gt;sHeat * c-&gt;mu \/ c-&gt;tCond;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; real Nu = 2.0 + 0.6 * sqrt(tp-&gt;Re) * pow(Pr, 1.\/3.);&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; real h = Nu * c-&gt;tCond \/ Dp;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; \/* Q = h * Ap * (T_gas &#8211; T_p) *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; real heat_transfer = h * (c-&gt;temp &#8211; Tp) * Ap;&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; \/* \u8f85\u52a9\uff1a\u8ba1\u7b97\u6c14\u76f8\u5206\u5b50\u91cf *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; mixture_species_loop(gas_mix, sp, ns)&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; {&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; molwt[ns] = MATERIAL_PROP(sp, PROP_mwi);&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; molwt_bulk += c-&gt;yi[ns] \/ molwt[ns];&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; }&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; molwt_bulk = MAX(molwt_bulk, DPM_SMALL);&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; \/* &#8212; 2. \u6838\u5fc3\u903b\u8f91 (\u4fee\u590d\u4e86\u7269\u7406\u9519\u8bef) &#8212; *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; real evaporation_rate = 0.0;&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; \/* \u60c5\u51b5 A: \u4f4e\u6e29\u663e\u70ed\u52a0\u70ed (Tp &lt; T_SAT) *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; if (Tp &lt; T_SAT)&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; {&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; \/* \u4ec5\u53d1\u751f\u70ed\u4f20\u5bfc\u5347\u6e29\uff0c\u65e0\u663e\u8457\u84b8\u53d1 *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; \/* Eq (9): m * Cp * dT\/dt = Q *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; dydt[0] += heat_transfer \/ (mp * Cp);&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; evaporation_rate = 0.0;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; }&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; \/* \u60c5\u51b5 B: \u6cb8\u817e\/\u6c14\u5316 (Tp &gt;= T_SAT) *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; else&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; {&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; \/* \u5047\u8bbe\u70ed\u91cf\u5168\u90e8\u8f6c\u5316\u4e3a\u6f5c\u70ed (dm\/dt * L = Q) *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; if (heat_transfer &gt; 0)&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; {&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;evaporation_rate = heat_transfer \/ LATENT_HEAT;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; }&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; \/* \u80fd\u91cf\u5b88\u6052\u5904\u7406\uff1a\u663e\u70ed\u53d8\u5316 = (\u603b\u70ed\u91cf &#8211; \u6f5c\u70ed\u6d88\u8017) *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; \/* \u7406\u8bba\u4e0a\u6b64\u5904 dydt[0] \u7ed3\u679c\u4e3a 0\uff0c\u5373\u6e29\u5ea6\u4fdd\u6301\u5728\u6cb8\u70b9 *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; real latent_heat_term = -evaporation_rate * LATENT_HEAT;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; dydt[0] += (heat_transfer + latent_heat_term) \/ (mp * Cp);&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; }&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; \/* &#8212; 3. \u5173\u952e\u4fee\u590d\uff1a\u6e90\u9879\u66f4\u65b0 &#8212; *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; \/* \u83b7\u53d6\u6c28\u6c14\u5728\u6c14\u76f8\u4e2d\u7684\u7ec4\u5206\u7d22\u5f15 *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; int gas_index = TP_COMPONENT_INDEX_I(tp, 0);&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; if (gas_index &gt;= 0)&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; {&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; \/* [\u4fee\u590d1] \u66f4\u65b0\u7c92\u5b50\u8d28\u91cf\u53d8\u5316\u7387 dydt *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; \/* \u7c92\u5b50\u8d28\u91cf\u51cf\u5c11\uff0c\u5bfc\u6570\u4e3a\u8d1f\u503c *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; \/* \u6ce8\u610f\uff1a\u5bf9\u4e8e\u591a\u7ec4\u5206\u7c92\u5b50\uff0c\u8d28\u91cf\u5b58\u50a8\u5728 dydt[1 + component_index] *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; \/* \u5bf9\u4e8e\u5355\u7ec4\u5206 Droplet\uff0c\u901a\u5e38 dydt[1] \u5373\u4e3a\u8d28\u91cf\u53d8\u5316 *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; dydt[1] -= evaporation_rate;&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; \/* [\u4fee\u590d2] \u66f4\u65b0\u6c14\u76f8\u6e90\u9879 dzdt *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; \/* \u6c14\u4f53\u83b7\u5f97\u8d28\u91cf\uff0c\u6e90\u9879\u4e3a\u6b63\u503c (+) *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; dzdt-&gt;species[gas_index] += evaporation_rate;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; \/* \u66f4\u65b0\u6c14\u76f8\u603b\u8d28\u91cf\u6e90\u9879 *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; dzdt-&gt;gas_mass += evaporation_rate;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; \/* \u80fd\u91cf\u6e90\u9879\u901a\u5e38\u7531 Fluent \u6839\u636e mass source \u81ea\u52a8\u5904\u7406\u7113\u6d41\uff0c&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u82e5\u9700\u663e\u5f0f\u6dfb\u52a0\u663e\u70ed\u4f20\u9012\u7ed9\u6c14\u76f8\uff0c\u53ef\u53d6\u6d88\u4e0b\u884c\u6ce8\u91ca *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; \/* dzdt-&gt;energy += heat_transfer; *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; }&lt;\/div&gt;&lt;div&gt;}&lt;\/div&gt;&lt;\/div&gt;<\/p>\n","protected":false},"template":"","class_list":["post-450754","topic","type-topic","status-publish","hentry"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"I plan to compile the UDF code based on the content of the image and apply it to DPM. Could you please check if there are any errors in the provided code? The references are as follows.Xu W, Dong CJ, Li DS. Numerical simulation on influences of wind speed to leaking diffusion of liquid ammonia.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/compile-the-udf-code-and-apply-it-to-the-dpm\/\" \/>\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=\"Compile the UDF code and apply it to the DPM. | Ansys Learning Forum\" \/>\n\t\t<meta property=\"og:description\" content=\"I plan to compile the UDF code based on the content of the image and apply it to DPM. Could you please check if there are any errors in the provided code? The references are as follows.Xu W, Dong CJ, Li DS. Numerical simulation on influences of wind speed to leaking diffusion of liquid ammonia.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/compile-the-udf-code-and-apply-it-to-the-dpm\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-01-20T12:56:30+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-01-20T12:56:30+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Compile the UDF code and apply it to the DPM. | Ansys Learning Forum\" \/>\n\t\t<meta name=\"twitter:description\" content=\"I plan to compile the UDF code based on the content of the image and apply it to DPM. Could you please check if there are any errors in the provided code? The references are as follows.Xu W, Dong CJ, Li DS. Numerical simulation on influences of wind speed to leaking diffusion of liquid ammonia.\" \/>\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\\\/compile-the-udf-code-and-apply-it-to-the-dpm\\\/#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\\\/compile-the-udf-code-and-apply-it-to-the-dpm\\\/#listItem\",\"name\":\"Compile the UDF code and apply it to the DPM.\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/compile-the-udf-code-and-apply-it-to-the-dpm\\\/#listItem\",\"position\":3,\"name\":\"Compile the UDF code and apply it to the DPM.\",\"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\\\/compile-the-udf-code-and-apply-it-to-the-dpm\\\/#webpage\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/compile-the-udf-code-and-apply-it-to-the-dpm\\\/\",\"name\":\"Compile the UDF code and apply it to the DPM. | Ansys Learning Forum\",\"description\":\"I plan to compile the UDF code based on the content of the image and apply it to DPM. Could you please check if there are any errors in the provided code? The references are as follows.Xu W, Dong CJ, Li DS. Numerical simulation on influences of wind speed to leaking diffusion of liquid ammonia.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/compile-the-udf-code-and-apply-it-to-the-dpm\\\/#breadcrumblist\"},\"datePublished\":\"2026-01-20T12:56:30+00:00\",\"dateModified\":\"2026-01-20T12:56:30+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":"Compile the UDF code and apply it to the DPM. | Ansys Learning Forum","description":"I plan to compile the UDF code based on the content of the image and apply it to DPM. Could you please check if there are any errors in the provided code? The references are as follows.Xu W, Dong CJ, Li DS. Numerical simulation on influences of wind speed to leaking diffusion of liquid ammonia.","canonical_url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/compile-the-udf-code-and-apply-it-to-the-dpm\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/compile-the-udf-code-and-apply-it-to-the-dpm\/#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\/compile-the-udf-code-and-apply-it-to-the-dpm\/#listItem","name":"Compile the UDF code and apply it to the DPM."},"previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/compile-the-udf-code-and-apply-it-to-the-dpm\/#listItem","position":3,"name":"Compile the UDF code and apply it to the DPM.","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\/compile-the-udf-code-and-apply-it-to-the-dpm\/#webpage","url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/compile-the-udf-code-and-apply-it-to-the-dpm\/","name":"Compile the UDF code and apply it to the DPM. | Ansys Learning Forum","description":"I plan to compile the UDF code based on the content of the image and apply it to DPM. Could you please check if there are any errors in the provided code? The references are as follows.Xu W, Dong CJ, Li DS. Numerical simulation on influences of wind speed to leaking diffusion of liquid ammonia.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#website"},"breadcrumb":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/compile-the-udf-code-and-apply-it-to-the-dpm\/#breadcrumblist"},"datePublished":"2026-01-20T12:56:30+00:00","dateModified":"2026-01-20T12:56:30+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":"Compile the UDF code and apply it to the DPM. | Ansys Learning Forum","og:description":"I plan to compile the UDF code based on the content of the image and apply it to DPM. Could you please check if there are any errors in the provided code? The references are as follows.Xu W, Dong CJ, Li DS. Numerical simulation on influences of wind speed to leaking diffusion of liquid ammonia.","og:url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/compile-the-udf-code-and-apply-it-to-the-dpm\/","article:published_time":"2026-01-20T12:56:30+00:00","article:modified_time":"2026-01-20T12:56:30+00:00","twitter:card":"summary_large_image","twitter:title":"Compile the UDF code and apply it to the DPM. | Ansys Learning Forum","twitter:description":"I plan to compile the UDF code based on the content of the image and apply it to DPM. Could you please check if there are any errors in the provided code? The references are as follows.Xu W, Dong CJ, Li DS. Numerical simulation on influences of wind speed to leaking diffusion of liquid ammonia."},"aioseo_meta_data":{"post_id":"450754","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":"default","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":false,"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":"2026-01-20 13:01:51","updated":"2026-09-19 08:08:57","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\tCompile the UDF code and apply it to the DPM.\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":"Compile the UDF code and apply it to the DPM.","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/compile-the-udf-code-and-apply-it-to-the-dpm\/"}],"acf":[],"custom_fields":[{"0":{"_bbp_forum_id":["291848"],"_bbp_topic_id":["450754"],"_bbp_subscription":["641985","199"],"_bbp_author_ip":["141.11.127.67"],"_bbp_last_reply_id":["450767"],"_bbp_last_active_id":["450767"],"_bbp_last_active_time":["2026-01-20 14:01:43"],"_bbp_reply_count":["1"],"_bbp_reply_count_hidden":["0"],"_bbp_voice_count":["2"],"_bbp_engagement":["641985","199"],"_btv_view_count":["503"],"_bbp_topic_status":["unanswered"]},"test":"24212040751stumail-xsyu-edu-cn"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/450754","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\/450754\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=450754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}