CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Problem with diverging simulation (https://www.cfd-online.com/Forums/openfoam-solving/111359-problem-diverging-simulation.html)

batta31 January 4, 2013 12:22

Problem with diverging simulation
 
Hi to everyone guys, I really need some help! I'm running a 3D simulation with adjoint NS equations, but the simulation diverges (residuals seems to remain constant but the error explodes). I've heard that these kind of simulations are really sensitive, and so I would like to set up fvSchemes file with the most conservative/linear/first order schemes, in order to see if the problem is with mesh or with the solution.

Which kind of scheme could I use?

Any help is really much appreciated.
Thanks a lot

Simone

batta31 January 7, 2013 05:52

Any answer please?

immortality January 7, 2013 07:31

hi
Use euler method in schemes for more stability.whats the error?give it in code tag.

batta31 January 7, 2013 07:55

Hi thanks for your answer! My simulation is steady-state, so, where could I use Euler method? I was thinking about upwind method instead; could it be correct?

The error is about the adjoint continuity error, which explodes..:)

danvica January 7, 2013 08:21

Maybe this two posts could help you:

http://www.cfd-online.com/Forums/ope...tml#post370405

http://www.cfd-online.com/Forums/ope...tml#post366429

They seem to have quite basic setup...

batta31 January 8, 2013 03:28

Thank you for the answer Daniele but I had already tried and it didn't work..

sylvester January 9, 2013 10:13

As far as I know you can't get more stable/diffusive than with the settings printed below.

Possibly you can add some (cell/face) limiter on your gradient scheme (see for example http://www.openfoam.org/docs/user/fv...hp#x20-1120118 or http://openfoamwiki.net/index.php/Op...guide/Limiters or http://www.cfd-online.com/Forums/ope...tml#post281280).

Is it possible for you to share your setup?

Regards,
Sylvester

Quote:

ddtSchemes
{
default steadyState;
}

gradSchemes
{
default Gauss linear;
}

divSchemes
{
default Gauss upwind;
div((nuEff*dev(T(grad(U))))) Gauss linear;
div((nuEff*dev(T(grad(Ua))))) Gauss linear;
}

laplacianSchemes
{
default Gauss linear uncorrected;
}

interpolationSchemes
{
default linear;
}

snGradSchemes
{
default uncorrected;
}

fluxRequired
{
default no;
p;
pa;
}

batta31 January 9, 2013 11:12

1 Attachment(s)
Sure sylvester!

Quote:

ddtSchemes
{
default steadyState;

}

gradSchemes
{
default cellLimited Gauss linear 0;

grad(Ua) cellLimited Gauss upwind phia 0;
grad(pa) cellLimited Gauss upwind phia 0;

}

divSchemes
{
default Gauss linear;

div(phia) Gauss upwind;
div(-phi,Ua) Gauss upwind grad(Ua);
div((nuEff*dev(T(grad(Ua))))) Gauss upwind phia;

}

laplacianSchemes
{
default Gauss linear limited 0;

}

interpolationSchemes
{
default linear;
interpolate(Ua) upwind phia;
//interpolate(U) linear;

}

snGradSchemes
{
default limited 0;

}

fluxRequired
{
default no;
p ;
pa ;
phia ;

}
This is, I think, the most conservative configuration that I could use. I've also tried to put "1" instead of "0" in the limited schemes but nothing changed. I post you a screenshot of what happens after few iterations..

cheers

Simone

sylvester January 9, 2013 11:38

Hi,

Did you start the adjoint calculation with a (roughly) converged primal result? In my experience this is often required. Also updating the 'alpha' field only after you obtain a (roughly) converged adjoint field helps as well. Did you use a custom boundary condition/cost function, or did you use the one supplied with adjointShapeOptimizationFoam?

Are you sure your mesh quality is as good as you can get it? The transition from the prism layers to the rest of the domain appears to be a bit coarse to me.

regards,
Sylvester

batta31 January 9, 2013 11:54

Dear sylvester,

I'm performing shape optimization, not topological optimization as performed by adjointShapeOptimizationFoam solver, so I don't have the alpha field.

Instead, I can confirm you that the primal field that I use is "at convergence", so I don't think the problem is that.

By the way I suspect, as you said, that the problem could be with the transition between the "boundary layer" and the outer cells..so it could be a good idea to refine that zone? With the primal field no problem appears, but I think that the adjoint problem is a "bit" more sensitive..:)

sylvester January 11, 2013 10:16

Hi Simone,

I'm afraid I can't help you further, as it appears you have already tried all the easy solutions. I am curious though if improving your mesh solved the problem.

regards,
Sylvester

batta31 January 15, 2013 02:58

Hi again sylvester..I wanted to tell you that the divergence starting from the "spot" has disappeared. Actually, it turned out that checkMesh was failing with the non-orthogonality error..once I've corrected it, that divergence didn't showed up again. However I'm facing another trouble, now at the farfield. Have you ever experienced with your simulations a kind of instability that raises from there? I've tried to change the boundary conditions for the adjoint problem passing from "fixedValue" to "zeroGradient" both for adjoint velocity and adjoint pressure, but the error still remains..any idea??

P.s. now the checkMesh doesn't report any error

Cheers
Simone

sylvester January 15, 2013 03:33

Hi Simone,

Is it possible for you to share (pictures of) your case? It would really help in diagnosing possible problems.

Regarding the instability you see, does it resemble the one shown in the second picture in this post? http://www.cfd-online.com/Forums/ope...tml#post366429

regards,
Sylvester

batta31 January 15, 2013 05:32

I'll upload them as soon as possible! :) by the way it seems that the divergence occurs at the farfield to you too..did you fix the problem in some way?

batta31 January 15, 2013 08:13

2 Attachment(s)
Here's the images sylvester..what do you think? Although the simulation has already "diverged" (take a look to the magnitudes) the problem starts from there..in that edge inlet and outlet patch touch..

let me know what do you think about it
cheers

Simone

sylvester January 15, 2013 11:31

Hi,

Unfortunately the only conclusion I can draw from those pictures is: yes, your solution has diverged. For me to even start trying to help, I really need more information than that.

Regarding the problem in the other thread. The solution strategy I gave in the second post of that thread (i.e. pseudo staggered approach) did help a lot. Unfortunately I cannot provide you with the resulting code.

regards,
Sylvester


All times are GMT -4. The time now is 19:57.