CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Production term in Finite Volumes Schemes (https://www.cfd-online.com/Forums/main/108059-production-term-finite-volumes-schemes.html)

 Ivan October 13, 2012 14:39

Production term in Finite Volumes Schemes

Dear all,

I have a working scheme for LES for a transport equation of a scalar, let's say Phi, done with Finite Volumes schemes in the code I am using. I need to modify this code by adding a production term which consists substantially of two non-linear terms, let's say k1*Phi^2 and k2*grad(Phi)*grad(Phi), where k1 and k2 are constants.

I want to implement it as an implicit scheme, which should be like:

A_d * Phi = A_nd * Phi + b

where A_d and A_nd are the diagonal matrix and not-diagonal matrix of coefficients and b is the vector of known terms.

I am confused on how to implement these new terms. Does someone have an idea or can suggest me some book where to look for?

Thank you!

 FMDenaro October 13, 2012 17:53

Quote:
 Originally Posted by Ivan (Post 386445) Dear all, I have a working scheme for LES for a transport equation of a scalar, let's say Phi, done with Finite Volumes schemes in the code I am using. I need to modify this code by adding a production term which consists substantially of two non-linear terms, let's say k1*Phi^2 and k2*grad(Phi)*grad(Phi), where k1 and k2 are constants. I want to implement it as an implicit scheme, which should be like: A_d * Phi = A_nd * Phi + b where A_d and A_nd are the diagonal matrix and not-diagonal matrix of coefficients and b is the vector of known terms. I am confused on how to implement these new terms. Does someone have an idea or can suggest me some book where to look for? Thank you!

First, you have to consider the accuracy order of your FV discretization.
At second order of accuracy the volume integral can be discretized simply by the mean value formula but I do not suggest that approach since it is not effective in terms of top-hat filtering. Better is the multi-dimensional extension of the trapezoidal rule. If you have an accuracy more than two then your volume integral must be discretized congruently, for example by using shape functions of high degree so that you can integrate them analitically

 Ivan October 13, 2012 18:31

It is said that the terms in the coefficient matrix are calculated as upwind and then a second order correction is added on the RHS in a deferred way (so that they can use a blending factor I guess)...so the accuracy is second order. Therefore, I'm thinking:

1) On one side, wether using an upwind-like discretization for those terms (plus a second order correction which I would not be sure how to apply) or directly a second order scheme (ex. a central scheme).

2) I'm confused, chosen the scheme, what I should write. For example, since for each time step, a number of subiterations are performed, can I discretize the term, i.e., k1*Phi^2 in cell i as k1*Vol_i*Phi(n-1)_i * Phi(n)_i, where n is the current subiteration? And what about the term grad(Phi)^2

 Ivan October 13, 2012 18:35

Quote:
 Originally Posted by Ivan (Post 386462) It is said that the terms in the coefficient matrix are calculated as upwind and then a second order correction is added on the RHS in a deferred way (so that they can use a blending factor I guess)...so the accuracy is second order. Therefore, I'm thinking: 1) On one side, wether using an upwind-like discretization for those terms (plus a second order correction which I would not be sure how to apply) or directly a second order scheme (ex. a central scheme). 2) I'm confused, chosen the scheme, what I should write. For example, since for each time step, a number of subiterations are performed, can I discretize the term, i.e., k1*Phi^2 in cell i as k1*Vol_i*Phi(n-1)_i * Phi(n)_i, where n is the current subiteration? And what about the term grad(Phi)^2
I forgot to say that in LES the blending factor should be kept to one, so the scheme is fully second order!

 FMDenaro October 14, 2012 04:25

Quote:
 Originally Posted by Ivan (Post 386463) I forgot to say that in LES the blending factor should be kept to one, so the scheme is fully second order!
I think is better avoiding in LES any upwind discretization...More precisely this is when you use an explicit SGS model... otherwise you can use an ILES approach, without using SGS model.

Furthermore, the volume integral discretized with the mean value formula is second order of accuracy but it is not effective as filter, as you can simply see in the wavenumber space

 Ivan October 14, 2012 08:54

