Page 1 of 1

Problem with scalar transport at inlets

Posted: Wed Oct 12, 2016 5:07 pm
by jtache
C_S version is 4.0

Dear team,

First of all, thanks for your work. I used C_S for several years and I'm always pleased to work with your new releases.

I currently work with a scalar transport equation that represents a concentration in particles (lets say that unit is part/m3). The basic system is just a closed box with one inlet and one outlet.
I define a value (dirichlet bc) for this scalar at a velocity inlet and then check what is the quantity (number of particles) released in the domain during an unsteady job. For this, I used something like:

Code: Select all

integration = 0.d0
call field_get_val_s(ivarfl(isca(1)), cvar_scal)
do iel = 1, ncel
 integration = integration + cvar_scal(iel)*volume(iel)
enddo
in cs_user_extra_operations.f90.

Unfortunately, I don't get the right result. This is easy to check with a constant timestep since the dispersion timerate (in part/s) is just :
S_inlet*u_inlet*C_scal
where:
S_inlet is the surface of the inlet (m2)
u_inlet is the velocity at inlet (m/s)
C_scal is the value of scalar at inlet (part/m3)

In the past (C_S v2.0), I fixed this problem by modifying covofi.f90 (suppress viscosity at inlets) with :

Code: Select all

do ifac = 1, nfabor
      iel = ifabor(ifac)
      if(ipcvsl.eq.0)then
        viscb(ifac) = visls0(iscal)*ra(isrfbn-1+ifac)/ra(idistb-1+ifac)
      else
        viscb(ifac) = propce(iel,ipcvsl)*ra(isrfbn-1+ifac)/ra(idistb-1+ifac)
      end if
enddo
Could you please :
- tell me if you have reproduced the problem
- help me to get the same kind of correction for scalar viscosity at inlets (in covofi) since I'm not yet familiar with the new architecture of C_S last releases?

Thank you for your feedback.

Re: Problem with scalar transport at inlets

Posted: Thu Oct 13, 2016 12:52 am
by Yvan Fournier
Hello,

I am not aware of this sort of problem, though I'll try to check with developers more knowledgable about the numerics par of the code. This seems strange

To find the equivalent arrays between V4.0 and older versions, use the Doxygen documentation included with V4.0, which has an equivalence array which should help quite a bit (in the user subroutines section).

Regards,

Yvan

Re: Problem with scalar transport at inlets

Posted: Mon Oct 24, 2016 10:19 am
by jtache
Hello Yvan,
Would you have any feedback from developers? Did you reproduce this problem?
If needed, I can post you a simple test case to demonstrate this strange behaviour of C_S.
Thanks for your feedback.

Jeremie

Re: Problem with scalar transport at inlets

Posted: Mon Oct 24, 2016 6:06 pm
by Yvan Fournier
Hello Jeremie,

I talked briefly with another developer about this, and looked at the code in covofi.f90 from version 4.0. There is a "convective inlet" boundary condition type which might to do something similar to what you are doing (canceling the diffusive flux at the inlet).

This seems to be currently available only through user subroutines (this is an omission), but if at areas where you have defined an inlet, you use cs_user_boundary_conditions.f90 simply to redefine
itypfb(ifac) = i_convective_inlet
things should work OK.

Regards,

Yvan

Re: Problem with scalar transport at inlets

Posted: Tue Oct 25, 2016 10:35 am
by jtache
Dear Yvan,

Thanks a lot for this "convective" boundary condition. I used it and I must say things are a lot better!
Balance between particles injected in the system (through a "convective" inlet) and volumic integration is close to be exact. Still I have a little error (about 2,6 % in my case).

For comparison, when I define a source of particles (concentration of a scalar) with a volumic source term in cs_user_scalar_source_terms.f90, the balance is close to zero (error is about 0,00001 %).

Do you think there's a way to improve things a little bit more with scalar BC at inlets ?

Best regards,
Jeremie

Re: Problem with scalar transport at inlets

Posted: Thu Oct 27, 2016 4:25 pm
by Yvan Fournier
Hello Jeremie,

I'm not too sure about this. I'll check with a colleague in a few days (as soon as possible).

Regards,

Yvan