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

Help compiling code (newbie)

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 9, 2014, 10:08
Default
  #41
New Member
 
Tom Brown
Join Date: Mar 2014
Posts: 27
Rep Power: 12
thsb20 is on a distinguished road
Hi,

Im pretty sure ive got to grips with all the code, except for changing the blade number. Ive run the case with 6 blades and its giving accurate data, and Ive got to grips with paraFoam and the force/power file.

I can change all dimensions that I want, and got it set up perfectly, except for the blade number.

My mesh is fine with the four blades, no errors come up. But when I run ./parallel it throws up a few errors. I have edited the dynamicMeshDict like you said. Ive also done quite a bit of changing things around in the case directory to make it work. Ive tried to remove all reference to 6 blades, removing all places with blades4 and blades5, but it still throws up errors that I cant figure out.

When you change the number in the mesh, and the dynamicMehDict, does it work strait away? with 4 blades instead of 6.
thsb20 is offline   Reply With Quote

Old   April 9, 2014, 11:25
Default
  #42
Senior Member
 
Robert
Join Date: Sep 2010
Posts: 158
Rep Power: 16
lordvon is on a distinguished road
Ah, one more thing.

In 'fixBoundary' you have to edit it to exclude the inclusion of the 2 additional blades. It is at the bottom of the script. You can replace the following section:

Code:
lines=$(grep -n "bladeAmi" constant/polyMesh/boundary | cut -d: -f1)
lines=( $lines )
line=$((lines[0]+2))
sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi00;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
line=$((lines[1]+2))
sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi10;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
line=$((lines[2]+2))
sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi20;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
line=$((lines[3]+2))
sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi30;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
line=$((lines[4]+2))
sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi40;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
line=$((lines[5]+2))
sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi50;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
line=$((lines[6]+2))
sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi01;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
line=$((lines[7]+2))
sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi11;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
line=$((lines[8]+2))
sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi21;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
line=$((lines[9]+2))
sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi31;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
line=$((lines[10]+2))
sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi41;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
line=$((lines[11]+2))
sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi51;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
With this:

Code:
lines=$(grep -n "bladeAmi" constant/polyMesh/boundary | cut -d: -f1)
lines=( $lines )
counter=0

line=$((lines[$counter]+2))
sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi00;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
counter=$((counter+1))

line=$((lines[$counter]+2))
sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi10;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
counter=$((counter+1))

line=$((lines[$counter]+2))
sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi20;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
counter=$((counter+1))

line=$((lines[$counter]+2))
sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi30;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
counter=$((counter+1))

#line=$((lines[$counter]+2))
#sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi40;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
#counter=$((counter+1))

#line=$((lines[$counter]+2))
#sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi50;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
#counter=$((counter+1))

line=$((lines[$counter]+2))
sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi01;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
counter=$((counter+1))

line=$((lines[$counter]+2))
sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi11;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
counter=$((counter+1))

line=$((lines[$counter]+2))
sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi21;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
counter=$((counter+1))

line=$((lines[$counter]+2))
sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi31;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
counter=$((counter+1))

#line=$((lines[$counter]+2))
#sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi41;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
#counter=$((counter+1))

#line=$((lines[$counter]+2))
#sed -i "${line}s/.*/type cyclicAMI;neighbourPatch bladeAmi51;matchTolerance 1e-4;transform noOrdering;/" constant/polyMesh/boundary
#counter=$((counter+1))
When you wanna do five or six blades again you can uncomment the relevant lines.
Also in the mesh, in main.geo, be sure to comment out the lines referencing bladeAmi40,50,41, and 51.
lordvon is offline   Reply With Quote

Old   April 9, 2014, 17:36
Default
  #43
New Member
 
Tom Brown
Join Date: Mar 2014
Posts: 27
Rep Power: 12
thsb20 is on a distinguished road
Excellent, thanks. Ive got it all working with four blades, and correct dimensions for my project. Just a couple more questions:

1. In the Blades part of the mesh, youve got a function to produce NACA aerofoils, are you not using this function? The mesh doesnt look like a standard NACA shape, and I cant see in in use in the code apart form in the part you have commented out in the 1_points.geo. Is it a case of replacing the part above it with the commented part?

