CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[Other] Oscillating Airfoil and Independently Oscillating Flap

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 24, 2010, 20:07
Default Oscillating Airfoil and Independently Oscillating Flap
  #1
Senior Member
 
Daniel
Join Date: Jul 2009
Location: Montreal, Canada
Posts: 156
Rep Power: 16
dancfd is on a distinguished road
Good evening all,

I am having some difficulty modifying the pointPatchField angularOscillatingDisplacement to allow me to oscillate a flap on an airfoil which itself is also oscillating. Without modification, this pointPatchField will allow me to do either the whole airfoil-flap combination or simply the flap, but I would like to oscillate the airfoil in one direction, and have the flap oscillate in the opposite direction.

I modified angularOscillatingDisplacement to read separate dictionary values for both the flap and airfoil motion, but I cannot modify lines 165-170 of angularOscillatingDisplacementPointPatchVectorFiel d.C to produce an operator that will affect the rotation about each axis (errors are produced if I try to introduce an "axisHatFlap" into the equation as in addition to the "axisHat"):

Code:
    vectorField::operator=
    (
        p0Rel*(cos(angle) - 1)
      + (axisHat ^ p0Rel*sin(angle))
      + (axisHat & p0Rel)*(1 - cos(angle))*axisHat
    );
I have a few ideas to get around this: I could modify the code to perform the airfoil rotation, then run the same code a second time with references to the flap-only rotation parameters. An easier solution would be to modify the operator to reflect the rotation about the two axes, though that does not seem to work.

Unfortunately, I cannot figure out how to modify the code to do either. Can anyone offer some guidance?

Thank you,

Dan
dancfd is offline   Reply With Quote

Old   August 24, 2010, 21:16
Default Some Progress...
  #2
Senior Member
 
Daniel
Join Date: Jul 2009
Location: Montreal, Canada
Posts: 156
Rep Power: 16
dancfd is on a distinguished road
It looks like it would work if I could call

Code:
fixedValuePointPatchField<vector>::updateCoeffs();
a second time to use another operator. However, by running updateCoeffs() a flag (updated_) is set in a private member function that prevents it from being run twice.

Is there a more elegant way to run updateCoeffs() twice without copying pointPatchFields, renaming and then calling the same updateCoeffs() function with a different name to get around the updated_ flag?

Thanks,
Dan
dancfd is offline   Reply With Quote

Old   August 24, 2010, 22:52
Default
  #3
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25
deepsterblue will become famous soon enough
Are you trying to simulate a multi-element wing situation? That's what I gather from your initial post. Could you post a picture of your mesh?
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Old   August 26, 2010, 18:52
Default
  #4
Senior Member
 
Daniel
Join Date: Jul 2009
Location: Montreal, Canada
Posts: 156
Rep Power: 16
dancfd is on a distinguished road
Hello Sandeep,

Thank you for your reply - yes, it is a multi-element wing. I have posted two images, one of the wing and flap oscillating together (you will notice a small gap between the wing and the flap) and a close-up of the flap when I cause it to oscillate in the opposite direction using modified angularOscillatingDisplacement code (it looks like the flap boundary was moved, but the rest of the mesh was not adjusted). The mesh is a structured C-grid, and not nearly optimized. I just want to get the motion to work at this point.

The problem is that I have so far been unable to perform the two transformations required to cause the flap to oscillating while the "hinge" remains immobile relative to the wing. I must perform either 1) the same rotation as the wing followed by a second rotation about the center of the hinge, or 2) a displacement of the flap to the correct location relative to the rotating wing followed by a rotation about the center of the hinge. Do you have any suggestions? The code I am using, which does not work, is as follows:

Code:
void flapDisplacementPointPatchVectorField::updateCoeffs()
{
    if (this->updated())
    {
        return;
    }
    
    const polyMesh& mesh = this->dimensionedInternalField().mesh()();
    const Time& t = mesh.time();

    scalar angle = angle0_ + amplitude_*sin(omega_*t.value());
    vector axisHat = axis_/mag(axis_);
    vectorField p0Rel = p0_ - origin_;
    
    vectorField::operator=
    (
        p0Rel*(cos(angle) - 1)
      + (axisHat ^ p0Rel*sin(angle))
      + (axisHat & p0Rel)*(1 - cos(angle))*axisHat
    );
    
    fixedValuePointPatchField<vector>::updateCoeffs();
    
    //new
    scalar fangle = fangle0_ + famplitude_*sin(fomega_*t.value());//
    vector faxisHat = faxis_/mag(faxis_);
    vectorField fp0Rel = p0_ - forigin_;//need reload p0?
    
    vectorField::operator=
    (
        fp0Rel*(cos(fangle) - 1)
      + (faxisHat ^ fp0Rel*sin(fangle))
      + (faxisHat & fp0Rel)*(1 - cos(fangle))*faxisHat
    );
    //updated_ = false; // ref pointPatchField.H --- This causes an error
    //fixedValuePointPatchField<vector>::updateCoeffs(); //this has no effect
    // end new    
}
I renamed angularOscillatingDisplacement to flapDisplacement, and placed an "f" in front of the dictionary parameters that are to affect the flap oscillation.

Thanks,

Dan
Attached Images
File Type: jpg MoveAsOne.jpg (97.2 KB, 67 views)
File Type: jpg OppositeOscillation.jpg (97.3 KB, 67 views)
dancfd is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 03:49.