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

moving reference frame - weird results!

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

Like Tree1Likes
  • 1 Post By alberto

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 28, 2011, 04:53
Default moving reference frame - weird results!
  #1
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
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<fvVectorMatrix> 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 05:45.
Amir is offline   Reply With Quote

Old   July 29, 2011, 02:54
Default
  #2
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
I'm waiting for your kind response .....
Amir is offline   Reply With Quote

Old   July 30, 2011, 04:21
Default
  #3
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
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 in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   July 30, 2011, 05:23
Default
  #4
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Quote:
Originally Posted by alberto View Post
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
Amir is offline   Reply With Quote

Old   July 30, 2011, 05:34
Default
  #5
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
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 in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   July 30, 2011, 05:44
Default
  #6
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Quote:
Originally Posted by alberto View Post
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
Amir is offline   Reply With Quote

Old   July 30, 2011, 16:32
Default
  #7
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
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:
  1. Start the time step
    1. Define UEqn
    2. Relax and solve UEqn
    3. Define fluxes
    4. Solve pEqn
    5. Correct fluxes
    6. Explicitly relax p
    7. Correct U
    8. Repeat from 1 until convergence at the given time-step is reached
  2. 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 in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   July 30, 2011, 16:45
Default
  #8
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Dear Alberto,

Thanks a lot for your valuable comments.


Amir
Amir is offline   Reply With Quote

Old   August 3, 2011, 08:29
Default
  #9
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
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
File Type: png linear.png (5.2 KB, 23 views)
File Type: png courant.png (4.8 KB, 21 views)
Attached Files
File Type: txt fvSchemes.txt (1.4 KB, 16 views)
File Type: txt fvSolution.txt (1.2 KB, 5 views)
Amir is offline   Reply With Quote

Old   August 3, 2011, 11:17
Default
  #10
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
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:

  1. "linearUpwind" should use the same gradient scheme you use for the variable, so: "div(phi, U) Gauss linearUpwindV leastSquares".
  2. 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 in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   August 3, 2011, 12:39
Default
  #11
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Quote:
Originally Posted by alberto View Post
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:

  1. "linearUpwind" should use the same gradient scheme you use for the variable, so: "div(phi, U) Gauss linearUpwindV leastSquares".
  2. 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
Amir is offline   Reply With Quote

Old   August 3, 2011, 12:53
Default
  #12
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
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 in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   August 3, 2011, 15:35
Default
  #13
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Quote:
Originally Posted by alberto View Post
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.
Amir is offline   Reply With Quote

Old   August 6, 2011, 12:32
Default
  #14
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Dear friends,
The problem is solved by implementing transientSimpleFoam solver instead of pimpleFoam or icoFoam.

Thanks
__________________
Amir
Amir is offline   Reply With Quote

Old   August 6, 2011, 17:33
Default
  #15
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
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 in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   August 7, 2011, 04:15
Default
  #16
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Quote:
Originally Posted by alberto View Post
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
Amir is offline   Reply With Quote

Old   August 7, 2011, 04:29
Default
  #17
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
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 in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   August 7, 2011, 05:22
Default
  #18
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Quote:
Originally Posted by alberto View Post
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
Amir is offline   Reply With Quote

Reply

Tags
mrf, oscillatory

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Enabling Acceleration in Moving Reference Frame jpo FLUENT 4 October 8, 2009 14:29
Moving reference frame sadanand FLUENT 0 February 6, 2009 00:18
G95 + CGNS Bruno Main CFD Forum 1 January 30, 2007 01:34
Two-Phase Buoyant Flow Issue Miguel Baritto CFX 4 August 31, 2006 13:02
Transforming results in rotating reference frame Mark Render Main CFD Forum 1 November 27, 2002 08:20


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