# angularOscillatingDisplacement parameters

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

 May 6, 2012, 16:01 angularOscillatingDisplacement parameters #1 Member   Joe Join Date: Dec 2011 Location: Groton, CT Posts: 69 Rep Power: 14 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; }```

 May 10, 2012, 16:50 #2 Member   Joe Join Date: Dec 2011 Location: Groton, CT Posts: 69 Rep Power: 14 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?

 May 11, 2012, 14:30 #3 Senior Member     Kyle Mooney Join Date: Jul 2009 Location: San Francisco, CA USA Posts: 323 Rep Power: 17 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!

May 11, 2012, 14:35
#4
Member

Joe
Join Date: Dec 2011
Location: Groton, CT
Posts: 69
Rep Power: 14
Quote:
 Originally Posted by kmooney 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!

 May 11, 2012, 14:38 #5 Senior Member     Kyle Mooney Join Date: Jul 2009 Location: San Francisco, CA USA Posts: 323 Rep Power: 17 It can be easy to get pretty lost down in the depths of the boundary condition directory structures.

 May 13, 2012, 09:29 #6 Member   Joe Join Date: Dec 2011 Location: Groton, CT Posts: 69 Rep Power: 14 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::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.....

 May 15, 2012, 14:13 #7 Member   Joe Join Date: Dec 2011 Location: Groton, CT Posts: 69 Rep Power: 14 Yep, everything is in radians or radians/second.

 June 23, 2012, 06:02 #8 Member   s.rasoul_varedi Join Date: Feb 2010 Posts: 82 Rep Power: 15 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.

 June 25, 2012, 02:43 #9 Member   s.rasoul_varedi Join Date: Feb 2010 Posts: 82 Rep Power: 15 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

July 8, 2018, 07:09
#10
New Member

Chayanit Nigaltia
Join Date: Jan 2018
Posts: 29
Rep Power: 8
Quote:
 Originally Posted by jferrari 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

 August 12, 2018, 15:01 #11 New Member   Jianming Join Date: Dec 2016 Posts: 3 Rep Power: 9 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

 May 3, 2020, 22:23 #12 Senior Member   TWB Join Date: Mar 2009 Posts: 400 Rep Power: 19 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.