Can OpenFOAM give an resistance/velocity curve as output?
Dear all
I'm new with openFOAM and I'm trying to simulate te resistance of a small boat in OpenFOAM after it didn't succeed in FLOW3D due to the inability to simulate skin friction. I'm quite new so I want to now:
Cheers Lim 
Lim,
In answer to your questions: 1) Yes it is possible to develop a series of runs at different speeds to develop a resistance curve for a hull (you need to have different boundary layer meshes at each speed to maintain the same y+ value). 2) You can use either interFoam or LTSinterFoam for fixed heave and trim cases or interDyMFoam for cases where trim and heave matter (though with some effort and no guarantee of it being entirely stable). Alternatively consider using the modified solver shipFoam. 3) The solution accuracy is only as good as your mesh, boundary conditions and solver setting permit which in large part comes down to experience. If those are good your accuracy should be as well. Consider using a standard validation case such as a Wigley hull as a way to validate your setup is correct and if possible validate against tank test data of your actual hull if available. Regards, Dave 
how to get the resistance?
how do i use shipFoam?
and if i use LTSInterFoam and get U and P, how can i calculate the resirance? is there a solver/code for that? or i need to go to matlab and integrate the data for the pressure and velocity?.. thanks, 
The integration of forces can be done using the forces library. You place in the controlDict file:
libs ( "libforces.so" ); functions ( forces { type forces; functionObjectLibs ("libforces.so"); log true; outputControl timeStep; outputInterval 5; patches (hull); //Name of patche to integrate forces rhoInf 1025.0; //Reference density for fluid  can be changed later ... CofR (3.23 0 1.21); //Origin for moment calculations } ); For more details, about the forces library search "forces in OF 1.6" (might be OF 1.5, I forget which) in the forum. There is a example file set for shipFoam in the ship OF hydrodynamics group, though you should know that shipFoam currently doesn't work for OF 1.7 or 2.0, though it does work in 1.6. 
Hi daveatstyacht
I'v run the Foam with the "controlDict" and got the "forces" and "forceCoeffs" folders. Each folder has "forces.dat" and "forceCoeffs.dat". Could you give me some guides how to visualize the data? thanks hs// 
You can load those data within whatever software you like and then plot them…
Some examples: matlab gnuplot excel libreoffice calc openoffice calc kaleidagraph origin … … 
thanks
hs// 
Hi
Do you have any reference to interpret the result of calculations (forces and forceCoeffs)? thanks again hs// 
The first column is the iteration/time, the second one is the force/force coefficient.

Hi
sorry for uncertain question, English is my second language. I mean, 1) In "forces.dat", can i calculate "pressure force" and "viscous force" at specific time as "Pf= SRT[(Pf_x)^2 + (Pf_y)^2 +(Pf_z)^2]" and "Vf= SRT[(Vf_x)^2 + (Vf_y)^2 +(Vf_z)^2]" ? and is Total_forces on the hull surface, "Tf= Pf + Vf" ? 2) In "forcesCoeffs.dat", Cd, Cl, and Cm are just coefficients, right? How can I use these coefficients to calculate Resistance, Lift, and Pitch ? I think frictional resistance of hull can be calculated as "(1/2)*rho*(v^2)*wetted_surface_area*Cd". 3) In each file, there are "forces" and "coefficients" for each iteration. The last iterated value is used to calculate forces or drag for the hull ? or calculate each forces or drag at each iteration then sum whole iteration ? thanks again, hs// 
Hi lovecraft22
Do you have any comment about above post? thanks hs// 
1. Don't have experience on free surface flow. Anyway what you get in forces is the total force, i.e. pressure and viscous force.
2. Yes, depending on how you define them you should change the reference area. 3. You should use the values for some converged iterations and the average them. Let's say your simulation converged at time 1000. Keep it running until time 1500 then average the last 500 values. 
hi
in "forces.dat", there are "force(viscous, pressure)" and "moment(viscous, pressure)". # Time forces(pressure, viscous) moment(pressure, viscous) 10 (((115911 9821.58 1.76054e+06) (477.818 0.216173 22.1441)) ((8560.4 6.33051e+06 35146.9) (2.9727 466.215 16.1051))) 20 (((10768.1 182.562 166635) (455.248 0.138734 11.4165)) ((1585.44 703266 1934.63) (2.10171 392.186 12.8028))) 30 (((5886.75 4.82486 131072) (433.074 0.192013 4.92419)) ((143.617 875162 240.688) (1.58389 350.027 12.3352))) ~ ~ ~ ~ hs// 
2. Yes, depending on how you define them you should change the reference area.
> in my case, the reference area is hull wetted_surface_area. 
3. You should use the values for some converged iterations and the average them. Let's say your simulation converged at time 1000. Keep it running until time 1500 then average the last 500 values.
> i got the "forceCoeffs.dat" as below, for instance, to calculate Drag of the hull, Cd is average value of (Cd@10 + ....+Cd@300)/30 ? # Time Cd Cl Cm 10 0.000128828 1.98816e06 2.01831e06 20 6.78435e05 7.86827e07 3.79263e07 30 5.26177e05 6.45394e07 5.54262e07 40 4.73338e05 1.32233e06 3.19874e07 50 4.66191e05 2.57221e07 5.23645e07 60 4.69513e05 1.30883e06 7.36664e07 70 4.87506e05 2.55959e06 9.88149e07 80 5.18026e05 5.86174e06 1.40848e06 90 5.50988e05 7.95755e06 2.02403e06 100 5.82616e05 1.18472e05 2.42179e06 110 6.24615e05 1.48948e05 3.16372e06 120 6.67133e05 1.71842e05 3.69373e06 130 7.01388e05 2.16093e05 3.88813e06 140 7.37891e05 2.29909e05 4.06339e06 150 7.88668e05 2.15329e05 3.43333e06 160 8.11324e05 2.05101e05 2.83645e06 170 8.33297e05 1.70105e05 1.6466e06 180 8.39984e05 9.09247e06 1.45903e07 190 8.49289e05 6.11879e07 1.09168e06 200 8.51563e05 7.23095e06 1.76413e06 210 8.39894e05 1.14279e05 1.89112e06 220 8.31182e05 1.49578e05 1.98931e06 230 8.18796e05 1.62699e05 1.88601e06 240 8.0021e05 1.76896e05 1.97983e06 250 7.93598e05 2.16389e05 2.34374e06 260 7.80435e05 1.94241e05 2.54275e06 270 7.87433e05 1.72517e05 2.01372e06 280 7.56193e05 2.29923e05 2.81159e06 290 7.38596e05 2.18482e05 2.97748e06 300 7.23155e05 2.42475e05 2.92539e06 
All times are GMT 4. The time now is 21:14. 