Im getting lift and power lower than I was expecting and I think its probably because of the shape of the aerofoils
thsb20 is offline   Reply With Quote

Old   April 9, 2014, 17:51
Default
  #44
New Member
 
Tom Brown
Join Date: Mar 2014
Posts: 27
Rep Power: 12
thsb20 is on a distinguished road
For the time being, ive found the bit that adjusts the curvature. That way ou dont have the cmaber working the wrong way at the bottom

Edit: I think actually it could be closer than I thought. With the maximum angle of attack directly upwards you get a fair amount of horizontal force. Im going to try and counteract that tomorrow by applying a slight change to the direction of thrust, slightly clockwise. I think ive spent enough time in your code to figure out how to do this, it should jsut be the mesh that needs changing and nothing in the case?

Last edited by thsb20; April 9, 2014 at 19:39.
thsb20 is offline   Reply With Quote

Old   April 9, 2014, 19:51
Default
  #45
Senior Member
 
Robert
Join Date: Sep 2010
Posts: 158
Rep Power: 16
lordvon is on a distinguished road
At one point I was using the NACA airfoils, but without the inflation layer. If you really wanted to, it would not be terribly difficult to implement. Gmsh uses a simple C-based language, and the mesh is quite simple and 2D.

Be sure you have run the simulation at sufficiently low maxCo!!! (in the controlDict) lower maxCo = greater accuracy! maxCo = 2 should be sufficient. I believe the default in the case files is maxCo = 30. The results will probably change significantly when you go to maxCo = 2.

To reiterate, the pitching schedule is sinusoidal. This approximates the schedule that results from the multibar spoke-like mechanisms that are common in cyclorotors. The amplitude of the pitching is specified in the dynamicMeshDict in variables 'min' and 'max' for every blade. Be sure these match your case.

To vector the thrust, change the tilt variables in the mesh and in dynamicMeshDict.
lordvon is offline   Reply With Quote

Old   April 15, 2014, 16:37
Default
  #46
New Member
 
Tom Brown
Join Date: Mar 2014
Posts: 27
Rep Power: 12
thsb20 is on a distinguished road
Hi lordvon,

I want to thank you again for this, its an awesome bit of code. Ive got it all working, and modified to my situation. Ive also manufactured a cyclorotor of my own and Ive got lift and power data with which to compare to the CFD; hopefully it comes out as well as the predictions on your blog.

Just one more little bit, when running the f file you give the units of force as N/m, is this a typo? Or do you mean N/m of span length, if so, what's the point in changing the span length in the code?

Also, do you have a name for me to reference and acknowledge in my report, or would you rather be named as lordvon?

Thanks,

Tom
thsb20 is offline   Reply With Quote

Old   April 15, 2014, 19:36
Default
  #47
Senior Member
 
Robert
Join Date: Sep 2010
Posts: 158
Rep Power: 16
lordvon is on a distinguished road
Glad I could help. That is very cool that you built a physical model; I am looking forward to seeing your paper when it becomes available!

Yes, N/m would be a typo. It is consistent if the variable 'span' is absent or equal to 1. I added 'span' later and forgot to delete '/m' from the text display. The forces are calculated by first normalizing per unit span, then simply multiplied by 'span'. So the resultant calculated forces and powers are proportional to 'span'. If you changed the cell depth in the mesh be sure to change it in 'cellDepth' in the 'f' script. To check what your cell depth is, you can run checkMesh and the non-zero z-value for bounding box will be it.

Another note, the 'average' values displayed are the averages of the plots you see. So you should take the average as the correct value if the plot mean settles and is not ramping up or down. You can control how much of the recorded time is plotted by 'cutoffFraction'. you may have already known this, but I just wanted to make sure.

Thank you for giving me a mention in your report. You can use my real name, Robert Lee.
lordvon is offline   Reply With Quote

Old   April 20, 2014, 22:29
Default
  #48
Senior Member
 
Robert
Join Date: Sep 2010
Posts: 158
Rep Power: 16
lordvon is on a distinguished road
Hi Tom,
How were the results?
lordvon is offline   Reply With Quote

Old   April 27, 2014, 07:38
Default
  #49
New Member
 
