steady state in saturne to boundary condition in syrthes

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Pisolino
Posts: 86
Joined: Thu Apr 26, 2012 1:55 pm

steady state in saturne to boundary condition in syrthes

Post by Pisolino »

Hi,
in my experience of working with these softwares i modeled a metallurgical oven, where the workpieces load inside the oven are heated up both by convection (natural and forced by a rotating fan) and by surface to surface radiation (in syrthes). In a transient coupled simulation the timestep i should use to solve the fluid domain is very small (0,001 s) due to the rotation MRF part. Then solving something like a 2 hour heating it takes so much time. Since the fan always rotate at the same speed rate i run several steady-state fluid simulation with the surface fluid-load imposed to a temperature. Running them with temperatures like 50 ,200, 400,600,800 °C and using the heat flux (output visible in paraview) at the surface of the load i can calculate a h-coefficient function of surface temperature. My idea is now to insert this h coefficient in the syrthes simulation to couple also the radiation in a unsteady-state simulation with higher timesteps (around 1 s). Obviously i should save for each point of the boundary 'fluid-load' the h(T) values and then send this h(T) to the syrthes boundary points as a boundary condition.

You think is it possible to write some user-functions to obtain this "quasi-coupled" condition ?

thx

Andrea
Andrea
CEO and R&D manager @ ARGO srl

mail: info@argosrl.eu
site: www.argosrl.eu
Yvan Fournier
Posts: 4085
Joined: Mon Feb 20, 2012 3:25 pm

Re: steady state in saturne to boundary condition in syrthes

Post by Yvan Fournier »

Hello,

This should be possible, but using a simplified modeling of the rotating fan might be simpler.

Rotation MRF and rotor-stator interaction are nice if you need detailed flow around a fan whose characteristics are not well known, or if the flow conditions are not those of the fan's characteristics (lower speed, perturbed flow, ...).

Otherwise, there exists a simplified fan model in Code_Saturne, which transforms a fan description into a velocity source term (allowing a swirl term if necessary), based on the fan's characteristics. The feature is not much documented, but you can look at src/base/cs_ventil.h to see the prototypes/descriptions of the Fortran callable functions describing fans. If you use this, you will need to define velocity source terms using these functions (calling the fan definitions only during the first time step).

This may require a bit of guesswork (or testing of the functions on a simple, uncoupled calculation), but if this model is enough, you may then use different time steps for Code_Saturne and SYRTHES during a single calculation, with a time step mumtiplier in Code_Saturne for temperature.

This is probably simpler than complex estimation of a heat exchange coefficient and multiple calculations.

Your pick...

Best regards,

Yvan
Pisolino
Posts: 86
Joined: Thu Apr 26, 2012 1:55 pm

Re: steady state in saturne to boundary condition in syrthes

Post by Pisolino »

i've tried something similar, decoupling the simulation and setting at the coupled surface of the stator a velocity inlet with a direction tangential to the cylinder, it works quite well but i'm forced to set a temperature to the inlet when i want to set the flux=0 option. Since it's a recycle fan i can't impose the temperature to have a correct result. There is a way to do this?
Andrea
CEO and R&D manager @ ARGO srl

mail: info@argosrl.eu
site: www.argosrl.eu
Yvan Fournier
Posts: 4085
Joined: Mon Feb 20, 2012 3:25 pm

Re: steady state in saturne to boundary condition in syrthes

Post by Yvan Fournier »

Hello,

If the fan is a recycle fan, and air re-entering the fan has not left the calculation domain, this should be OK (though the fan model might not be gread if flow is not relatively well aligned with the fan, so that this flow matches the conditions underwhich its characteristics are defined/measured).

Otherwise, if hot air exists the domain and re-enters, you need to compute the average air temperature at the outlet matching that fan (other posts on this forum, as well as the examples in usproj.f90 should help you there), save this value in a global variable (defining a "common block" or user module used by both usproj.f90 an usclim.f90 is possible), then re-use this value for the inlet temperature in usclim.f90.

Note that boundary conditions defined in usclim.f90 have priority over those defined by the GUI in the xml file, so you can define almost all boundary conditions (and boundary regions) using the GUI, and redefine only the inlet temperature for the scalar temperature in usclim.f90 (I personally prefer this solution, which minimizes the amount of code in usclim.f90, making it clearer and easier to check).

Best regards,

Yvan
Pisolino
Posts: 86
Joined: Thu Apr 26, 2012 1:55 pm

Re: steady state in saturne to boundary condition in syrthes

Post by Pisolino »

ok ! i'll follow your suggest, but i have a problem on defining the velocity, in the GUI i used :

