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

angularOscillatingDisplacement parameters

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 6, 2012, 16:01
Default angularOscillatingDisplacement parameters
  #1
Member
 
Joe
Join Date: Dec 2011
Location: Groton, CT
Posts: 69
Rep Power: 14
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: 69
Rep Power: 14
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: San Francisco, CA USA
Posts: 323
Rep Power: 17
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: 69
Rep Power: 14
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: San Francisco, CA USA
Posts: 323
Rep Power: 17
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: 69
Rep Power: 14
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: 69
Rep Power: 14
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: 15
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: 15
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

Old   July 8, 2018, 07:09
Default
  #10
New Member
 
Chayanit Nigaltia
Join Date: Jan 2018
Posts: 29
Rep Power: 8
CHAYANIT is on a distinguished road
Quote:
Originally Posted by jferrari View Post
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;
    }



I am facing problem running this case.The following problem is occuring .


GAMG: Solving for cellDisplacementx, Initial residual = 1, Final residual = 9.00145e-06, No Iterations 3
GAMG: Solving for cellDisplacementy, Initial residual = 1, Final residual = 7.73384e-06, No Iterations 3
GAMG: Solving for pcorr, Initial residual = 1, Final residual = 0.0147208, No Iterations 16
time step continuity errors : sum local = 1.33772e-05, global = 5.47826e-20, cumulative = 5.47826e-20
PIMPLE: iteration 1
smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 0.0342088, No Iterations 1
smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 0.028379, No Iterations 1
#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam::GAMGSolver::scale(Foam::Field<double>&, Foam::Field<double>&, Foam::lduMatrix const&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&, Foam::Field<double> const&, unsigned char) const at ??:?
#4 Foam::GAMGSolver::Vcycle(Foam::PtrList<Foam::lduMa trix::smoother> const&, Foam::Field<double>&, Foam::Field<double> const&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::Field<double> >&, unsigned char) const at ??:?
#5 Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:?
#6 Foam::fvMatrix<double>::solveSegregated(Foam::dict ionary const&) at ??:?
#7 Foam::fvMatrix<double>::solve(Foam::dictionary const&) at ??:?
#8 ? at ??:?
#9 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#10 ? at ??:?
Floating point exception (core dumped)





Kindly help
CHAYANIT is offline   Reply With Quote

Old   August 12, 2018, 15:01
Default
  #11
New Member
 
Jianming
Join Date: Dec 2016
Posts: 3
Rep Power: 9
Jim_Hao is on a distinguished road
Hi Chayanit,

I have the same issue as you faced, have you figured out this issue?

In my case, when this issue happens, the forces on the airfoil became extremely large.

Do you also have this issue?

Thanks,
Jim
Jim_Hao is offline   Reply With Quote

Old   May 3, 2020, 22:23
Default
  #12
Senior Member
 
TWB
Join Date: Mar 2009
Posts: 400
Rep Power: 19
quarkz is on a distinguished road
Hi,

I tried and realised that amplitude should be in rad, not degrees. I checked the latest 1912 source code and there seems to be a conversion, so not sure if we're looking at the correct file.

Code:
wing
    {
    type        angularOscillatingDisplacement;
    value           uniform (0 0 0);
	axis		(0 0 1);
	origin (0.25 0.007 0.125);
	angle0		 0;
	amplitude       0.358;  //units of rad ~ 20deg
	omega           6.28;       //units of rad/s ~ 1 period /s
Btw, try using:

moveDynamicMesh -noFunctionObjects

to test and preview the mesh motion in Paraview before actually computing the solution. Can also be done in parallel.
quarkz 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


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 02:05
twoPhaseEulerFoam - parameters grjmell OpenFOAM 1 June 16, 2011 08:13
units of geometrical parameters lost SoobY ANSYS Meshing & Geometry 2 January 10, 2011 03:58
New to CFX-need explanations about mesh parameters Cyril CFX 3 November 24, 2006 06:33


All times are GMT -4. The time now is 17:19.