# moving reference frame - weird results!

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

 July 28, 2011, 03:53 moving reference frame - weird results! #1 Senior Member     Amir Join Date: May 2009 Location: Shiraz, Iran Posts: 739 Blog Entries: 1 Rep Power: 14 Hi experts, I'm a newbie in OF and I have tried to change simpleFoam solver to achieve oscillatory reference frame, it seems that it's not a big deal but I faced weird results. I did these changes: Code: ```scalar Pi = mathematicalConstant::pi; dimensionedVector omega ( "omega", dimensionSet(0, 0, -1, 0, 0, 0, 0), vector (0.0, 0.0, (amp*(2.0*Pi*freq)*Foam::cos((2.0*Pi*freq)*runTime.value()))) ); dimensionedVector alpha ( "alpha", dimensionSet(0, 0, -2, 0, 0, 0, 0), vector (0.0, 0.0, (-amp*pow(2.0*Pi*freq,2)*Foam::sin((2.0*Pi*freq)*runTime.value()))) ); volVectorField source = (2.0*omega ^ U) + (omega ^ (omega ^ mesh.C())) + (alpha ^ mesh.C());``` and: Code: ``` tmp UEqn ( fvm::ddt(U) + fvm::div(phi, U) - fvm::laplacian(nu, U) == -source );``` did I make any mistake? Any suggestion or experience in this field is really appreciated. Amir Last edited by Amir; July 28, 2011 at 04:45.

 July 29, 2011, 01:54 #2 Senior Member     Amir Join Date: May 2009 Location: Shiraz, Iran Posts: 739 Blog Entries: 1 Rep Power: 14 I'm waiting for your kind response .....

 July 30, 2011, 03:21 #3 Senior Member   Alberto Passalacqua Join Date: Mar 2009 Location: Ames, Iowa, United States Posts: 1,894 Rep Power: 26 Oscillatory system (=unsteady) in steady state solver (simpleFoam)? __________________ Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image. OpenQBMM - An open-source implementation of quadrature-based moment methods

July 30, 2011, 04:23
#4
Senior Member

Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 739
Blog Entries: 1
Rep Power: 14
Quote:
 Originally Posted by alberto Oscillatory system (=unsteady) in steady state solver (simpleFoam)?
Dear Alberto,

I have added the transient term to UEqn., fvm::ddt(U); I have used unsteady simpleFoam instead of icoFoam because it's more stable and I could use larger time steps. Do you mean this procedure is incorrect?

Amir

 July 30, 2011, 04:34 #5 Senior Member   Alberto Passalacqua Join Date: Mar 2009 Location: Ames, Iowa, United States Posts: 1,894 Rep Power: 26 Are you doing sub-interations inside each time step? You can find it already done in pimpleFoam. Best, __________________ Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image. OpenQBMM - An open-source implementation of quadrature-based moment methods

July 30, 2011, 04:44
#6
Senior Member

Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 739
Blog Entries: 1
Rep Power: 14
Quote:
 Originally Posted by alberto Are you doing sub-interations inside each time step? You can find it already done in pimpleFoam. Best,
Is it really necessary? pimpleFoam is a combination of piso and simple algorithms and I don't want to engage in small time steps?!

Thanks

 July 30, 2011, 15:32 #7 Senior Member   Alberto Passalacqua Join Date: Mar 2009 Location: Ames, Iowa, United States Posts: 1,894 Rep Power: 26 Hi, to answer your question you should know if your system reaches a steady state or not. Since it is intrinsically unsteady, it might never reach one. Anyway, to use SIMPLE for unsteady calculations you should: Start the time stepDefine UEqn Relax and solve UEqn Define fluxes Solve pEqn Correct fluxes Explicitly relax p Correct U Repeat from 1 until convergence at the given time-step is reached Advance time-step PIMPLE is a combination of SIMPLE and PISO for unsteady calculations with larger time-steps or for pseudo-transient cases, which is why I suggested it. Best, Amir likes this. __________________ Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image. OpenQBMM - An open-source implementation of quadrature-based moment methods

 July 30, 2011, 15:45 #8 Senior Member     Amir Join Date: May 2009 Location: Shiraz, Iran Posts: 739 Blog Entries: 1 Rep Power: 14 Dear Alberto, Thanks a lot for your valuable comments. Amir

August 3, 2011, 07:29
#9
Senior Member

Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 739
Blog Entries: 1
Rep Power: 14
Dear Alberto,
I did your recommandations, but now, I have a problem in convergency.
I change both pimpleFoam and also pisoFoam but convergency issues exist. I couldn't reduce initail residuals in this case, consequently, there are some differences between results and analytic solution.
Do you have any recommendation about another schemes or others?
I used different grids and also schemes but I couldn't achieve better convergency.
Attached Images
 linear.png (5.2 KB, 21 views) courant.png (4.8 KB, 19 views)
