|
[Sponsors] |
May 9, 2013, 09:33 |
How to couple motions of several patches
|
#1 |
New Member
Martin Reinhardt
Join Date: Apr 2013
Posts: 1
Rep Power: 0 |
Hello everyone,
I'm looking for a way to couple oscillating motions of up to five patches with OF 2.1. The patches shall be connected with each other in a row (imagine a model of a snake or a fish, built with five segments). Therefore, the position and the angle of every patch - except the first Patch (the "head") - depends also on the position and the angle of a reference patch. The key point is: How do I get a patch "to know" the angle of its reference patch? I was thinking about to start with a modified version of "angularOscillatingDisplacement" - I added a method relAngle() to deliver the current angle: Code:
scalar myAngularOscillatingDisplacementPointPatchVectorField::relAngle() // method to deliver the current angle { const Time& t = mesh.time(); scalar angle = angle0_ + amplitude_*sin(omega_*t.value()); return angle; } Code:
vectorField::operator= ( p0Rel*(cos(angle) - 1) // as known from the... + (axisHat ^ p0Rel*sin(angle)) // unmodified... + (axisHat & p0Rel)*(1 - cos(angle))*axisHat // method + (...) // and here some term which uses relAngle() of the //reference patch to calculate the complete motion. ); Code:
SEGMENT_0 // the "head" { type myAngularOscillatingDisplacement; axis (0 0 1); origin (0 0 0); angle0 0; amplitude 0.2; omega 3.0; value uniform (0 0 0); } SEGMENT_1 { type relAngularOscillatingDisplacement; reference SEGMENT_0; // this shall be the reference patch axis (0 0 1); origin (0.3 0 0); angle0 0; amplitude 0.15; omega 3; value uniform (0 0 0); } SEGMENT_2 { type relAngularOscillatingDisplacement; reference SEGMENT_1; axis (0 0 1); origin (0.5 0 0); angle0 0; amplitude 0.1; omega 3; value uniform (0 0 0); } // and // so // on... SEGMENT_5 // the "tail" { type relAngularOscillatingDisplacement; reference SEGMENT_4 axis (0 0 1); origin (1.5 0 0); angle0 0; amplitude 0.05; omega 3; value uniform (0 0 0); } I think I will have to introduce a class "myAngularOscillatingDisplacementPointPatchVectorF ield" in relAngularOscillatingDisplacementPointPatchVectorF ield.H/.C in order to access relAngle(); and to find a way to tell the object of SEGMENT_(i+1) to look for the angle of SEGMENT_(i), but I don't know how to make this work. Sorry for the long question... I hope I could describe my problem in an understandable way and I will appreciate every advice I may get, thank you very much. Greetings, Martin |
|
May 12, 2013, 09:21 |
|
#2 |
Senior Member
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 17 |
Although its not the cleanest way to go about it, you could created a registered db object in your main solver and store the patch displacement information there. I know that a few patches look up gravity from the main solver like this:
Code:
db().lookupObject<uniformDimensionedVectorField>("g"); |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Commercial meshers] fluentMeshToFoam: "fluent patch type shadow not recognised" | preibie | OpenFOAM Meshing & Mesh Conversion | 28 | March 29, 2017 04:56 |
Case running in serial, but Parallel run gives error | atmcfd | OpenFOAM Running, Solving & CFD | 18 | March 26, 2016 12:40 |
[blockMesh] Merging edge patches | Yosmcer | OpenFOAM Meshing & Mesh Conversion | 11 | November 16, 2014 14:51 |
Cyclic boundaries in OF 21x | morard | OpenFOAM | 25 | May 13, 2013 22:35 |
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues | michele | OpenFOAM Meshing & Mesh Conversion | 2 | July 15, 2005 04:15 |