


{"id":252504,"date":"2023-03-03T15:34:31","date_gmt":"2023-03-03T15:34:31","guid":{"rendered":"\/forum\/forums\/topic\/compiling-udf-in-batch-mode-on-cluster\/"},"modified":"2023-03-03T15:34:31","modified_gmt":"2023-03-03T15:34:31","slug":"compiling-udf-in-batch-mode-on-cluster","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/compiling-udf-in-batch-mode-on-cluster\/","title":{"rendered":"Compiling UDF in batch mode on cluster"},"content":{"rendered":"<p>Hi,<\/p>\n<p>Doing the granular bed example from the tutorial to compile and run it on the cluster.<\/p>\n<p>1) Did the example as it is on my local windows installation, and it worked fine. <br \/>2) Moved it to the cluster, ran the same set of commands, and appraently the compilation log looks as follows (this also comes in the output console file)<\/p>\n<p>for d in lnamd64\/[23]*; do \\<br \/>&nbsp; ( \\<br \/>&nbsp; &nbsp; cd $d; \\<br \/>&nbsp; &nbsp; rm -rf *.{c,h,cpp,hpp}; \\<br \/>&nbsp; &nbsp; for f in ..\/..\/src\/*.{c,h,cpp,hpp} ..\/..\/src\/makefile ..\/..\/src\/user.udf; do \\<br \/>&nbsp; &nbsp; &nbsp; if [ -f $f -a ! -f `basename $f` ]; then \\<br \/>&nbsp; &nbsp; &nbsp; &nbsp; echo &#8220;# linking to&#8221; $f &#8220;in&#8221; $d; \\<br \/>&nbsp; &nbsp; &nbsp; &nbsp; ln -s $f .; \\<br \/>&nbsp; &nbsp; &nbsp; fi; \\<br \/>&nbsp; &nbsp; done; \\<br \/>&nbsp; &nbsp; echo &#8220;&#8221;; \\<br \/>&nbsp; &nbsp; echo &#8220;# building library in&#8221; $d; \\<br \/>&nbsp; &nbsp; if [ &#8220;&#8221; = &#8220;1&#8221; ]; then \\<br \/>&nbsp; &nbsp; echo &#8220;# using gcc64&#8221;; \\<br \/>&nbsp; &nbsp; make ARCHC=gcc64 -k&gt;makelog 2&gt;&amp;1; \\<br \/>&nbsp; &nbsp; else \\<br \/>&nbsp; &nbsp; if [ &#8220;&#8221; = &#8220;1&#8221; ]; then \\<br \/>&nbsp; &nbsp; &nbsp; &nbsp; echo &#8220;# using gcc&#8221;; \\<br \/>&nbsp; &nbsp; &nbsp; &nbsp; make ARCHC=gcc -k&gt;makelog 2&gt;&amp;1; \\<br \/>&nbsp; &nbsp; else \\<br \/>&nbsp; &nbsp; &nbsp; &nbsp; make -k&gt;makelog 2&gt;&amp;1; \\<br \/>&nbsp; &nbsp; fi; \\<br \/>&nbsp; &nbsp; fi;\\<br \/>&nbsp; &nbsp; cat makelog; \\<br \/>&nbsp; ) \\<br \/>done<br \/># linking to ..\/..\/src\/conduct.c in lnamd64\/2ddp_host<br \/># linking to ..\/..\/src\/makefile in lnamd64\/2ddp_host<\/p>\n<p># building library in lnamd64\/2ddp_host<br \/>make[1]: Entering directory `\/mainfs\/scratch\/aus1n19\/for_davidB\/udfexample\/libudf\/lnamd64\/2ddp_host&#8217;<br \/># Generating udf_names.c because of makefile conduct.c yes<br \/>sed: can&#8217;t read yes: No such file or directory<br \/>make[1]: *** [udf_names.c] Error 2<br \/>make[1]: Target `default&#8217; not remade because of errors.<br \/>make[1]: Leaving directory `\/mainfs\/scratch\/aus1n19\/for_davidB\/udfexample\/libudf\/lnamd64\/2ddp_host&#8217;<br \/># linking to ..\/..\/src\/conduct.c in lnamd64\/2ddp_node<br \/># linking to ..\/..\/src\/makefile in lnamd64\/2ddp_node<\/p>\n<p># building library in lnamd64\/2ddp_node<br \/>make[1]: Entering directory `\/scratch\/aus1n19\/udfexample\/libudf\/lnamd64\/2ddp_node&#8217;<br \/># Generating udf_names.c because of makefile conduct.c yes<br \/>sed: can&#8217;t read yes: No such file or directory<br \/>make[1]: *** [udf_names.c] Error 2<br \/>make[1]: Target `default&#8217; not remade because of errors.<br \/>make[1]: Leaving directory `\/mainfs\/scratch\/aus1n19\/for_davidB\/udfexample\/libudf\/lnamd64\/2ddp_node&#8217;<\/p>\n<p>&nbsp;<\/p>\n<p>tried doing this on fluent 22.2 as well as fluent 19.4. Same result for both of them. Any pointers how can I make it work. The journal looks as follows, <br \/>should help you copy paste, although I doubt it you would be that helpful. <\/p>\n<p>\/file\/read-case \/scratch\/aus1n19\/for_davidB\/udfexample\/fluid-bed.msh<\/p>\n<p>\/mesh\/check<\/p>\n<p>\/define\/operating-conditions\/gravity yes 0 -9.81<br \/>\/define\/models\/unsteady-1st-order yes<br \/>q<\/p>\n<p>\/define\/models\/multiphase\/model eulerian<\/p>\n<p>\/define\/models\/energy? yes no no no no<\/p>\n<p>\/define\/models\/viscous laminar yes<\/p>\n<p>&nbsp;<\/p>\n<p>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; UDF step ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br \/>; insert the c file name inplace of conduct.c file<br \/>; If you have multiple udf files, just add them next to each other so they all are compiled in one libudf folder<br \/>; e.g. \/define\/user-defined\/compiled-functions\/compile libudf yes yes file1.c file2.c file3.c , ,<br \/>;\/define\/user-defined\/use-built-in-compiler? yes<\/p>\n<p>\/define\/user-defined\/compiled-functions\/compile libudf yes yes conduct.c , ,<br \/>\/define\/user-defined\/compiled-functions\/load libudf<br \/>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<\/p>\n<p>;; Now use the compiled udf<br \/>;; in this case in materials<\/p>\n<p>; the comma immediately after &#8220;user-defined&#8221; takes the default thermal conductivity available from udf&nbsp;<br \/>; Insert your own keyword from your udf, whichever method you used.&nbsp;<br \/>\/define\/materials\/change-create air air yes constant 1.2 yes constant 994 yes user-defined , , , , , , ,<\/p>\n<p>; Here immediately after &nbsp;&#8220;user-defined&#8221; a word needs to be input, otherwise, the default may be used if a comma is not replaced with the routine.&nbsp;<br \/>\/define\/materials\/change-create aluminum solids yes constant 2660 yes constant 737 yes user-defined conduct_solid::libudf yes<\/p>\n<p>&nbsp;<\/p>\n<p>\/define\/models\/multiphase\/number-of-phases 2<br \/>\/define\/models\/multiphase\/eulerian no yes explicit , ,&nbsp;<br \/>\/define\/phases\/set-domain-properties change-phases-name solids air<br \/>\/define\/phases\/set-domain-properties phase-domains air material no<\/p>\n<p>\/define\/phases\/set-domain-properties phase-domains solids diam constant 0.0005<br \/>\/define\/phases\/set-domain-properties phase-domains solids granular yes<br \/>\/define\/phases\/set-domain-properties phase-domains solids granular-properties viscosity syamlal-obrien<br \/>\/define\/phases\/set-domain-properties phase-domains solids granular-properties bulk lun-et<br \/>\/define\/phases\/set-domain-properties phase-domains solids granular-properties granular-temperature constant 1e-5<\/p>\n<p>\/define\/phases\/set-domain-properties\/interaction-domains\/forces drag yes syamlal-obrien<br \/>\/define\/phases\/set-domain-properties\/interaction-domains\/heat-mass-reactions heat-coeff yes gunn<\/p>\n<p>\/define\/boundary-conditions velo-in v_uniform air yes yes no 0.25 no , &nbsp;, &nbsp;, &nbsp;, 293&nbsp;<br \/>\/define\/boundary-conditions velo-in v_uniform solids no no yes yes no 0 no 293 no 0<\/p>\n<p>\/define\/boundary-conditions velo-in v_jet air no no yes yes no 0.25 no 293 no 0<br \/>\/define\/boundary-conditions velo-in v_jet solids no no yes yes no 0 no 293 no 0<\/p>\n<p>&nbsp;<\/p>\n<p>\/define\/boundary-condition p-outlet poutlet air no 293<br \/>\/define\/boundary-conditions p-outlet poutlet solids no 293 yes no 0<\/p>\n<p>\/define\/boundary-conditions wall wall_hot solids , no , no yes temperature no 373 no no ,<\/p>\n<p>\/define\/boundary-conditions wall wall_hot air 0 no , no no no , no no ,<\/p>\n<p>;24=coupled 20=simple 21=simplec 22=piso&nbsp;<br \/>solve\/set\/p-v-coupling 24 no<\/p>\n<p>; turbulent dissipation rate, 0=first order upwind, 1=second order upwind 2=power law 4=quick 6=muscl<br \/>; for volume fraction 5=Modified Hric, 28=Compressive, 8=CICSAM, 16=Geo-Reconstruct<br \/>;\/solve\/set\/discretization-scheme epsilon 1<br \/>;\/solve\/set\/discretization-scheme k 1<br \/>\/solve\/set\/discretization-scheme pressure 1<br \/>\/solve\/set\/discretization-scheme momentum 1<br \/>\/solve\/set\/discretization-scheme temperature 4<br \/>\/solve\/set\/discretization-scheme mp 16 ;quick unavailable for fluent 22.2<\/p>\n<p>\/solve\/set\/p-v-controls 200 0.2 0.5<\/p>\n<p>\/define\/custom-field-functions\/define &#8220;t_mix&#8221; air_temperature * air_vof + solids_temperature * solids_vof<\/p>\n<p>\/define\/custom-field-functions\/define &#8220;k_mix&#8221; air_thermal_conductivity_lam * air_vof + solids_thermal_conductivity_lam * solids_vof<\/p>\n<p>\/define\/custom-field-functions\/define &#8220;avg_htc&#8221; -k_mix * (t_mix-373)\/(58.5*10^(-6))\/80<\/p>\n<p>\/surface\/point-surface y=0.24 0.28494 0.24<\/p>\n<p>\/solve\/report-definitions add surf-mon-1 surface-facetavg field mixture avg_htc surface-names y=0.24 , report-type surface-facetavg<br \/>q<\/p>\n<p>\/solve\/report-files\/add surf-mon-1-rfile file-name htc-024.out itr-index 1 name surf-mon-1-rfile report-defs surf-mon-1 , frequency 1<br \/>q<\/p>\n<p>\/mesh\/adapt\/cell-registers\/add region_0 type hex inside yes max 0.3 0.5 min 0 0<br \/>q<br \/>q<\/p>\n<p>\/solve\/initialize\/initialize-flow<br \/>\/solve\/patch\/solids , region_0 , mp no 0.598<br \/>q<\/p>\n<p>\/solve\/set\/transient-controls\/number-of-time-steps 12000<br \/>q<\/p>\n<p>\/solve\/set\/transient-controls\/max-iterations-per-time-step 50<br \/>q<\/p>\n<p>it 12000<\/p>\n<p>\/file\/write-case-data ,<\/p>\n<p>\/display\/objects\/create contour press-contour surfaces-list default-interior , field mixture pressure coloring banded contour-lines yes<\/p>\n<p>\/report\/surface-integrals\/area-weighted-avg wall_hot , solids temperature yes temp_wall_hot.srp<\/p>\n<p>&nbsp;<\/p>\n<p>\/display\/set\/contours\/filled-contours yes<br \/>\/display\/set\/picture\/driver png<br \/>\/display\/set\/picture\/landscape yes<br \/>\/display\/set\/picture\/use-window-resolution? no<br \/>\/display\/set\/picture\/x-resolution 1240<br \/>\/display\/set\/picture\/y-resolution 780<\/p>\n<p>\/plot\/residuals yes yes yes yes yes yes yes<br \/>\/display\/save-picture residuals%i.jpg<\/p>\n<p>\/display\/set\/lights\/headlight-on? no<br \/>\/display\/set\/lights\/lights-on? no<\/p>\n<p>\/display\/objects\/create contour press-contour surfaces-list default-interior , field mixture pressure coloring banded contour-lines yes<br \/>q<br \/>\/display\/objects\/add-to-graphics\/ press-contour<br \/>q<br \/>\/display\/objects\/edit press-contour color-map size 30 format &#8220;%0.4f&#8221;<br \/>q<\/p>\n<p>\/display\/set\/windows\/scale\/format &#8220;%0.4f&#8221;<br \/>\/display\/views\/restore-view front<br \/>\/display\/views\/auto-scale<br \/>\/display\/views\/camera\/zoom-camera 0.9<br \/>;\/display\/view\/camera\/roll-camera -90<\/p>\n<p>\/display save-picture press-contoursave%i.jpg<\/p>\n<p>\/report\/system\/time-stats<\/p>\n<p>\/report\/system\/proc-stats<\/p>\n<p>exit<br \/>OK<\/p>\n","protected":false},"template":"","class_list":["post-252504","topic","type-topic","status-closed","hentry","topic-tag-multiphaseudfevaporationdpmspeciestransportdefinesourcesourcetermeulerianlagrangian-1","topic-tag-batch-hpc","topic-tag-udf","topic-tag-udf-compilation"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["272220","13659","199"],"_bbp_author_ip":["23.220.96.181"]," _bbp_last_reply_id":["0"]," _bbp_likes_count":["0"],"_btv_view_count":["1775"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["252504"],"_bbp_forum_id":["27792"],"_bbp_engagement":["199","13659","272220"],"_bbp_voice_count":["3"],"_bbp_reply_count":["8"],"_bbp_last_reply_id":["253436"],"_bbp_last_active_id":["253436"],"_bbp_last_active_time":["2023-03-10 16:54:50"]},"test":"atul-singhsoton-ac-uk"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/252504","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\/252504\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=252504"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}