r=0.306;
xc=0.54;
zc=0.76;
alfa= (30/360)*(2*pi);
dir_x = cos(alfa)*(abs(z-zc)/r)*((z-zc)/abs(z-zc)) + sin(alfa)*(abs(x-xc)/r)*((x-xc)/abs(x-xc)) ;
dir_y = 0;
dir_z = -cos(alfa)*(abs(x-xc)/r)*((x-xc)/abs(x-xc)) + sin(alfa)*(abs(z-zc)/r)*((z-zc)/abs(z-zc));


now in the subroutine:

call getfbr('inlet', nlelt, lstelt)
!==========
do ilelt = 1, nlelt

ifac = lstelt(ilelt)
iel = ifabor(ifac)

itypfb(ifac) = ientre

r=0.306
xc=0.54
zc=0.76
alfa= (30/360)*(2*pi)



rcodcl(ifac,iu,1) = cos(alfa)*(abs(z-zc)/r)*((z-zc)/abs(z-zc)) + sin(alfa)*(abs(x-xc)/r)*((x-xc)/abs(x-xc))
rcodcl(ifac,iv,1) = 0
rcodcl(ifac,iw,1) = -cos(alfa)*(abs(x-xc)/r)*((x-xc)/abs(x-xc)) + sin(alfa)*(abs(z-zc)/r)*((z-zc)/abs(z-zc))


but in compile.log

Error: Symbol 'x' at (1) has no IMPLICIT type
/home/ltmm1/forno_cullati_ventola/fluido/RESU/20120619-1709/src_saturne/cs_user_boundary_conditions.f90:496.2:


so i suppose i have to declare in another way the x coordinate, how?
Andrea
CEO and R&D manager @ ARGO srl

mail: info@argosrl.eu
site: www.argosrl.eu
Yvan Fournier
Posts: 4085
Joined: Mon Feb 20, 2012 3:25 pm

Re: steady state in saturne to boundary condition in syrthes

Post by Yvan Fournier »

Hello,

The coordinates of the center for boundary face ifac are cdgfbo(1,ifac) for x, cdgfbo(2,ifac) for y, and cdgfbo(3,ifac) for z.

Details on the mesh structures should be explained in the user manual, but if you want a quicker overview of what is available, simply check the src/base/mesh.f90 file.

Best regards,

Yvan
Pisolino
Posts: 86
Joined: Thu Apr 26, 2012 1:55 pm

Re: steady state in saturne to boundary condition in syrthes

Post by Pisolino »

so i could declare implicit double precision x, y, z

and then before the rcodcl(ifac,iu,1) = .....

set

x= cdgfbo(1,ifac)
z = ....


or i have to change directly in the equation?
Andrea
CEO and R&D manager @ ARGO srl

mail: info@argosrl.eu
site: www.argosrl.eu
Yvan Fournier
Posts: 4085
Joined: Mon Feb 20, 2012 3:25 pm

Re: steady state in saturne to boundary condition in syrthes

Post by Yvan Fournier »

Hello,

Either option will do. Choose what seems most readable for you; for simple/short formulas, I prefer putting cdgfbo(1, ifac) directly in the formula, while for more complex formulas, declaring/setting x before that allows for more compact expression.

In any case, don't hesistate to run "code_saturne compile -t" to test the syntax/compilation of your user subroutines before running the whole script.
Pisolino
Posts: 86
Joined: Thu Apr 26, 2012 1:55 pm

Re: steady state in saturne to boundary condition in syrthes

Post by Pisolino »

i succeed in settnig the velocity profile but i can't set the temperature flow= 0, i added

if (nscal.gt.0) then
do ii = 1, nscal
rcodcl(ifac,isca(ii),3) = 0
enddo

endif


but then i get :


@
@
@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@
@ @@ WARNING: ABORT BY BOUNDARY CONDITION CHECK
@ ========
@ INCORRECT OR INCOMPLETE BOUNDARY CONDITIONS
@
@ At least one boundary face declared as inlet (or
@ outlet) with prescribed velocity with an entering
@ flow for which the value of a variable has not been
@ specified (Dirichlet condition).
@ The calculation will not be run.
@
@ Verify the boundary condition definitions in the GUI
@ or in the appropriate user subroutine.
@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@
Andrea
CEO and R&D manager @ ARGO srl

mail: info@argosrl.eu
site: www.argosrl.eu
Pisolino
Posts: 86
Joined: Thu Apr 26, 2012 1:55 pm

Re: steady state in saturne to boundary condition in syrthes

Post by Pisolino »

Solved !! the correct syntax is :

if (nscal.gt.0) then
do ii = 1, nscal
icodcl(ifac,isca(ii) ) = 3
rcodcl(ifac,isca(ii),3) = 0
enddo
endif


for all the scalars, the rcodcl line sets the flux, the icodcl line set the boundary to be a flux type
Andrea
CEO and R&D manager @ ARGO srl

mail: info@argosrl.eu
site: www.argosrl.eu
Post Reply