You are on page 1of 8

[Sponsors]

Home News Index Post News Subscribe/Unsubscribe Forums Main CFD Forum System Analysis Structural Mechanics Electromagnetics CFD Freelancers Hardware Forum Lounge Software User Forums ANSYS CFX FLUENT Meshing & Geometry Autodesk AVL FIRE CD-adapco STAR-CCM+ STAR-CD Exa FloEFD & FloTHERM FLOW-3D NUMECA OpenFOAM News & Announcements Installation Meshing Pre-Processing Solving Post-Processing Programming Verification & Validation Bugs Phoenics SU2 News & Announcements Installation Shape Design Pre-processors ANSA enGrid GridPro Pointwise Post-Processors EnSight FieldView ParaView Tecplot Special Topics Mesh Generation Visualization CFD Online Community Site News Site Help & Discussions CFD-Wiki Wiki Introduction Recent Changes

Recent Changes Reference Section Fluid Dynamics Turbulence Modeling Numerical Methods Meshing Special Topics Aero-Acoustics Combustion Parallel Computing Turbulence Application Areas Aerospace Automotive Turbomachinery Best Practice Guides Automotive CFD Turbomachiney CFD Heat Transfer CFD Validation Cases Codes Source Code Archive FAQ's Ansys CD-adapco Fluent Numeca History of CFD About CFD-Wiki Help FAQ Getting Started Community Portal Donate Texts Donated Texts Links What's New Introduction Modeling & Numerics Turbulence Combustion Discretization Schemes Solvers Multigrid Methods Finite Element Methods Cartesian Methods / AMR Numerial Analysis Mesh Generation General Resources Selected Projects Companies Programming & Dev. Data Formats Software Libraries Numerical Software Parallel Computing General Sites Software Fluid Dynamics Mesh Generation Visualization Commercial CFD Codes Hardware Benchmarks News and Reviews Hardware Vendors Clusters GPGPU

Misc References Validation Cases Airfoils Material Properties Glossaries Finding Documents Preprints Online Papers & Reports Books Journals Publishers Online Tools Unit Converters Calculators y+ Estimation Compressible Flow Heat Transfer Airfoil Generators Simple Cases Combustion Cycles & Processes Online Books & Guides CFD Introductions Books Best Practice Guidelines Fluid & Aero Dynamics Seminars Encyclopedias Social Media Discussion Forums Blogs Twitter YouTube Facebook LinkedIn Usenet Newsgroups Mailing Lists Chats News Education CFD Programmes Online Labs Online Courses Course Material Jobs CFD Job Resources Companies & Orgs. General Resources Events Event Calendars Specific Organizations Vendor Events Lists Misc Pictures and Movies Fun Links to Links Suggest New Link About this Section Jobs Post Job Ad List All Jobs List Jobs by Type Job in Industry (95) Job in Academia (26) Contract Work (10) PostDoc Position (41)

PhD Studentship (42) Diploma Work (5) Summer Job (1) List Jobs by Location * None * * None * (1) Africa South Africa (1) Asia China (6) Hong Kong (4) India (14) Israel (1) Japan (2) Singapore (4) South Korea (4) Taiwan (1) United Arab Emirates (1) Europe Austria (2) Belgium (8) Denmark (1) France (11) Germany (21) Greece (1) Ireland (1) Italy (1) Luxembourg (3) Netherlands (4) Norway (1) Russian Federation (10) Spain (1) Sweden (1) Switzerland (3) United Kingdom (30) North America Canada (10) United States (69) Oceania Australia (2) South America Brazil (1) Search Job Ads Books Browse Categories Search Submit a Book Help Events Post New Event List All Events List Events by Type Conferences (19) Workshops (4) Courses (5) Seminars (2) User Conferences (2) Online Events (7) List Events by Location Africa Egypt (1) South Africa (1) Asia China (1) Japan (1) Pakistan (1) Singapore (1)

South Korea (1) Europe Austria (1) Belgium (3) Croatia (1) Czech Republic (2) France (2) Germany (6) Greece (3) Netherlands (1) Slovenia (1) Spain (1) Sweden (2) United Kingdom (2) North America United States (3) South America Argentina (2) Tools RPN Calculator Scientific Calculator Unit Conversion Y+ Estimation Turbulence Properties Feeds News Blogs Vendors Jobs Journals About About CFD Online Contacts & Feedback Web Server Statistics List of Sponsors Advertising on this Site Search Home > Forums > Fluent UDF and Scheme Programming User Name Password