Attached Files
 fvSchemes.txt (1.4 KB, 16 views) fvSolution.txt (1.2 KB, 5 views)

 August 3, 2011, 10:17 #10 Senior Member   Alberto Passalacqua Join Date: Mar 2009 Location: Ames, Iowa, United States Posts: 1,894 Rep Power: 26 The residual behaviour seems to show the solution is oscillating, which might indicate also a problem in the case setup. However, you are using inconsistent numerical schemes: "linearUpwind" should use the same gradient scheme you use for the variable, so: "div(phi, U) Gauss linearUpwindV leastSquares". you should use "linear" instead than "fourth" for Laplacian. My two cents: start with "Euler" for time integration, and use "cellLimited Gauss linear 1" for gradients, and, if necessary, upwind for convection. Best, __________________ Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image. OpenQBMM - An open-source implementation of quadrature-based moment methods

August 3, 2011, 11:39
#11
Senior Member

Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 739
Blog Entries: 1
Rep Power: 14
Quote:
 Originally Posted by alberto The residual behaviour seems to show the solution is oscillating, which might indicate also a problem in the case setup. However, you are using inconsistent numerical schemes: "linearUpwind" should use the same gradient scheme you use for the variable, so: "div(phi, U) Gauss linearUpwindV leastSquares". you should use "linear" instead than "fourth" for Laplacian. My two cents: start with "Euler" for time integration, and use "cellLimited Gauss linear 1" for gradients, and, if necessary, upwind for convection. Best,
Thank you very much Alberto,
Although the results are better know but there are some differences between this results and analytic one.
Anyway, I just want to ensure that whether the solution is converged or not; you said before that in unsteady cases, initial residuals should be around 0.001. Is this criteria acceptable in such cases (oscillatory nature)? (if your answer is No; how can we ensure that the solution is converged?)

Thanks again

 August 3, 2011, 11:53 #12 Senior Member   Alberto Passalacqua Join Date: Mar 2009 Location: Ames, Iowa, United States Posts: 1,894 Rep Power: 26 Yes, if you perform an unsteady calculation, the residuals should go down at each time step, until they reach the specified tolerance. Residuals clearly won't do that in a steady-state solver, simply because your system does not have a steady state solution. Best, __________________ Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image. OpenQBMM - An open-source implementation of quadrature-based moment methods

August 3, 2011, 14:35
#13
Senior Member

Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 739
Blog Entries: 1
Rep Power: 14
Quote:
 Originally Posted by alberto Yes, if you perform an unsteady calculation, the residuals should go down at each time step, until they reach the specified tolerance. Residuals clearly won't do that in a steady-state solver, simply because your system does not have a steady state solution. Best,
I imply from your answer that my result hasn't converged yet ... . I think you mean that initial residuals should oscillate around desired criteria, right? it's very difficult to reach this point even with your recommended schemes and different grids and time steps.

 August 6, 2011, 11:32 #14 Senior Member     Amir Join Date: May 2009 Location: Shiraz, Iran Posts: 739 Blog Entries: 1 Rep Power: 14 Dear friends, The problem is solved by implementing transientSimpleFoam solver instead of pimpleFoam or icoFoam. Thanks __________________ Amir

 August 6, 2011, 16:33 #15 Senior Member   Alberto Passalacqua Join Date: Mar 2009 Location: Ames, Iowa, United States Posts: 1,894 Rep Power: 26 Were you having problems with pimpleFoam? If yes, what kind of problems? There should be little difference compared to a "transient SIMPLE". __________________ Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image. OpenQBMM - An open-source implementation of quadrature-based moment methods

August 7, 2011, 03:15
#16
Senior Member

Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 739
Blog Entries: 1
Rep Power: 14
Quote:
 Originally Posted by alberto Were you having problems with pimpleFoam? If yes, what kind of problems? There should be little difference compared to a "transient SIMPLE".
Hi,

As I said before, my problem in both pimpleFoam and icoFoam was reducing initial residuals of p and U, I tried different schemes and solution controls and also time steps but I didn't achieve acceptable result particularly peak values in analytic solution; on the other hand, by transientSimpleFoam and with the same time step and schemes I achieved nice results matched with analytic one and both residuals reduced to about 0.01; I know that PISO algorithm is more precise that SIMPLE one but maybe my management for this algorithm was not efficient!
Can you explain the reason of that?
__________________
Amir

 August 7, 2011, 03:29 #17 Senior Member   Alberto Passalacqua Join Date: Mar 2009 Location: Ames, Iowa, United States Posts: 1,894 Rep Power: 26 Are you using the same relaxation factors in pimpleFoam and transient SIMPLE? If the setup is the same, they should give the same result. __________________ Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image. OpenQBMM - An open-source implementation of quadrature-based moment methods

August 7, 2011, 04:22
#18
Senior Member

Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 739
Blog Entries: 1
Rep Power: 14
Quote:
 Originally Posted by alberto Are you using the same relaxation factors in pimpleFoam and transient SIMPLE? If the setup is the same, they should give the same result.
Of course it is; URF,schemes,... are similar, even I examine pimpleFoam with lower time steps than transienSimpleFoam but the results are not acceptable. Maybe pimpleFoam needs different schemes for better convergence and accuracy.

Thanks,
__________________
Amir

 Tags mrf, oscillatory

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post jpo FLUENT 4 October 8, 2009 13:29 sadanand FLUENT 0 February 6, 2009 00:18 Bruno Main CFD Forum 1 January 30, 2007 01:34 Miguel Baritto CFX 4 August 31, 2006 12:02 Mark Render Main CFD Forum 1 November 27, 2002 08:20

All times are GMT -4. The time now is 06:59.