CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

angularOscillatingDisplacement parameters

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 6, 2012, 16:01
Default angularOscillatingDisplacement parameters
  #1
Member
 
Joe
Join Date: Dec 2011
Location: Groton, CT
Posts: 67
Rep Power: 6
jferrari is on a distinguished road
I'm trying to run pimpleDyMFoam with a pointDisplacement file (like the wingMotion tutorial). The code below runs, but I'm not really sure about what exactly it's doing.

value - not sure why this is needed, but it is
axis (0 0 1) - no problem here, rotating about the z-axis
origin (0 0 0) - no problem here, rotating about the z-axis through point (0 0 0)

I expect that the last three are related as

angle = angle0 + amplitude * sin(2*pi*omega*t)

Is this relationship correct?
Are angle0 and amplitude expressed in degrees?
Is omega expressed in Hz?
Is there a 2pi factor in the sine function?

Code:
    airfoil
    {
        type            angularOscillatingDisplacement;
	value		uniform (0 0 0);
	axis		(0 0 1);
	origin		(0 0 0);
	angle0		0;
	amplitude	10;
	omega		0.174;
    }
jferrari is offline   Reply With Quote

Old   May 10, 2012, 16:50
Default
  #2
Member
 
Joe
Join Date: Dec 2011
Location: Groton, CT
Posts: 67
Rep Power: 6
jferrari is on a distinguished road
Working to the following code:
Code:
    airfoil
    {
        type            angularOscillatingDisplacement;
	axis		(0 0 1);
	origin		(-1 0 0);
	angle0		0;
	amplitude	5;
	omega		0.3183098862;
        value           uniform (0 0 0);
    }
After this runs 0.215 seconds, there is a lot of displacement going on (seen below).


This means that angularOscillatingDisplacement isn't doing anything close to what I think it's doing.

Searching...........................

A bit from oscillatingRotatingMotion.C:
Code:
Foam::septernion
Foam::solidBodyMotionFunctions::oscillatingRotatingMotion::
transformation() const
{
    scalar t = time_.value();

    vector eulerAngles = amplitude_*sin(omega_*t);

    // Convert the rotational motion from deg to rad
    eulerAngles *= pi/180.0;

    quaternion R(eulerAngles.x(), eulerAngles.y(), eulerAngles.z());
    septernion TR(septernion(CofG_)*R*septernion(-CofG_));

    Info<< "solidBodyMotionFunctions::oscillatingRotatingMotion::"
        << "transformation(): "
        << "Time = " << t << " transformation: " << TR << endl;

    return TR;
}
Based on this code it's converting from degrees to radians... so amplitude should be in degrees..... and it also looks like omega is in rad/s, also what I thought it was......

Okay so I'm a bit lost now. Can anyone explain how angularOscillatingDispalcment works?
jferrari is offline   Reply With Quote

Old   May 11, 2012, 14:30
Default
  #3
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: Amherst, MA USA - San Diego, CA USA
Posts: 320
Rep Power: 10
kmooney is on a distinguished road
Howdy,

A good place to start might be reverse engineering the source code. The file of interest is located here in 1.6-ext:

Code:
~/OpenFOAM/OpenFOAM-1.6-ext/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C
Good luck!
kmooney is offline   Reply With Quote

Old   May 11, 2012, 14:35
Default
  #4
Member
 
Joe
Join Date: Dec 2011
Location: Groton, CT
Posts: 67
Rep Power: 6
jferrari is on a distinguished road
Quote:
Originally Posted by kmooney View Post
Howdy,

A good place to start might be reverse engineering the source code. The file of interest is located here in 1.6-ext:

Code:
~/OpenFOAM/OpenFOAM-1.6-ext/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C
Good luck!

Ah, apparently I was looking at the wrong source code. Thanks for pointing me in the right direction!
jferrari is offline   Reply With Quote

Old   May 11, 2012, 14:38
Default
  #5
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: Amherst, MA USA - San Diego, CA USA
Posts: 320
Rep Power: 10
kmooney is on a distinguished road
It can be easy to get pretty lost down in the depths of the boundary condition directory structures.
kmooney is offline   Reply With Quote

Old   May 13, 2012, 09:29
Default
  #6
Member
 
Joe
Join Date: Dec 2011
Location: Groton, CT
Posts: 67
Rep Power: 6
jferrari is on a distinguished road
This looks like the subroutine that does the actual rotating:
Code:
void angularOscillatingDisplacementPointPatchVectorField::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();
}
There's still the relationship I suspected earlier - starting angle plus a sine-varying angle, though I don't see any conversion to radians. angle0 and amplitude may be expressed in radians and not degrees - I have a case running with angle0 = 0 radians and amplitude = 0.0872664626 radians = 5 degrees now to test whether or not this is the case. I still think omega is rad/s. In the case I'm currently running I wanted a period of 0.1 s, so f = 10 and omega = 62.831853 rad/s. I'll update this thread when it finishes - though it'll be a while.... it kept crashing until I brought the max courant number down to 0.1.....
jferrari is offline   Reply With Quote

Old   May 15, 2012, 14:13
Default
  #7
Member
 
Joe
Join Date: Dec 2011
Location: Groton, CT
Posts: 67
Rep Power: 6
jferrari is on a distinguished road
Yep, everything is in radians or radians/second.
jferrari is offline   Reply With Quote

Old   June 23, 2012, 06:02
Default
  #8
Member
 
s.rasoul_varedi
Join Date: Feb 2010
Posts: 82
Rep Power: 7
desert_1250 is an unknown quantity at this point
Send a message via Yahoo to desert_1250
Hello all
i wanna use linear motion vs time to calculate aerodynamic coeffs for angle of attack=0 to 25 degrees of an airfoil. for this, i added "t.value()" to the oscillation function as following :
angle = angle0_ + amplitude_*sin(omega_*t.value())+ t.value();

by substituting angle0=0 and amplitude=0 in it. now:

1- would you tell me the steps of how to compile the new modified code?!
2- did you have another suggestion for solving this problem?

tnx alot
____________
Rasoul

Last edited by desert_1250; June 23, 2012 at 06:23.
desert_1250 is offline   Reply With Quote

Old   June 25, 2012, 02:43
Default
  #9
Member
 
s.rasoul_varedi
Join Date: Feb 2010
Posts: 82
Rep Power: 7
desert_1250 is an unknown quantity at this point
Send a message via Yahoo to desert_1250
Hello again
i compiled the new code successfully using wmake libso command and it is up to date. but when i used it in the 0 > poitDisplacement file, the following error apear :

unknown patchField type myAngularOscillatingDisplacement for patch type wall...

the boundary type that i used is :

wing
{
type myAngularOscillatingDisplacement;
axis (0 0 1);
origin (0 0 0);
amplitude 0;
omega 6.283;
value uniform (0 0 0);
}

Can anyone tell me how to solve this problem?

tnx
_____
Rasoul
desert_1250 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get Pro/E Parameters to Show Up Trues CFX 4 September 17, 2012 20:26
Parameters for multigrid solver HaZe OpenFOAM Running, Solving & CFD 3 January 28, 2012 03:05
twoPhaseEulerFoam - parameters grjmell OpenFOAM 1 June 16, 2011 08:13
units of geometrical parameters lost SoobY ANSYS Meshing & Geometry 2 January 10, 2011 04:58
New to CFX-need explanations about mesh parameters Cyril CFX 3 November 24, 2006 07:33


All times are GMT -4. The time now is 04:21.