Tom Brown
Join Date: Mar 2014
Posts: 27
Rep Power: 12
thsb20 is on a distinguished road
Hi Robert,

Sorry for the delay. The results are good (ish); Ive got to do a little fudging and the results come out really nice.

First thing is the force and power come out 4x smaller than measured. I think that this comes from the fact im using a 400mm span, and thats where the 4 is coming into it. Or maybe I changed the mesh depth a little. I havnt looked thoroughly into the code to check but I know where to look. But running over different speeds and angle of attacks the 4x is constant, so I think there is something in the code.

The Power on the experimental set-up has an offset of 27W compared to the CFD. This can be accounted for in the fact that this power also goes to the servo's and inefficiencies in the motor and bearing; for a set RPM the offset in constant over all angle of attacks. Once the offset is taken out, and the 4x is included, the data matches perfectly.

The lift data is in the right region but it doesn't follow the same trend as the experimental. I never got the NACA data implemented, so I think thats where these differences come into it. If I have time ill re-look into trying to implement the NACA aerofoil but for the time being the results look pretty nice.

Ive uploaded the three graphs; lift, power and lift to power ratio. The set-up used was:

4x aerofoils
100mm chord aerofoil
400mm span
400RPM
150mm Radius
Attached Images
File Type: jpg For Robert.jpg (17.5 KB, 25 views)
thsb20 is offline   Reply With Quote

Old   April 27, 2014, 12:29
Default
  #50
Senior Member
 
Robert
Join Date: Sep 2010
Posts: 158
Rep Power: 16
lordvon is on a distinguished road
Did you use the 'f' file to get the performance figures? Can you post it? I can see if it is consistent with your experimental parameters.
lordvon is offline   Reply With Quote

Old   April 27, 2014, 13:41
Default
  #51
New Member
 
Tom Brown
Join Date: Mar 2014
Posts: 27
Rep Power: 12
thsb20 is on a distinguished road
Ive attached the f file. The only thing Ive changed is the span to 0.4 and the omega to 41.888 (400RPM)
Attached Files
File Type: zip f.zip (1.2 KB, 8 views)
thsb20 is offline   Reply With Quote

Old   April 30, 2014, 12:48
Default
  #52
Senior Member
 
Robert
Join Date: Sep 2010
Posts: 158
Rep Power: 16
lordvon is on a distinguished road
It seems consistent, as long as you didn't change cellDepth in the mesh file, which I don't think you did because there is no reason to.

I do not think there is reason enough to fudge the numbers... I am sorry the results did not come out as well as you wanted.

I did not look at the scale of the power and lift until now, and I really think that the level of lift and power are very small. Perhaps the simulations are more accurate in the regime of high power loading. If you look at the graph in my blog post, if you zoom in on the data point with lowest power, you can construe this to be an inaccurate simulation. But the higher the lift and power loading (the useful simulations), the more accurate the simulations become.

I really think if you did a higher rpm, the results would be more accurate. (it looks like you did one rpm and changed the pitch)

There are a lot of interesting things that occur in experiment that is less than ideal. One example is the significant bending of the blades due to centrifugal forces so that the effective pitch is lower than that apparent on the blade. This is noted to have significant detrimental effects in papers by Moble Benedict. It would not explain your particular discrepancies, though, but it is good to be aware of such possibilities.

The only troubleshooting I can think of right now is to make sure you let the forces and power figures settle down; i.e. let them run for a long time to be sure the average stays reasonably constant. Due to the boundary condition setup, the forces and powers take a while to settle. In my experience, the average has some asymptotic behavior and changes a significant amount.
lordvon is offline   Reply With Quote

Old   July 29, 2016, 08:42
Default
  #53
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Hello all,

Firstofall, Robert, thanks for your work. The video on youtube looks quite interesting. However I have problems compiling the code and would appreciate some help.

These are the steps I took:
1) Download the zipped OpenFOAM_Additions-master folder and extract it
2) Open Terminal and go to the cycloRamp folder
3) Enter the following commands as described in the INSTRUCTIONS file:
Code:
sudo
Code:
chmod +x remake
Code:
./remake
I get the output as follows:

Code:
kate@linux-sb34:~/OpenFOAM/kate-4.x/run/lordvon/OpenFOAM_Additions-master/cycloRamp> sudo
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
            [command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
            prompt] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
            prompt] [-u user] file ...
