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
Identify the type and get the value of a boundary
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
-
- Posts: 4077
- Joined: Mon Feb 20, 2012 3:25 pm
Re: Identify the type and get the value of a boundary
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
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
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
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
-
- Posts: 4077
- Joined: Mon Feb 20, 2012 3:25 pm
Re: Identify the type and get the value of a boundary
Hello,
Could you explain where cs_user_modules is used/called from in your code ?
Regards,
Yvan
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
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
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
-
- Posts: 4077
- Joined: Mon Feb 20, 2012 3:25 pm
Re: Identify the type and get the value of a boundary
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
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
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
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