Page 1 of 1

Identify the type and get the value of a boundary

Posted: Fri Aug 09, 2019 12:43 pm
by C0st4s
Hi,

I have a simple question. Is it possible to get the type and the value of an assigned boundary condition inside the cs_user_modules.f90?

I tried:
call user_boundary_conditions(nvar, itypfb, icodcl, rcodcl)
write(*,*) itypfb(ifac), icodcl(ifac, ivart), rcodcl(ifac, ivart,3) !,cvar_scalt(ifac)

And the values does not make any sense with what I assign in the GUI (heat flux condition).

Best regards,
Costas

Re: Identify the type and get the value of a boundary

Posted: Fri Aug 09, 2019 8:49 pm
by Yvan Fournier
Hello,

cs_user_modules.f90 allows adding functions which can be called from any other user subroutine. Depending where you call those from you will have access to the icodcl, rcodcl, ... arrays.

Regards,

Yvan

Re: Identify the type and get the value of a boundary

Posted: Sun Aug 11, 2019 5:55 pm
by C0st4s
Dear Yvan,

Really appreciate your reply. Though, the main issue that I face is that the boundary conditions are prescribed in the GUI (smooth wall with heat flux) and I want to call the value and the type of that in the cs_user_modules.f90.

Best regards,
Costas

Re: Identify the type and get the value of a boundary

Posted: Mon Aug 12, 2019 8:56 am
by Yvan Fournier
Hello,

Could you explain where cs_user_modules is used/called from in your code ?

Regards,

Yvan

Re: Identify the type and get the value of a boundary

Posted: Wed Aug 14, 2019 11:05 am
by C0st4s
Dear Yvan,

I call the routines of the cs_user_modules in cs_user_source_terms.f90 under cs_user_turbulence_source_terms since I modifying sources in the turbulent transport equations. The import thing is to get the face index of each boundary wall face which I am not sure if can do it with rcodcl(ifac,iu).eq.5 since I set every boundary condition in the GUI.

Thanks,
Costas

Re: Identify the type and get the value of a boundary

Posted: Wed Aug 14, 2019 3:45 pm
by Yvan Fournier
Hello,

No, the icodcl and rcodcl arrays are temporary, so they exist when in cs_user_boundary_conditions.f90 (and are initialized by the GUI), but do not exist anymore in cs_user_source_terms.f90.

You could either save a copy to your cs_user_modules by adding a copy operation from cs_user_boundary_conditions, duplicate the selection process in cs_user_modules, or try to work directly with the coefa/coefb arrays which are always available for a given variable field.

Best regards,

Yvan

Re: Identify the type and get the value of a boundary

Posted: Mon Aug 19, 2019 5:34 pm
by C0st4s
Hi,
Thanks Yvan again!

I use the approach of defining the boundary conditions in cs_user_boundary_conditions.f90 and calling that routine in my module. It works fine. Where can I find an example of the coefa and coefb approach that you suggested just to have a look? Is it similar to the one in the energy balance?

Cheers,
Costas