problem with 'ustsns.f90' subroutine

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
adumon

problem with 'ustsns.f90' subroutine

Post by adumon »

Hello

I'm working with v2.3.1

When I try to add the subroutine 'ustsns.f90' in the SRC I get the following error :

/Calcul/Apps2/saturne4.2.4/v231/lib/libsaturne.a(cs_user_source_terms.o): In function `ustsns_':

../../../cs231srcv2/src/user/cs_user_source_terms.f90:(.text+0x0): multiple definition of `ustsns_'

cs_user_source_terms.o:/Recherche/Calcul/adumon01/Saturne/essai/CHENG/RESU/20120917-1421/src_saturne/cs_user_source_terms.f90:(.text+0x0): first defined here

So I don't know how to add user source terms to the Navier-Stokes equations without this function.

Thank you.

Antoine
JamesMcNaughton
Posts: 72
Joined: Mon Mar 19, 2012 1:21 pm

Re: problem with 'ustsns.f90' subroutine

Post by JamesMcNaughton »

Hi Antoine

The file cs_user_source_terms.f90 is the new name for ustsns.f90 - if you open cs_user_source_terms.f90 you will see the subroutine called ustsns.

So the modifications you want to make you should do in cs_user_source_terms.f90

Hope that helps,

James
Jacques Fontaine
Posts: 118
Joined: Mon Feb 20, 2012 2:07 pm

Re: problem with 'ustsns.f90' subroutine

Post by Jacques Fontaine »

Hello,

James is right. And in 2.3v velocity components are coupled by default (ivelco = 1) so you must add your source term in cs_user_source_terms.f90 in the subroutine ustsnv.
Regards,
adumon

Re: problem with 'ustsns.f90' subroutine

Post by adumon »

Thank you for your response,

I try to convert a modification made in this subroutine for the previous version of Saturne.
I want to add the "pushing term" related to the Boussinesq approximation on the second component of the velocitie (in the y-direction). On the previous version of Saturne I had to write ( in ustsns.F subroutine) the following lines :

Code: Select all

	iphas=1
	richardson=10.0

	if (ivar.eq.iv(iphas)) then
	  ivart = isca(iscalt(iphas))
	  ivart = isca(1)

	  do iel=1,ncel
		crvimp(iel) = 0.d0
	  enddo

	  do iel = 1, ncel
	     crvexp(iel) = richardson*rtpa(iel,ivart)*volume(iel)
	  enddo

	endif
I can not seem to find the equivalent variable names in the new version. Could you help me ?

Thanks
adumon

Re: problem with 'ustsns.f90' subroutine

Post by adumon »

Sorry,
I have find the answer. I had to put a "2" (as the y-coordinate) in the crvexp argument.

crvexp(2,iel) = ....

Thank you
Post Reply