Problems with 3 degrees of rotation

 Register Blogs Members List Search Today's Posts Mark Forums Read

 April 20, 2007, 03:43 Anyone any ideas how to solve #1 Senior Member   Frank Bos Join Date: Mar 2009 Location: The Netherlands Posts: 340 Rep Power: 11 Anyone any ideas how to solve this basic problem? Frank __________________ Frank Bos

 April 25, 2007, 08:03 Hi everybody, Concerning th #2 Senior Member   Frank Bos Join Date: Mar 2009 Location: The Netherlands Posts: 340 Rep Power: 11 Hi everybody, Concerning the movement of a patch in the code, is there a way to specify directly the point locations instead of using the velocity motionU like this: fixedValueTetPolyPatchVectorField& motionUBodyPatch = refCast ( motionU.boundaryField()[bodyPatchID_] ); motionUBodyPatch == ( rot )/time().deltaT().value(); In other words, I like to read boundary point locations from a file and then replace the oldPoints on the boundary with these newPoints. Any ideas how to achieve this, any examples? Regards, Frank __________________ Frank Bos

 April 25, 2007, 08:25 Sorry, can't say I have. Very #3 Member     Eric Lillberg Join Date: Mar 2009 Location: Stockholm Posts: 80 Rep Power: 10 Sorry, can't say I have. Very interesting topic though, what kind of modelling did you have in mind for the bubbles? Regards Eric

 April 25, 2007, 08:27 Sorry! The last message is #4 Member     Eric Lillberg Join Date: Mar 2009 Location: Stockholm Posts: 80 Rep Power: 10 Sorry! The last message is obsolete and ended up the wrong thread //Eric

 April 25, 2007, 08:45 bPoints from file pointVect #5 Member     Eric Lillberg Join Date: Mar 2009 Location: Stockholm Posts: 80 Rep Power: 10 bPoints from file pointVectorField newPoints(mesh.points()) newPoints.boundaryField()[movingPatchID]=bPoints; You need to move the rest of the mesh accordingly forAll(newPoints, pointI) { Given body rigid motion calculate the rotation refering to center of motion. } mesh.movePoints(newPoints) /Eric

 April 25, 2007, 10:46 Not like that: if you do newPo #6 Senior Member   Hrvoje Jasak Join Date: Mar 2009 Location: London, England Posts: 1,803 Rep Power: 24 Not like that: if you do newPoints[i].x(), OpenFOAM will make a copy of the x-component and return a scalarField. First make a vectorField out of the stuff from the file and then do the "=". Hrv __________________ Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk

 April 26, 2007, 04:59 Mmm, Hrvoje, I still don't get #7 Senior Member   Frank Bos Join Date: Mar 2009 Location: The Netherlands Posts: 340 Rep Power: 11 Mmm, Hrvoje, I still don't get it to work. Ignoring the reading from file (this will replace the initialPoints...) stuff I have the following: ================================================ pointField initialPoints = mesh.boundaryMesh()[patchI].localPoints(); for (runTime++; !runTime.end(); runTime++) { pointField newPoints = mesh.boundaryMesh()[patchI].localPoints(); forAll(newPoints, i) { newPoints[i] = initialPoints[i]*runTime.time().value() //just some function of time and the initial points; } mesh.movePoints(newPoints); runTime.write(); } return 0; } ================================================ Still I get this error: --> FOAM FATAL ERROR : Cannot move points: size of given point list smaller than the number of active points When I use mesh.update(), this error dissapears (why?) but no motion occurs (why?). So I am able to calculate the boundary points the way I want, but not to update / move the boundary points accordingly. Regards, Frank BTW, I have to use the newPoints.x() component when I add some sin() or cos() function. Why is that? __________________ Frank Bos

 April 26, 2007, 06:44 When moving the mesh with move #8 Member     Eric Lillberg Join Date: Mar 2009 Location: Stockholm Posts: 80 Rep Power: 10 When moving the mesh with movePoints() you need to supply new locations for ALL points in the mesh, not just the boundary. If you just move the boundarypoints you'll need an algorithm or solver to calculate the motion of the rest of the mesh. Your error results from your initialization of newPoints >> pointField newPoints = mesh.boundaryMesh()[patchI].localPoints(); This will only copy the boundary points to newPoints and you need all mesh.points(), see post above for proper initialization. The amount of movement in the mesh depends on the boundary motion amplitude. If you're looking for rigid body motion things should be trivial if you define a referens point (e.g. (0 0 0)) and calculate a rotation translation for each point in the mesh relative that referens. If you read a prescribed boundary point motion from a file I think you only need to calculate rotation/translation for 3 points on your boundary to specify the entire body motion, right? If you have a prescribed motion of the boundary that is not rigid you'll need a mesh motion solver of some sort. Hope you find this helpful Regards, Eric

 April 26, 2007, 07:12 Thanks Eric, I already had som #9 Senior Member   Frank Bos Join Date: Mar 2009 Location: The Netherlands Posts: 340 Rep Power: 11 Thanks Eric, I already had some similar ideas on this, but you made it much clearer to me. You're idea of moving all internal mesh points according to the rotational boundary motion is not going to work in 3D where the moving body has a 'complex' shape and the outer boundary is just a rectangular box where all boundary points are fixed. I think that it is better to calculate the motionU boundary condition (which is easy since the boundary motion is known) and then use the tetDecompositionMotionSolver to move all internal mesh points. Some library (like movingBodyFvMesh) has to be created then. This last method is slightly more difficult and I thought that it should be possible to move the boundary and the mesh accordingly in a custom solver. Am i right? Regards, Frank __________________ Frank Bos

 April 26, 2007, 07:43 In that case try... Increme #10 Member     Eric Lillberg Join Date: Mar 2009 Location: Stockholm Posts: 80 Rep Power: 10 In that case try... Incremental motion of your patch points in 'boundaryPatchPointsDispl' // Grab motionU from registry tetPointVectorField& motionU = const_cast ( mesh.objectRegistry::lookupObject ( "motionU" ) ); // Get a tetPolyPatch for the points on your moving boundary fixedValueTetPolyPatchVectorField& motionUPatch = refCast ( motionU.boundaryField()[movingBoundaryPatchID] ); // Fix an interpolator for your motionU boundary tetPolyPatchInterpolation tetPointPatchInterpolator ( refCast(motionUPatch.patch()) ); //Use the interpolator to put the point velocities on your motionU patch motionUPatch == tetPointPatchInterpolator.pointToPointInterpolate ( boundaryPatchPointsDispl/runTime.deltaT().value() ); // Do the mesh motion using the tetDecom solver defined in th dynamicMeshDict in constant mesh.update(); Regards, Eric

 May 4, 2007, 08:13 Thanks, I solved the problem a #11 Senior Member   Frank Bos Join Date: Mar 2009 Location: The Netherlands Posts: 340 Rep Power: 11 Thanks, I solved the problem a couple of days ago. As always it turned out to be a very straightforward solution. I forgot to put some matrix inverse somewhere in my code. So I can now start simulating a 3d flapping wing with prescribed translations (3Dofs) and rotations (3Dofs). Regards, Frank __________________ Frank Bos

 May 4, 2007, 08:44 Excellent, If possible, I w #12 Member     Eric Lillberg Join Date: Mar 2009 Location: Stockholm Posts: 80 Rep Power: 10 Excellent, If possible, I would like to try your code on some two-phase FSI cases that I'm playing around with. Regards, Eric

 May 4, 2007, 08:57 Mmm, are you sure that you nee #13 Senior Member   Frank Bos Join Date: Mar 2009 Location: The Netherlands Posts: 340 Rep Power: 11 Mmm, are you sure that you need this, its quite simple. I only move the boundary points according to some rotation matrices with prescribed motion angles which are a function of time. So no FSI involved. If you are still interested, drop me a mail. Regards, Frank __________________ Frank Bos

 June 12, 2007, 12:31 Hi Frank! Beeing enthusiast a #14 Senior Member   Francesco Del Citto Join Date: Mar 2009 Location: Zürich Area, Switzerland Posts: 220 Rep Power: 11 Hi Frank! Beeing enthusiast about your work on flapping wings, I started to have a look to dynamic meshes. At first, I used movingCone totorial inside icoDyMFoam as base example, and now I can make cube slide onto a surface, and all the mesh is readapted in a very nice way, both with 1.3 and with 1.4 version. Now, I would like to impose a general transformation to the cube (let's say, rotating, scaling, etc...) I don't know where to start from! I had a look to moveMesh tools, and it's very short and elegant, but a bit obscure to me. Then, I moved to dynamicBodyFvMesh, that you yoused for your flapping wings. I looked a bit inside it, and it seems to look for some entries in the dynamicMeshDict that I can't find inside any example... I changed my constant/dynamicMeshDict to: solverLib "libdynamicFvMesh.so"; dynamicFvMesh dynamicBodyFvMesh; ... But the line "dynamicFvMesh" is ignored. If I remove ite, "moveMesh" works without problems, and it still translate my cube. Where am I wrong? How can I use dynamicBodyFvMesh as my movement routine?

 June 12, 2007, 13:19 Hi Francesco! Very nice tha #15 Senior Member   Frank Bos Join Date: Mar 2009 Location: The Netherlands Posts: 340 Rep Power: 11 Hi Francesco! Very nice that you find my work interesting! Indeed, I used dynamicBodyFvMesh to define the translational and rotational motion. In the standard dynamicBodyFvMesh you can only specify 1 freedom of translation and 1 freedom of rotation. I modified this lib, such that I am able to define a 6 DOF motion. (Remark: I did not implement a coupling between the forces and motion.) So, you'll have to start with dynamicBodyFvMesh, where you can define your desired rotation, translation or scaling etc.....Very nice!! Furthermore, in order to use this lib, you'll have to specify the following in dynamicMeshDict: dynamicFvMeshLib "libtetDecompositionMotionSolver.so"; dynamicFvMesh dynamicBodyFvMesh; dynamicBodyFvMeshCoeffs { bodyPatchName body_wall; translationDirection (-1 0 0); translationAmplitude 0; TranslationFrequency 0.25; initialRotationOrigin (0 0 0); rotationAxis (1 0 0); rotationAmplitude 0.523; //30 degrees in radians rotationFrequency 0.25; } If you get this working, try moving a subset within another subset, I would be interesting :-) Enjoy!!! Regards, Frank __________________ Frank Bos

 June 12, 2007, 13:53 Hi Frank! Thanks for the very #16 Senior Member   Francesco Del Citto Join Date: Mar 2009 Location: Zürich Area, Switzerland Posts: 220 Rep Power: 11 Hi Frank! Thanks for the very quick reply. I still have the same behaviuor... This is my dynamicMeshDict input file: FoamFile { version 2.0; format ascii; root ""; case ""; instance ""; local ""; class dictionary; object motionProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solverLib "libdynamicFvMesh.so"; twoDMotion no; solver laplaceTetDecomposition; diffusion quadratic patchEnhanced; frozenDiffusion off; distancePatches ( cube ); dynamicFvMeshLib "libtetDecompositionMotionSolver.so"; dynamicFvMesh dynamicBodyFvMesh; dynamicBodyFvMeshCoeffs { bodyPatchName cube; translationDirection (1 0 0); translationAmplitude 0; translationFrequency 1; initialRotationOrigin (3.5 2.5 0); rotationAxis (0 0 1.); rotationAmplitude 0.3; rotationFrequency 1; } // ************************************************** *********************** // The problem is that moveMesh complains only for missing "solver", "solverLib", twoDMotion, diffusion, frozenDiffusion and distancePatches lines. It completely ignores everything else... And it's not using dynamicBodyFvMesh yet. I guess I have to use something that activate the "dynamicFvMeshLib" option inside this dictionary...

 June 12, 2007, 14:51 Hi, I don't use: solverLi #17 Senior Member   Frank Bos Join Date: Mar 2009 Location: The Netherlands Posts: 340 Rep Power: 11 Hi, I don't use: solverLib "libdynamicFvMesh.so" If you specify a nonexisting dynamicFvMesh, instead of dynamicBodyFvMesh, it should give the available options, including the dynamicBodyFvMesh. If not, you should recompile the dynamicFvMesh lib. Frank __________________ Frank Bos

 June 13, 2007, 02:28 Thanks Frank! My mistake was #18 Senior Member   Francesco Del Citto Join Date: Mar 2009 Location: Zürich Area, Switzerland Posts: 220 Rep Power: 11 Thanks Frank! My mistake was using "moveMesh" instead of "moveDynamicMesh". I can rotate the cube, at last, and I know what I have to modify in order to add mya own motion laws. I'll play a bit with this, and I'll let you know if I'll be able to move a subset within another one. Ciao Francesco

 June 15, 2007, 02:45 Here I am again... After some #19 Senior Member   Francesco Del Citto Join Date: Mar 2009 Location: Zürich Area, Switzerland Posts: 220 Rep Power: 11 Here I am again... After some test on more complicated cases with version 1.3 dev, I would like to test my rotating and translating cube with version 1.4. Basicly, I would like to port "dynamicBodyFvMesh" to OF 1.4, but I'm having a lot of troubles, because of tetdecompositionMotionSolver doesn't exist anymore, as the algorithm is changed. Frank, you could recompile your modified version of "dynamicBodyFvMesh" with 1.4, am I right? How? Francesco

 June 15, 2007, 06:44 If it halps at all, I have por #20 Senior Member   Hrvoje Jasak Join Date: Mar 2009 Location: London, England Posts: 1,803 Rep Power: 24 If it halps at all, I have ported the dynamicBodyFvMesh and all other stuff mentioned in Zgabre already - all it needs is some time to make sure I didn't put any new bugs in... Hrv __________________ Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Kabo Main CFD Forum 1 October 11, 2007 04:37 NGUYEN Viet Hung FLUENT 0 July 9, 2006 19:59 Manoj Kumar FLUENT 0 November 2, 2005 02:20 KEVIN FLUENT 0 March 23, 2004 09:13 Tim Franke Main CFD Forum 0 February 1, 2000 08:28

All times are GMT -4. The time now is 00:59.