Quote:
 Originally Posted by FMDenaro (Post 386509) I think is better avoiding in LES any upwind discretization...More precisely this is when you use an explicit SGS model... otherwise you can use an ILES approach, without using SGS model. Furthermore, the volume integral discretized with the mean value formula is second order of accuracy but it is not effective as filter, as you can simply see in the wavenumber space
Thank you! I'm looking in the code to better understand what is done for the convective and diffusive terms. Effectively the convective term is done by interpolating the Phi at the cell boundary surface with a central interpolation first, solved implicitly, plus a correction term kept on the RHS. I'm looking to the structure of this correction term so that I can adopt an identical structure (central implicit plus correction on RHS) for my production term.

Do you know some book/paper which explain this issue of the Upwind when using sgs model and the issue of the "non-effctiveness" of the filter you were mentioning (I will be required to justify my choices)?

 leflix October 17, 2012 17:07

Quote:
 Originally Posted by Ivan (Post 386445) Dear all, let's say k1*Phi^2 and k2*grad(Phi)*grad(Phi), where k1 and k2 are constants. I want to implement it as an implicit scheme, which should be like: A_d * Phi = A_nd * Phi + b where A_d and A_nd are the diagonal matrix and not-diagonal matrix of coefficients and b is the vector of known terms. I am confused on how to implement these new terms. Does someone have an idea or can suggest me some book where to look for? Thank you!
In any case, if your schemes are second order, you can always use

where Phy_p and grad(Phi)_p are evaluated at the cell center P and Volp is the volume of cell P.

these terms of course are located in rhight hand side, i.e in b

You could also implict the term k1(Phy_p)^2 while adding the quantity k1(Phy_p)*Volp in the main diagonal A_d.
It can add stability if large values of Phy occurs.

If you have a kind of deferred correction used in the code, it should work fine.

 FMDenaro October 17, 2012 17:19

Quote:
 Originally Posted by leflix (Post 387190) In any case, if your schemes are second order, you can always use k1(Phy_p)^2*Volp +k2*(grad(Phi)_p*grad(Phi)_p)*Volp which is second order too where Phy_p and grad(Phi)_p are evaluated at the cell center P and Volp is the volume of cell P. these terms of course are located in rhight hand side, i.e in b You could also implict the term k1(Phy_p)^2 while adding the quantity k1(Phy_p)*Volp in the main diagonal A_d. It can add stability if large values of Phy occurs. for k2*grad(Phi)*grad(Phi) I do not see any other way instead of expliciting this term. If you have a kind of deferred correction used in the code, it should work fine.

Hi leflix,
consider that you are correct in term of accuracy order in physical space but for the aim of an LES, the volume average should be like a top-hat filter. That means, for example in 1D, that the transfer function is in the form sin(kh/2)/kh/2. If you use simply the mean value you will find that the transfer function is the unity function...thus is not effective as filter

 leflix October 17, 2012 17:24

Quote:
 Originally Posted by FMDenaro (Post 387193) Hi leflix, consider that you are correct in term of accuracy order in physical space but for the aim of an LES, the volume average should be like a top-hat filter. That means, for example in 1D, that the transfer function is in the form sin(kh/2)/kh/2. If you use simply the mean value you will find that the transfer function is the unity function...thus is not effective as filter

Hi Filippo,

ok my contribution here was just about discretization principles. From LES concerns I do trust you !;)

 FMDenaro October 17, 2012 17:36

Quote:
 Originally Posted by leflix (Post 387194) Hi Filippo, ok my contribution here was just about discretization principles. From LES concerns I do trust you !;)
you are right, mean value formula is very common in FV discretization with second order central schemes, however I just suggested Ivan to do differently as he wants a LES-suited discretization for the production term.
Regards
Filippo

 leflix October 17, 2012 17:39

Quote:
 Originally Posted by FMDenaro (Post 387195) I just suggested Ivan to do differently as he wants a LES-suited discretization for the production term. Regards Filippo
You were right to point out this serious issue ! I'm sure Ivan will got the point !!

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