How to set the relaxation coeffiecient of variables?

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
MartianDuan
Posts: 74
Joined: Fri Aug 02, 2013 4:26 pm

How to set the relaxation coeffiecient of variables?

Post by MartianDuan »

Dear developer and users,

I am now working on the LES of water pipe flow under super-critical pressure, which means the properies would change dramtically at certain temperature region.

The divergence was happened when it solving energy equation after several time steps. The error information is shown below, where Scalar 1 standed for temperature.
Jacobi: error (divergence) solving for Scalar 1

I think the relaxation coefficient would work on it. I noticed that code saturne supplied the 'relaxv' to access to the relaxation coefficient of variables. But I have no clues on how to apply it, I did not find any examples.

Furthermore, the properties would change with the temperature changes, expecially the variable density. Does code saturne offers relaxation factor to them as well?

Waiting for your reply and thanks in advance,

Yu.
Yvan Fournier
Posts: 4075
Joined: Mon Feb 20, 2012 3:25 pm

Re: How to set the relaxation coeffiecient of variables?

Post by Yvan Fournier »

Hello,

To apply a relaxation for a given variable, you may define relaxv in cs_user_parameters.f90, in the usipsu subroutine. For example:

relaxv(isca(1)) = 0.7

In specific physics, a relaxation parameter for the density (srrom) is used in some cases, but searching for it in the code, it seems it applies only to apply to the update of the density in specific physics (so as to avoid too rapid changes). You might "recycle" this idea in your own computation of the density, if all else fails.

With strongly varying density values, you are probably at the edge of what the code's numerics can handle correctly (NEPTUNE_CFD, which is not open source, uses a different time scheme, and applications of Code_Saturne such as fire modelling, which lead to rapids changes in density, are a work in progress, and can encounter stability issues unless strong precautions are taken).

Regards,

Yvan
MartianDuan
Posts: 74
Joined: Fri Aug 02, 2013 4:26 pm

Re: How to set the relaxation coeffiecient of variables?

Post by MartianDuan »

Thanks, Yvan. I will try the idea in my following work.
Post Reply