kate@linux-sb34:~/OpenFOAM/kate-4.x/run/lordvon/OpenFOAM_Additions-master/cycloRamp> chmod +x remake
kate@linux-sb34:~/OpenFOAM/kate-4.x/run/lordvon/OpenFOAM_Additions-master/cycloRamp> ./remake
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file cycloRamp.C
g++ -std=c++0x -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -I/home/kate/OpenFOAM/OpenFOAM-4.x/src/dynamicFvMesh/lnInclude -I/home/kate/OpenFOAM/OpenFOAM-4.x/src/dynamicFvMesh/solidBodyMotionFvMesh/lnInclude -IlnInclude -I. -I/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude -I/home/kate/OpenFOAM/OpenFOAM-4.x/src/OSspecific/POSIX/lnInclude   -fPIC -c cycloRamp.C -o Make/linux64GccDPInt32Opt/cycloRamp.o
cycloRamp.C: In member function ‘virtual Foam::septernion Foam::solidBodyMotionFunctions::cycloRamp::transformation() const’:
cycloRamp.C:101:33: error: no matching function for call to ‘Foam::quaternion::quaternion(int, int, double&)’
     quaternion R(0,0,azimuth.z());
                                 ^
cycloRamp.C:101:33: note: candidates are:
In file included from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/septernion.H:45:0,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/dynamicFvMesh/lnInclude/solidBodyMotionFunction.H:48,
                 from cycloRamp.H:38,
                 from cycloRamp.C:26:
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternion.H:165:9: note: Foam::quaternion::quaternion(Foam::Istream&)
         quaternion(Istream&);
         ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternion.H:165:9: note:   candidate expects 1 argument, 3 provided
In file included from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternion.H:304:0,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/septernion.H:45,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/dynamicFvMesh/lnInclude/solidBodyMotionFunction.H:48,
                 from cycloRamp.H:38,
                 from cycloRamp.C:26:
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:175:8: note: Foam::quaternion::quaternion(const tensor&)
 inline Foam::quaternion::quaternion
        ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:175:8: note:   candidate expects 1 argument, 3 provided
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:87:8: note: Foam::quaternion::quaternion(Foam::quaternion::rotationSequence, const vector&)
 inline Foam::quaternion::quaternion
        ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:87:8: note:   candidate expects 2 arguments, 3 provided
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:74:8: note: Foam::quaternion::quaternion(const vector&)
 inline Foam::quaternion::quaternion(const vector& v)
        ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:74:8: note:   candidate expects 1 argument, 3 provided
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:67:8: note: Foam::quaternion::quaternion(Foam::scalar)
 inline Foam::quaternion::quaternion(const scalar w)
        ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:67:8: note:   candidate expects 1 argument, 3 provided
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:46:8: note: Foam::quaternion::quaternion(const vector&, Foam::scalar, bool)
 inline Foam::quaternion::quaternion
        ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:46:8: note:   no known conversion for argument 1 from ‘int’ to ‘const vector& {aka const Foam::Vector<double>&}’
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:39:8: note: Foam::quaternion::quaternion(const vector&, Foam::scalar)
 inline Foam::quaternion::quaternion(const vector& d, const scalar theta)
        ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:39:8: note:   candidate expects 2 arguments, 3 provided
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:32:8: note: Foam::quaternion::quaternion(Foam::scalar, const vector&)
 inline Foam::quaternion::quaternion(const scalar w, const vector& v)
        ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:32:8: note:   candidate expects 2 arguments, 3 provided
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:28:8: note: Foam::quaternion::quaternion()
 inline Foam::quaternion::quaternion()
        ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:28:8: note:   candidate expects 0 arguments, 3 provided
In file included from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/septernion.H:45:0,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/dynamicFvMesh/lnInclude/solidBodyMotionFunction.H:48,
                 from cycloRamp.H:38,
                 from cycloRamp.C:26:
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternion.H:61:7: note: Foam::quaternion::quaternion(const Foam::quaternion&)
 class quaternion
       ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternion.H:61:7: note:   candidate expects 1 argument, 3 provided
