|
[Sponsors] |
April 24, 2018, 17:41 |
sinus translation of 2D zone
|
#1 |
New Member
Casey
Join Date: Apr 2018
Posts: 4
Rep Power: 8 |
I think I have a very simple request, I would like a particular edge in my 2D simulation to oscillate back and forth along the X axis with a specified magnitude and frequency. I made the edge it's own zone and specified rigid body motion and set the adjacent edges to deform.
I'm trying to accomplish this with the 6DOF solver since i've found more examples to look off, but it seems like a UDF specifying the motion or a profile would be easier and more simple then specifying a periodic force and letting the 6DOF solver determine the motion. Any advice for any of these solutions would be very much appreciated. Currently I'm trying to adapt the script shown in the piston and reed valve tutorial (https://youtu.be/BuA6uI2tWuA) Code:
#include "udf.h" #include "math.h" DEFINE_SDOF_PROPERTIES(fin1_6dof, prop, dt, time, dtime) { prop[SDOF_MASS] = 0.01; prop[SDOF_IZZ] = 1e-4; prop[SDOF_ZERO_TRANS_X] = False; prop[SDOF_ZERO_TRANS_Y] = TRUE; prop[SDOF_ZERO_TRANS_Z] = TRUE; prop[SDOF_ZERO_ROT_X] = TRUE; prop[SDOF_ZERO_ROT_Y] = TRUE; prop[SDOF_ZERO_ROT_Z] = TRUE; prop[SDOF_LOAD_F_X] = .001* sin( 3800 * time ); Message("\n 2d : Updated 6DOF properties %e,Fx,%e\n", prop[SDOF_LOAD_F_X], prop[SDOF_MASS]); } I'm not well experienced in fluent and especially in C programming so I greatly appreciate as much detail in your response as you are able to give. |
|
April 24, 2018, 18:13 |
|
#2 | ||
New Member
Casey
Join Date: Apr 2018
Posts: 4
Rep Power: 8 |
I've also been trying to compile a CG_motion UDF but I must be making a mistake. I'm following this process:
1) Define > User-Defined > Functions > Manage... 2) Select existing library and click "Unload" 3) Define > User-Defined > Functions > Compiled... 4) Click "Add..." if there are other source files required (Fluent reads in a new version of the file regardless of whether or not you delete then add the same source file) 5) Build then Load with this function Code:
#include "udf.h" DEFINE_CG_MOTION(fin_1_motion, dt, vel, omega, time, dtime) { real a, w, pi; pi = 3.1415; /* define motion variables */ a = 0.2; /* 0.05m movement amplitude */ w = 2 * pi * 3700; /* 2Hz frequency */ /* define object movement law */ vel[0] = 0; vel[1] = -a * w * sin(w*time); vel[2] = 0; } Quote:
Quote:
|
|||
April 24, 2018, 19:34 |
|
#3 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
error
Code:
(chdir "H:\2D Vibration\Simulation_files\dp0\FFF\Fluent\libudf") (chdir "win64\2ddp")'nmake' is not recognized as an internal or external command, operable program or batch file. you may find detailed information here https://www.cfd-online.com/Wiki/Fluent_FAQ best regards |
|
April 24, 2018, 23:06 |
|
#4 |
New Member
Casey
Join Date: Apr 2018
Posts: 4
Rep Power: 8 |
I've installed both VS 2017 Express and Community (Im using Ansys 17.1) and both throw errors about missing files when I attempt to "Build" the library in Fluent. First it was stdio.h which isn't included in either VS distribution, so I removed it from the fluent file that was calling it, next is stdarg.h, which is present, and the path variable is declared correctly (I can execute it from the cmd.exe without CD), but fluent still says that it cannot find it. If I remove the reference (line 57 in dll.h) it causes other errors with the syntax so I think it's important.
Don't know what to do at this point ... |
|
April 25, 2018, 06:00 |
|
#5 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
read manual
you should start fluent from console to be able to compile best regards |
|
April 26, 2018, 00:24 |
|
#6 |
New Member
Casey
Join Date: Apr 2018
Posts: 4
Rep Power: 8 |
Thanks Alexander, with your help I was able to get the udf compiled and loaded correctly.
It doesn't seem to do anything though. I'm out of time so this will likely be my last request for help. perhaps there is something fundamentally wrong with what I want to do. This is my udf: Code:
#include "udf.h" DEFINE_CG_MOTION(fin_1_motion, dt, vel, omega, time, dtime) { real a, w, pi; pi = 3.1415; /* define motion variables */ a = 0.001; /* 0.001m movement amplitude */ w = 3700; /* 3700 Hz frequency - 1.7ms Period */ /* define object movement law */ vel[0] = ( a / w )* sin(w*time); vel[1] = 0; vel[2] = 0; } When I apply it as the Motion UDF/Profile for Rigid Body Motion in the Dynamic Meshing window and then go to "display Zone Motion" It doesn't seem to do anything. If you look at the attached picture of my 2D model, the UDF is applied to the horizontal edge at the tip of the fin. The sides of the fin are specified as deforming mesh zones. The Dynamic mesh is set to use smoothing and remeshing and the mesh is made of all triangular elements. If you have any advice to make it work, it would make a world of difference to me. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Commercial meshers] Mesh conversion problem (fluent3DMeshToFoam) | Aadhavan | OpenFOAM Meshing & Mesh Conversion | 2 | March 8, 2018 02:47 |
Possible Bug in pimpleFoam (or createPatch) (or fluent3DMeshToFoam) | cfdonline2mohsen | OpenFOAM | 3 | October 21, 2013 10:28 |
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem | Attesz | OpenFOAM Meshing & Mesh Conversion | 12 | May 2, 2013 11:52 |
Problem in running ICEM grid in Openfoam | Tarak | OpenFOAM | 6 | September 9, 2011 18:51 |
Problem in IMPORT of ICEM input file in FLUENT | csvirume | FLUENT | 2 | September 9, 2009 02:08 |