|
[Sponsors] |
August 5, 2010, 13:47 |
|
#21 |
Senior Member
Herman
Join Date: Nov 2009
Posts: 122
Rep Power: 17 |
Hi, give me some information about your problem. Do you have Boundary layer? Is you problem 3d? If yes, have you enabled deforming with remeshing for fluid around moving face and for face delimiting the volume of fluid that is moving?
|
|
August 24, 2010, 14:09 |
Help on my dynamic mesh simplified problem
|
#22 |
New Member
Akash Gupta
Join Date: Jul 2010
Posts: 15
Rep Power: 16 |
Hi enry,
I read your problem and the way you have solved. I have a similar problem on using dynamic mesh for moving solid-fluid interface. (negative cell volume after some time steps). I have also meshed my volume using cooper scheme. I have posted my problem yesterday on another thread as given below (image is also attached)- can you please help me out on what things i need to setup for moving the interface successfully. also, i am not worked with UDFs before so can you please share your UDF is possible here. I used the define_geom macro but i am not sure on that. Many thanks, akash ************************************************** ******** [IMG]file:///C:/Users/jasonhzy/AppData/Local/Temp/moz-screenshot.png[/IMG]Hi, I am trying to apply dynamic mesh in Fluent for the first time thereby seeking help. Project - The overall problem concerns multiphase wax deposition modeling in subsea pipeline where the pipe diameter shrinks because of wax clogging. This is oil and gas company project. Background - Hence, as a basic preliminary model consisting of single phase, it consists of a fluid and solid region , solid being the wall + wax deposit, I have developed a small computational domain where i have incorporated hydrodynamics, heat and species transport. Current problem help - I want to move the solid-liquid interface at some specific rate (for the simplest model case say by 10 mm in all in 500 time steps - my geometry domain height is 40 mm). So, how should i set up my dynamic mesh for moving this solid-fluid interface? My attempt - I created a pretty simple UDF which asks to move the solid-fluid interface y position by 0.5 mm each time step. I applied the deforming dynamic mesh zone to interface using layering scheme. Length scales were chosen equal to half the adjacent cell sizes ( 0.5 mm on fluid and 0.1 mm on solid zone side) But as i progress through 20 odd time steps (0.0005 second per step), i get the negative cell volume error. I see from the mesh that once my interface cells reach the first fluid zone cell, the program gives negative cell volume error. I believe there is something fundamentally wrong - probably in UDF itself or dynamic mesh setup. So, please help. I have not worked with UDFs before. Based on what little i know and what i have tried, these are some queries -
|
|
August 25, 2010, 11:39 |
|
#23 |
Senior Member
Herman
Join Date: Nov 2009
Posts: 122
Rep Power: 17 |
Hi Akash, here is UDF. It should work well, control if I forget some initialization:
#include"udf.h" DEFINE_GRID_MOTION(delta,domain,dt,time,dtime) { Thread *tf = DT_THREAD(dt); face_t f; Node *v; real delta; real NV_VEC(axis); NV_D(axis, =, 0.0, 1.0, 0.0); /* y vector */ begin_f_loop(f,tf) { f_node_loop(f,tf,n) { v = F_NODE(f,tf,n); /* update node if the current node has not been previously visited when looping through previous faces */ if ( NODE_POS_NEED_UPDATE (v)) { /* indicate that node position has been update so that it's not updated more than once */ NODE_POS_UPDATED(v); delta = your value ; NV_V_VS(NODE_COORD(v), =, NODE_COORD(v), +, axis,*,delta); } } } end_f_loop(f,tf); } Try with the following set-up: -build and load UDF as COMPILED; -verify the absence of errors. As command line (or GUI): -define models steady yes -define models dynamic-mesh-controls remeshing yes -define models dynamic-mesh-controls smoothing-parameter spring-on-all-shapes yes -define models dynamic-mesh-controls smoothing-parameter constant-factor 0 -define models dynamic-mesh-controls smoothing-parameter bnd-node-relaxation 1 -define models dynamic-mesh-controls smoothing-parameter max-iter 500 -define models dynamic-mesh-controls smoothing-parameter convergence-tolerance 0.0001 For the dynamic zone, try: - UDF for moving surface - DEFORMING for fluid around it with SMOOTHING,and trying also with REMESHING (or not, try...) - DEFORMING for lateral fluid faces (with smoothing and remeshing) Try and tell me if it works.Bye. |
|
August 25, 2010, 12:21 |
|
#24 |
New Member
Akash Gupta
Join Date: Jul 2010
Posts: 15
Rep Power: 16 |
hey Enry,
Thanks a lot for your reply. Before getting your reply, I was able to correct the error in my simulation using a different approach but I want to ask if i am doing right. Earlier , I was using a DEFINE_GEOM macro and then i switched to CG_MOTION macro. The negative cell volume error disappeared and mesh seem to work fine. But, I am not very clear on the fundamental differences of these macros. And probably they don't matter in this simplest case of moving the planar interface with a given rate. The UDF you have sent seems more practical when i work on the actual complex geometry. In my actual problem, each of the nodes of the interface is moving with a different rate (solidification at different rate at different places in the pipe wall). I will try to solve my simplified problem again using the UDF by you and post the results. Please tell me if i am not wrong that CG_MOTION macro cannot be applied in that case and GRID_MOTION macro as given by you is much more suitable. One more thing, can you please tell me how to extract some variables from a case file and write to a output file. Also, how can i read some parameters into a case file. Many thanks, Akash |
|
August 26, 2010, 08:33 |
|
#25 |
Senior Member
Herman
Join Date: Nov 2009
Posts: 122
Rep Power: 17 |
Hi Akash, I used DEFINE_GRID_MOTION because my delta depends on geometry position, and so geometry movement is not a CG translation. I think that CG_MOTION macro work well and simpler if you have only to translate CG interface. In UDF I posted there isn't the dependence on time, but if you want you can move the interface depending on dt (dt is simply an available variable... however take a look on UDF manual, there is some examples) , and also move the interface depending on position of the interface itself.
About your questions: form .cas file you can only read all the variable at the last time step ( or iteration if steady simulation). It depends on what variable do you need. For example all the force could be written through GUI. What do you mean saying: Also, how can i read some parameters into a case file. ? Regards. Herman. |
|
August 26, 2010, 12:37 |
|
#26 |
New Member
Akash Gupta
Join Date: Jul 2010
Posts: 15
Rep Power: 16 |
Hello Enry,
thank you for your reply. The UDF you posted for grid motion worked nicely for moving my interface in planar motion. I used delta value of 0.00001 per time step to specify the y-velocity. now, i have achieved that, i want to exactly do what you have mentioned in your last reply. I want to specify y-velocity of interface which is dependent of the coordinate of the interface and this function applies for certain time. in brief, my function is Vy = -a*Z*(Z-0.48) for t < 5seconds where Z is the length coordinate of the interface and a is a constant value. can you please tell me how to specify that in the grid motion UDF. Also, regarding my question accessing the variables, I want to access the species transport flux coming to the interface and output it to output window as well as write it to a separate text file. (later on , this interface flux will act as an input for another UDF.) Will DEFINE_RW_FILE do that and how? I am not able to find the access variable for mass transport flux for a particular species. thank you, akash |
|
August 29, 2010, 13:25 |
|
#27 |
New Member
Akash Gupta
Join Date: Jul 2010
Posts: 15
Rep Power: 16 |
Hello Enry,
I tried to implement the velocity function as mentioned in my earlier mail. I was able to move the interface but there were some problems with the remeshing. I am attaching the image for your reference. As you can see, when i move the interface, the cells on the solid side get separated from the interface with each advancement of time step. There is proper remeshing on the fluid side as interface moves upwards. Can you please look at it and let me know what is wrong? Other parameters - Interface & Interface Shadow - UDF applied with Fluid side cell size 0.001 m and solid side cell size 0.00025 m (half of mesh cell element sizes on each side) Layering with ratio as well as height based method tried Smoothing enabled -default options Re meshing enabled - tried with and without sizing function Below is the UDF used - (basically a slight modified version of yours one) #include"udf.h" DEFINE_GRID_MOTION(planemove5,domain,dt,time,dtime ) { Thread *tf = DT_THREAD(dt); face_t f; Node *v; real a; real NV_VEC(axis),NV_VEC(dv); int n; NV_D(axis, =, 0.0, 1.0, 0.0); /* y vector */ begin_f_loop(f,tf) { f_node_loop(f,tf,n) { v = F_NODE(f,tf,n); /* update node if the current node has not been previously visited when looping through previous faces */ if ( NODE_POS_NEED_UPDATE (v)) { /* indicate that node position has been update so that it's not updated more than once */ NODE_POS_UPDATED(v); a = -.000173611; dv[1] = a*NODE_Z(v)*(NODE_Z(v) - 0.48); NV_V(NODE_COORD(v), +=, dv); } } } end_f_loop(f,tf); } Appreciate your help. thanks a lot, Akash |
|
August 29, 2010, 18:51 |
|
#28 |
Member
Join Date: Jun 2009
Posts: 31
Rep Power: 17 |
You can also play around with the dynamic mesh parameters to see if that gives you a better result. And if this doesn't work reduce even more your time step.
|
|
August 29, 2010, 18:55 |
|
#29 |
New Member
Akash Gupta
Join Date: Jul 2010
Posts: 15
Rep Power: 16 |
Hello mrestrepo30,
Thank you for your reply. Well, i tried changing various dynamic mesh parameters as well as changing time step from 0.01 to 0.002 but all of these modifications didnt help in the shown mesh movement. Since, i am applying the node movement to only the nodes of the interface and not the cells connected, is this causing a problem for splitting the solid domain cells. I am not very clear on the dynamics layering approach. Somehow, the cells dont split when the interface move upwards. Looking forward for your comment and suggestion on this. akash |
|
August 30, 2010, 09:36 |
|
#30 |
Member
Join Date: Jun 2009
Posts: 31
Rep Power: 17 |
I am also applying node displacement to certain zones using a UDF. Then what I do is that I set up the rest of the zones as "Deforming" in the dynamic mesh zones. Are you also doing this?
|
|
August 30, 2010, 14:25 |
|
#31 |
Senior Member
Herman
Join Date: Nov 2009
Posts: 122
Rep Power: 17 |
Hi akash, sorry for my delay. Have u you solved your problem?
As I can understand from your picture, you have 2 different meshed zone, one fluid and one solid, isn't it? If it's true, you have to disable re-meshing on the "fluid" adjacent the moving interface, and enable re-meshing on the "fluid" connected to the fluid adjacent to the moving interface. For example, if you have a simple oscillating airfoil with boundary layer, you have to create a zone fluid for the boundary layer and apply the re-meshing to all fluid except the boundary layer ( fluid connected to the moving surface). You have to follow the same instruction for the surface surrounding the fluid. I hope that my advice can help you. Bye. Enry. |
|
August 30, 2010, 18:43 |
|
#32 |
New Member
Akash Gupta
Join Date: Jul 2010
Posts: 15
Rep Power: 16 |
Hello Enry,
Thank you very much for your reply. The help and suggestion from you until now have been very valuable for me in approaching my problem. I have not been able to still solve the meshing problem. You are correct in interpreting the image - the bottom one is the solid zone and the top one is the fluid zone and i am moving the solid-fluid interface. I was not able to understand your suggestion so I am highlighting what I do in dynamic mesh setting. I create dynamic mesh zones for interface and interface shadow. I use user-defined option and subsequently choose the compiled UDF among the four options. Then I Put adjacent fluid and solid cell sizes equal to half the mesh cell size in each respective domains. In terms of main dynamic zone options, I check mark Layering with ratio based scheme (tried with height based too but no difference noticed) and then preview the mesh motion. I have attempted the re meshing and smoothing options in dynamic mesh menu with different parameters along with the above mentioned zones. Now, as you mentioned, is something wrong with my layering and cell size specifications. OR the reason is (which i believe is more probable) that Do I need to create more dynamic zones out of fluid /default interior /solid/ solid interior and what kind of zone should they be? I tried with fluid and setting it to deforming with minimum length scale 1 m (much larger than my mesh domain) and max length scale 0 m. But this didn't made any difference. I wasn't able to understand your reply and that's why again requesting to further clarification. If you want more information on my procedure , i can post screen shots of what i do. Thanks a lot, Akash |
|
August 31, 2010, 05:19 |
|
#33 |
Senior Member
Herman
Join Date: Nov 2009
Posts: 122
Rep Power: 17 |
Sorry, I believed that you moved both interface and solid.
Your approach seems to be good... A question: before the corruption of your mesh, does the mesh move all together ? Or is only the first cell adjacent to interface that follow the interface? If the mesh is moving all together before corruption, I think that you should change constant factor, boundary node relaxation, max iteration and convergence tolerance. If only the first cell is moving with the interface, your set up is wrong. Let me know. Bye. |
|
August 31, 2010, 14:36 |
|
#34 |
New Member
Akash Gupta
Join Date: Jul 2010
Posts: 15
Rep Power: 16 |
Hello,
I think only the first cell is moving with the interface. That's why when interface moves, the size of cell attached to the interface increases in size on the solid domain side. On the fluid size, sine the cell is shrinking, eventually the layer collapses. But the problem persists and grows on the solid side. So, my setup is wrong. What can i do to make it right? I saw that when i was using a simple planar movement velocity condition in CG_MOTION as well as in GRID_MOTION macro, the layers were properly moving and splitting and collapsing. But when i use the parabolic velocity function profile in my GRID_MOTION macro, the cell size attached to the interface increases continuously without splitting. So, what should be correct form of setup for this. Please help. Also, one other query - Later on in the project, I want to access cell and face temperature and gradient vector values on which i will apply some equations and finally, that will determine my node movement in GRID_Motion (instead of current velocity function). So, how can i use cell values to update node movement? Thanks, Akash Last edited by akash.iitb; August 31, 2010 at 17:49. |
|
September 1, 2010, 05:21 |
|
#35 |
Senior Member
Herman
Join Date: Nov 2009
Posts: 122
Rep Power: 17 |
Hi Akash,
I think that there is no difference in set-up between CG_MOTION and GRID_MOTION macro... I suggest to build a simpler domain, like a simple box with moving interface, with the same fluid, with a simple planar movement, and try to move it. I think it's better,easier and faster. Have you setting up the motion conditions also to the face surrounding the fluid? About your second question, I never access the face and cell temperature. Take a look to the UDF manual, I'm sure that there is the answer to your question, or search in the forum. Bye. |
|
September 3, 2010, 17:53 |
|
#36 |
New Member
Akash Gupta
Join Date: Jul 2010
Posts: 15
Rep Power: 16 |
Hi Enry,
Sorry for the late reply on your post. Well, I have worked earlier on precisely what you have suggested. My first attempt was to build a simple box with fluid (0.04 m height) and solid (0.01 m height) as the computational domain (this can be considered as a small section portion of 3d pipe). This had the fluid dynamics, heat transfer and species transport models activated with moving solid-liquid interface. My first UDF attempt was to realize planar movement of the interface which i did both using CG_Motion and GRID_MOTION macro with layering enabled (Ratio based with 0.2 as split and collapse factors; no smoothing and remeshing). The attached image shows the mesh movement in the planar case successfully. However, when i used the parabolic velocity function for the movement profile as described by the UDF (shown below), i had the problem with the splitting with the mesh layers at the solid-liquid interface which I had told earlier too. I hope this gives you better idea about my approach and the root of the problem faced. I am not being able to figure out whether the problem is in the way parabolic profile in UDF is written or in setting of dynamic mesh zones. The UDF provided by you as well as example in UDF manual loops over nodes to update the velocity (or any function). Later when I will be using functions over faces or cells (like Define or adjust macros) for further operations, how can that information be transmitted to node movements. This is one of my doubts and primary reason for my second question in the previous post. Is there a way that i can write a grid_motion_macro looping over faces/cells only and defining movements in terms of faces/cells rather nodes? Please let me know on this if you ever done or seen such a UDF. Appreciate your help. Akash ************************************************** ** #include"udf.h" DEFINE_GRID_MOTION(planemove5,domain,dt,time,dtime ) { Thread *tf = DT_THREAD(dt); face_t f; Node *v; real a; real NV_VEC(axis),NV_VEC(dv),NV_VEC(dv2); int n; real zcor; NV_D(axis, =, 0.0, 1.0, 0.0); /* y vector */ begin_f_loop(f,tf) { f_node_loop(f,tf,n) { v = F_NODE(f,tf,n); /* update node if the current node has not been previously visited when looping through previous faces */ if ( NODE_POS_NEED_UPDATE (v)) { /* indicate that node position has been update so that it's not updated more than once */ NODE_POS_UPDATED(v); a = -.000173611; zcor = NODE_Z(v); /* dv2 used for planar movement */ dv2[1] = 0.0001; /* dv1 used for parabolic movement */ dv[1] = a*NODE_Z(v)*(NODE_Z(v) - 0.48); /* just replacing dv2 and dv for different movements */ NV_V(NODE_COORD(v), +=, dv); } } } end_f_loop(f,tf); } Last edited by akash.iitb; September 7, 2010 at 14:57. |
|
September 10, 2010, 02:01 |
|
#37 |
New Member
Akash Gupta
Join Date: Jul 2010
Posts: 15
Rep Power: 16 |
Hi Enry,
Sorry to bother you again with the same post but I am kind of stuck at this juncture and I believe your suggestion can be of great help for me to tackle this problem. As you suggested in earlier post, I have worked on precisely what you have suggested. My first attempt was to build a simple box with fluid (0.04 m height) and solid (0.01 m height) as the computational domain (this can be considered as a small section portion of 3d pipe). This had the fluid dynamics, heat transfer and species transport models activated with moving solid-liquid interface. My first UDF attempt was to realize planar movement of the interface which i did both using CG_Motion and GRID_MOTION macro with layering enabled (Ratio based with 0.2 as split and collapse factors; no smoothing and remeshing). However, when i used the parabolic velocity function for the movement profile as described by the UDF (shown below), i had the problem with the splitting with the mesh layers at the solid-liquid interface which I had told earlier too. I hope this gives you better idea about my approach and the root of the problem faced. I am not being able to figure out whether the problem is in the way parabolic profile in UDF is written or in setting of dynamic mesh menu options. The UDF provided by you as well as example in UDF manual loops over nodes to update the velocity (or any function). Later when I will be using functions over faces or cells (like Define or adjust macros) for further operations, how can that information be transmitted to node movements. This is one of my doubts and primary reason for my second question in the previous post. Is there a way that i can write a grid_motion_macro looping over faces/cells only and defining movements in terms of faces/cells rather nodes? Please let me know on this if you ever done or seen such a UDF. Really appreciate your help. thanks Akash ************************************************** ** #include"udf.h" DEFINE_GRID_MOTION(planemove5,domain,dt,time,dtime ) { Thread *tf = DT_THREAD(dt); face_t f; Node *v; real a; real NV_VEC(axis),NV_VEC(dv),NV_VEC(dv2); int n; real zcor; NV_D(axis, =, 0.0, 1.0, 0.0); /* y vector */ begin_f_loop(f,tf) { f_node_loop(f,tf,n) { v = F_NODE(f,tf,n); /* update node if the current node has not been previously visited when looping through previous faces */ if ( NODE_POS_NEED_UPDATE (v)) { /* indicate that node position has been update so that it's not updated more than once */ NODE_POS_UPDATED(v); a = -.000173611; zcor = NODE_Z(v); /* dv2 used for planar movement */ dv2[1] = 0.0001; /* dv1 used for parabolic movement */ dv[1] = a*NODE_Z(v)*(NODE_Z(v) - 0.48); /* just replacing dv2 and dv for different movements */ NV_V(NODE_COORD(v), +=, dv); } } } end_f_loop(f,tf); } |
|
September 14, 2010, 05:16 |
|
#38 |
Senior Member
Herman
Join Date: Nov 2009
Posts: 122
Rep Power: 17 |
Hi Akash, sorry for my delay. I was on holiday for 2 weeks .
Well, I send to you a box.zip file in which there is what I can do with GRID_MOTION. There is a simple example of moving surface with parabolic motion. There are 2 fluent journal, one for fluent 6.3.26 and the other for fluent 12. I have fluent 6.3.26 but I know the setting for fluent 12, so I write also a journal for fluent 12. I have just run journal file of fluent 6.3.26 and it works. Run the fluent.jou file, move the grid with solve mesh-motion yes command and then look at the grid. About your question: Is there a way that i can write a grid_motion_macro looping over faces/cells only and defining movements in terms of faces/cells rather nodes? I think that there is a way to do it, but I never work on it. I hope that my simple example can help you. bye Last edited by enry; July 30, 2011 at 19:34. |
|
September 14, 2010, 05:19 |
|
#39 |
Senior Member
Herman
Join Date: Nov 2009
Posts: 122
Rep Power: 17 |
PS. I work on Ubuntu. If you use Windows, the command is the same, but I think that you should re-write the journal that I send to you because the "hyphen" is different between linux and windows.
Bye. |
|
September 14, 2010, 13:22 |
|
#40 |
New Member
Akash Gupta
Join Date: Jul 2010
Posts: 15
Rep Power: 16 |
Hello Enry,
Thank you very much for your reply. Hope your vacation has been good.You have gone to a lot of trouble to help me and I really appreciate that. I ran the journal file sent by you on Fluent 12 and it ran perfectly. I would like to mention some points -
If you get time, please have a look at these files to check what I am doing wrong and let me know. Thank you very much for all your help and support. Akash P.S. - These files are created in Fluent 12 as I dont use Journal files. IIf you cannot access these files, please let me know. I will redo them using journal file and send to you either on your email if you like or upload them on third party website. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dynamic Mesh Problem. | Tom Clark | FLUENT | 10 | June 21, 2021 05:27 |
Dynamic Mesh on Pintle type injector. | herntan | FLUENT | 16 | September 4, 2020 09:27 |
[ICEM] Generating Mesh for STL Car in Windtunnel Simulation | tommymoose | ANSYS Meshing & Geometry | 48 | April 15, 2013 05:24 |
Negative Volume Mesh | MANOJKUMAR | FLUENT | 8 | April 7, 2009 10:50 |
FSI & Negative Volume Mesh | Mojtaba | CFX | 1 | October 13, 2008 08:13 |