cycloRamp.C:103:29: error: no matching function for call to ‘Foam::quaternion::quaternion(int, int, Foam::scalar)’
     quaternion R2(0,0,-pitch);
                             ^
cycloRamp.C:103:29: note: candidates are:
In file included from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/septernion.H:45:0,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/dynamicFvMesh/lnInclude/solidBodyMotionFunction.H:48,
                 from cycloRamp.H:38,
                 from cycloRamp.C:26:
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternion.H:165:9: note: Foam::quaternion::quaternion(Foam::Istream&)
         quaternion(Istream&);
         ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternion.H:165:9: note:   candidate expects 1 argument, 3 provided
In file included from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternion.H:304:0,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/septernion.H:45,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/dynamicFvMesh/lnInclude/solidBodyMotionFunction.H:48,
                 from cycloRamp.H:38,
                 from cycloRamp.C:26:
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:175:8: note: Foam::quaternion::quaternion(const tensor&)
 inline Foam::quaternion::quaternion
        ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:175:8: note:   candidate expects 1 argument, 3 provided
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:87:8: note: Foam::quaternion::quaternion(Foam::quaternion::rotationSequence, const vector&)
 inline Foam::quaternion::quaternion
        ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:87:8: note:   candidate expects 2 arguments, 3 provided
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:74:8: note: Foam::quaternion::quaternion(const vector&)
 inline Foam::quaternion::quaternion(const vector& v)
        ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:74:8: note:   candidate expects 1 argument, 3 provided
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:67:8: note: Foam::quaternion::quaternion(Foam::scalar)
 inline Foam::quaternion::quaternion(const scalar w)
        ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:67:8: note:   candidate expects 1 argument, 3 provided
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:46:8: note: Foam::quaternion::quaternion(const vector&, Foam::scalar, bool)
 inline Foam::quaternion::quaternion
        ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:46:8: note:   no known conversion for argument 1 from ‘int’ to ‘const vector& {aka const Foam::Vector<double>&}’
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:39:8: note: Foam::quaternion::quaternion(const vector&, Foam::scalar)
 inline Foam::quaternion::quaternion(const vector& d, const scalar theta)
        ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:39:8: note:   candidate expects 2 arguments, 3 provided
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:32:8: note: Foam::quaternion::quaternion(Foam::scalar, const vector&)
 inline Foam::quaternion::quaternion(const scalar w, const vector& v)
        ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:32:8: note:   candidate expects 2 arguments, 3 provided
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:28:8: note: Foam::quaternion::quaternion()
 inline Foam::quaternion::quaternion()
        ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternionI.H:28:8: note:   candidate expects 0 arguments, 3 provided
In file included from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/septernion.H:45:0,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/dynamicFvMesh/lnInclude/solidBodyMotionFunction.H:48,
                 from cycloRamp.H:38,
                 from cycloRamp.C:26:
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternion.H:61:7: note: Foam::quaternion::quaternion(const Foam::quaternion&)
 class quaternion
       ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/quaternion.H:61:7: note:   candidate expects 1 argument, 3 provided
In file included from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/token.H:49:0,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/UListIO.C:28,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/UList.C:233,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/UList.H:484,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/List.H:43,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/HashTable.C:30,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/HashTable.H:555,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/objectRegistry.H:38,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/Time.H:42,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/dynamicFvMesh/lnInclude/solidBodyMotionFunction.H:46,
                 from cycloRamp.H:38,
                 from cycloRamp.C:26:
