myFoam icon indicating copy to clipboard operation
myFoam copied to clipboard

sinwave case: rhoPimpleFoam vs lusgsFoam (Euler & forward ddt scheme)

Open jiaqiwang969 opened this issue 3 years ago • 7 comments

Hi, furstj I am quite interested in your work. I compared rhoPimpleFoam and lusgsFoam solver. The results could be found here.

Some Concerns:

  • lusgsFoam with forward ddt scheme is broken, which I cannot comprare with rhoPimpleFoam (forward) case.
  • rhoPimpleFoam seems more non-linear than lusgsFoam. see Euler case. (Upper and lower waveform asymmetry in rhoPimpleFoam, but symmetry in lusgsFoam)

Any ideas or suggestions for improving my cases?

jiaqiwang969 avatar Feb 14 '22 14:02 jiaqiwang969

Hi @jiaqiwang969

the LU-SGS scheme is not compatible with forwrd ddt (I mean the explicit Euler). It has to be used with an implicit ddt (i.e. Euler or backward). In the case of time-dependent problems the solver uses dual time stepping technique, i.e. it should use more internal iterations. I run your sinwave case wit lusgs + backward ddt with following (sub-optimal) setup inside fvSolution: LUSGS { internalIterations 10; localTimestepping true; relTol 1.e-3; tolerance 1.e-4; } Note that I didn't try to "optimize" the number of internal iterations or tolerances. May be that the code will run with fever internal iterations as well.

In any case, the LU-SGS solver aims to implicit time stepping for steady state or quasi-steady problems with large time steps. For the sine wave I would recommend rather the rhoCentralFoam or an explicit dbns solvers.

furstj avatar Feb 14 '22 15:02 furstj

Sorry,Written error, I mean backward.

jiaqiwang969 avatar Feb 14 '22 16:02 jiaqiwang969

Well, you have to use more internal iterations then. You should try to find a good compromise between speed and accuracy obtained with higher number of iterations and computational time.

furstj avatar Feb 14 '22 16:02 furstj

Yes, the backward case works now, I have concluded it again.

  1. for Euler method, LU-SGS solver is effective, 34.11 s vs 142.55s (rhoPimpleFoam). However, 184s vs 153.13 for backward method.
  2. At the moment, I am still very sceptical about the correctness of the results, even if they are BACKWARD, and for LU-SGS the amplitude of probe signal even increases gradually, which seems unreasonable.

As your suggestion, I will keep on with dbns solver. Thanks~

jiaqiwang969 avatar Feb 14 '22 17:02 jiaqiwang969

Well, you have to use more internal iterations then. You should try to find a good compromise between speed and accuracy obtained with higher number of iterations and computational time.

I will try it.

jiaqiwang969 avatar Feb 14 '22 17:02 jiaqiwang969

Well, you have to use more internal iterations then. You should try to find a good compromise between speed and accuracy obtained with higher number of iterations and computational time.

I will try it.

It converged when iteration set to 50, and waveform becomes symmetry which is better than rhoPimpleFoam with same time setting.

jiaqiwang969 avatar Feb 14 '22 17:02 jiaqiwang969

Very good. On the other hand with 50 iterations the LUSGS would be deadly slow. In any case, the explicit dbns (foam extend?) would be better choice for this kind of problems.

furstj avatar Feb 15 '22 13:02 furstj