lagrange gun UDF


Register Blogs Community

User Name

Remember Me

New Posts

Updated Threads

Search

LinkBack January 16, 2013, 00:04 aydinkabir88 New Member mehdi Join Date: Jan 2013 Posts: 3 Rep Power: 2 lagrange gun UDF

Thread Tools

Display Modes #1

I want to simulate a piston which move on the differential pressure force acting on its two surfaces. The UDF tha I use is: /************************************************** ********** * 1-degree of freedom equation of motion (x-direction) * compiled UDF ************************************************** **********/ #include "udf.h" static real v_prev = 0.0; DEFINE_CG_MOTION(piston,dt,vel,omega,time,dtime) { Thread *t; face_t f; real NV_VEC(A);

real force, dv; /* reset velocities */ NV_S(vel, =, 0.0); NV_S(omega, =, 0.0); if (!Data_Valid_P()) return; /* get the thread pointer for which this motion is defined */ t = DT_THREAD(dt); /* compute pressure force on body by looping through all faces */ force = 0.0; begin_f_loop(f,t) { F_AREA(A,f,t); force += F_P(f,t) * NV_MAG(A); } end_f_loop(f,t) /* compute change in velocity, i.e., dv = F * dt / mass velocity update using explicit Euler formula */ dv = dtime * force / 50.0; v_prev += dv; Message ("time = %f, x_vel = %f, force = %f\n", time, v_prev, force); /* set x-component of velocity */ vel[0] = v_prev; } But it doesn't work. would you please help me? thanks. Attached Images piston.JPG (59.0 KB, 10 views)

January 21, 2013, 08:42 Marion Senior Member Marion Join Date: Jul 2012 Location: France Posts: 122 Rep Power: 4 Hi,

#2

Why don't you use the "Compute_Force_And_Moment" function for the calculation of the force? I've seen it in the 6DOF examples of the tutorials. Marion.

January 22, 2013, 08:40 syavash Senior Quote:

#3

Senior Member Syavash Join Date: Apr 2010 Posts: 142 Rep Power: 5

Originally Posted by Marion Hi, Why don't you use the "Compute_Force_And_Moment" function for the calculation of the force? I've seen it in the 6DOF examples of the tutorials. Marion. Dear Marion, What tutorial exactly do you refer?! I can't find it among Fluent tutorials. If you'd have such tutorial would you please send it to me?! Me E-mail is syavash_azna@yahoo.com Thank you

January 23, 2013, 00:05 aydinkabir88 New Member mehdi Join Date: Jan 2013 Posts: 3 Rep Power: 2 Quote: Originally Posted by Marion Hi, Why don't you use the "Compute_Force_And_Moment" function for the calculation of the force? I've seen it in the 6DOF examples of the tutorials. Marion.

#4

Dear Marion Would you please send me that axample? aydinkabir88@gmail.com thanks in advance.

January 23, 2013, 14:32 ghost82 Senior Member Quote: Originally Posted by aydinkabir88 Dear Marion Would you please send me that axample? aydinkabir88@gmail.com thanks in advance.

#5

Daniele Join Date: Oct 2010 Location: Italy Posts: 326

Hi, I think you can refer to tutorial 'Projectile Moving Inside a Barrel'; search the pdf on google. This is the same approach I proposed to you in private message. Daniele

Posts: 326 Rep Power: 10

Previous Thread | Next Thread Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Trackbacks are On Pingbacks are On Refbacks are On Forum Rules Similar Threads Thread Source Term UDF VS Porous Media Model Thread Starter pchoopanya Forum Fluent UDF and Scheme Programming Replies 1 Last Post August 28, 2013 06:12 January 16, 2012 22:14 October 26, 2011 21:38 December 2, 2009 00:27 November 25, 2002 04:03

UDF parallel error: chipexec: function not shankara.2 found????? How to add a UDF to a compiled UDF library kim

Fluent UDF and Scheme Programming

FLUENT

Dynamic Mesh UDF

Qureshi

FLUENT

UDF...UDF...UDF...UDF Luc SEMINEL

FLUENT

All times are GMT -4. The time now is 10:55. Contact Us - CFD Online - Top CFD Online