/home/kate/OpenFOAM/OpenFOAM-4.x/src/dynamicFvMesh/lnInclude/solidBodyMotionFunction.H: In instantiation of ‘static Foam::autoPtr<Foam::solidBodyMotionFunction> Foam::solidBodyMotionFunction::adddictionaryConstructorToTable<solidBodyMotionFunctionType>::New(const Foam::dictionary&, const Foam::Time&) [with solidBodyMotionFunctionType = Foam::solidBodyMotionFunctions::cycloRamp]’:
/home/kate/OpenFOAM/OpenFOAM-4.x/src/dynamicFvMesh/lnInclude/solidBodyMotionFunction.H:90:9:   required from ‘Foam::solidBodyMotionFunction::adddictionaryConstructorToTable<solidBodyMotionFunctionType>::adddictionaryConstructorToTable(const Foam::word&) [with solidBodyMotionFunctionType = Foam::solidBodyMotionFunctions::cycloRamp]’
cycloRamp.C:41:5:   required from here
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/runTimeSelectionTables.H:72:64: error: cannot allocate an object of abstract type ‘Foam::solidBodyMotionFunctions::cycloRamp’
             return autoPtr<baseType>(new baseType##Type parList);              \
                                                                ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/dynamicFvMesh/lnInclude/solidBodyMotionFunction.H:90:9: note: in expansion of macro ‘declareRunTimeSelectionTable’
         declareRunTimeSelectionTable
         ^
In file included from cycloRamp.C:26:0:
cycloRamp.H:53:7: note:   because the following virtual functions are pure within ‘Foam::solidBodyMotionFunctions::cycloRamp’:
 class cycloRamp
       ^
In file included from cycloRamp.H:38:0,
                 from cycloRamp.C:26:
/home/kate/OpenFOAM/OpenFOAM-4.x/src/dynamicFvMesh/lnInclude/solidBodyMotionFunction.H:110:50: note:     virtual Foam::autoPtr<Foam::solidBodyMotionFunction> Foam::solidBodyMotionFunction::clone() const
         virtual autoPtr<solidBodyMotionFunction> clone() const = 0;
                                                  ^
In file included from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/token.H:49:0,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/UListIO.C:28,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/UList.C:233,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/UList.H:484,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/List.H:43,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/HashTable.C:30,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/HashTable.H:555,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/objectRegistry.H:38,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/Time.H:42,
                 from /home/kate/OpenFOAM/OpenFOAM-4.x/src/dynamicFvMesh/lnInclude/solidBodyMotionFunction.H:46,
                 from cycloRamp.H:38,
                 from cycloRamp.C:26:
/home/kate/OpenFOAM/OpenFOAM-4.x/src/dynamicFvMesh/lnInclude/solidBodyMotionFunction.H: In static member function ‘static Foam::autoPtr<Foam::solidBodyMotionFunction> Foam::solidBodyMotionFunction::adddictionaryConstructorToTable<solidBodyMotionFunctionType>::New(const Foam::dictionary&, const Foam::Time&) [with solidBodyMotionFunctionType = Foam::solidBodyMotionFunctions::cycloRamp]’:
/home/kate/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/runTimeSelectionTables.H:73:9: warning: control reaches end of non-void function [-Wreturn-type]
         }                                                                      \
         ^
/home/kate/OpenFOAM/OpenFOAM-4.x/src/dynamicFvMesh/lnInclude/solidBodyMotionFunction.H:90:9: note: in expansion of macro ‘declareRunTimeSelectionTable’
         declareRunTimeSelectionTable
         ^
/home/kate/OpenFOAM/OpenFOAM-4.x/wmake/rules/General/transform:8: recipe for target 'Make/linux64GccDPInt32Opt/cycloRamp.o' failed
make: *** [Make/linux64GccDPInt32Opt/cycloRamp.o] Error 1
root's password:
cp: cannot stat ‘/home/kate/OpenFOAM/kate-4.x/platforms/linux64GccDPInt32Opt/lib/libCycloRamp.so’: No such file or directory
kate@linux-sb34:~/OpenFOAM/kate-4.x/run/lordvon/OpenFOAM_Additions-master/cycloRamp>
As you can see, there seem to be some problems with the quaternions. I already tried on different PCs and somehow can't believe that this procedure works for other people. I would be thankful for every advice.

Best regards,

Kate

(I'm running OpenFoam 4.x)
KateEisenhower is offline   Reply With Quote

Old   July 29, 2016, 10:25
Default
  #54
Senior Member
 
Robert
Join Date: Sep 2010
Posts: 158
Rep Power: 16
lordvon is on a distinguished road
Hi Kate,

It's always great to see people working on these interesting concepts (even though it's my personal opinion that cyclorotors are generally impractical, but hey, that heavily depends on the use case!).

You'll notice that I made that post 2 years ago; compatibility is (slightly) broken between even the latest OpenFOAM 2.x and the earliest 3.x. Now, with v1606, I believe it will be broken even further. By the way, what is this OpenFOAM v4 you are referencing? I haven't heard of it.

