|
[Sponsors] | |||||
|
|
|
#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 |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
Kyle Mooney
Join Date: Jul 2009
Location: Amherst, MA USA
Posts: 174
Rep Power: 5 ![]() |
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");
|
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cyclic boundaries in OF 21x | morard | OpenFOAM | 24 | Today 21:34 |
| Merging ege patches | Yosmcer | OpenFOAM Native Meshers: blockMesh | 4 | April 14, 2013 16:05 |
| Case running in serial, but Parallel run gives error - Please help! urgent ! | atmcfd | OpenFOAM Running, Solving & CFD | 9 | November 21, 2012 03:39 |
| fluentMeshToFoam | preibie | OpenFOAM | 24 | October 8, 2012 14:57 |
| Trimmed cell and embedded refinement mesh conversion issues | michele | OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... | 2 | July 15, 2005 04:15 |