Unfortunately I do not have the time right now to convert the case (I don't even have a Linux box at the moment). So, the only thing I can suggest is to ask around for help. Sorry, but good luck with your endeavors and be sure to update us!
lordvon is offline   Reply With Quote

Old   August 2, 2016, 05:37
Default
  #55
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Hi Robert,

thanks for your answer! No problem, I'll try it myself. I just thought mayhaps somebody had solved this problem already.
OpenFOAM 4.x is the newest release afaik.?? What is v1606 you are referencing?

Best regards,

Kate
KateEisenhower is offline   Reply With Quote

Old   August 23, 2016, 11:30
Default
  #56
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Hello Robert,

I am running your code on OpenFOAM 2.2.2 now and it works perfectly. However, I am trying to plot the blade0 forces over its actual position.
Would you mind to explain in a view words how you are calculating the quaternion rotation in your cycloRamp.C file. I don't get the following part:

Code:
quaternion R(0,0,azimuth.z()); // I think you are refering to the quaternion.C file here. I think 0, 0, azimuth.z() are the Euler-angles. What is R?
septernion TR(septernion(COFR_)*R*septernion(-COFR_));
quaternion R2(0,0,-pitch);
TR=septernion(bladeCofr)*R2*septernion(-bladeCofr)*TR;
Info<< "solidBodyMotionFunctions::cycloRamp::transformation(): "
<< "Time = " << t << " transformation: " << TR << endl;
return TR;
Following is an excerpt of my log file:
Code:
solidBodyMotionFunctions::rampedAxisRotationMotion::transformation(): Time = 37.340491 transformation: ((0 0 0) (0.99645632 (0 0 -0.084111854)))
solidBodyMotionFunctions::cycloRamp::transformation(): Time = 37.340491 transformation: ((0.0013159147 -0.00021623326 0) (0.9969083 (0 0 -0.078573737)))
solidBodyMotionFunctions::cycloRamp::transformation(): Time = 37.340491 transformation: ((-0.0088315325 -0.0095515413 0) (0.99043233 (0 0 -0.1379993)))
solidBodyMotionFunctions::cycloRamp::transformation(): Time = 37.340491 transformation: ((0.0041746048 -0.013719073 0) (0.98965024 (0 0 -0.14350052)))
solidBodyMotionFunctions::cycloRamp::transformation(): Time = 37.340491 transformation: ((0.0013134305 -0.00023084347 0) (0.99597357 (0 0 -0.089647375)))
solidBodyMotionFunctions::cycloRamp::transformation(): Time = 37.340491 transformation: ((-0.0077457131 -0.010451404 0) (0.99955059 (0 0 -0.029977104)))
solidBodyMotionFunctions::cycloRamp::transformation(): Time = 37.340491 transformation: ((0.0057813158 -0.013123135 0) (0.99970172 (0 0 -0.024422629)))
I always thought quaternion rotation is composed of one vector and one scalar in OpenFOAM. How can I calculate the actual position of blade0 from these numbers?

As you can see, a big part of the problem is my lack of understanding in the field of quaternion rotation. Any advice would be appreciated.

Best regards, Kate
KateEisenhower is offline   Reply With Quote

Old   August 24, 2016, 05:24
Default
  #57
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Hello again,

for everyone, who's interested, I've solved my little problem. You can calculate the corresponding Euler-angles with the attached script.

Best regards,

Kate
Attached Files
File Type: gz euler_from_quaternion.py.tar.gz (10.0 KB, 5 views)
KateEisenhower 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
something wrong when compiling udf, however the code is correct when interpreting richard ben Fluent UDF and Scheme Programming 7 May 11, 2013 08:36
problem with compiling the source code michel1988 OpenFOAM Installation 1 April 17, 2013 18:19
The FOAM Documentation Project - SHUT-DOWN holger_marschall OpenFOAM 242 March 7, 2013 13:30
Small 3-D code Zdravko Stojanovic Main CFD Forum 2 July 19, 2010 11:11
Newbie compiling source code for debugging unoder OpenFOAM Running, Solving & CFD 8 August 24, 2006 02:41


All times are GMT -4. The time now is 12:20.