turbine modelling

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: turbine modelling

Post by Yvan Fournier »

Hello,

Selection criteria are based on mesh "groups", and not face numbers. To check groups available in your mesh, use the mesh checking funtions of the code ("code_saturne check mesh -m <file>" in text mode), and check preprocessor log and visualize preprocessing/mesh chaecking output under ParaVis/ParaView for example.

To build groups in SALOME, there are many options, but the simplest is to build groups in GEOM, then build face groups based on the geometry under SALOME.

The Code_Saturne user guide has a chapter explaining everything about selection criteria, and how it works (colors/groups) depending on the mesh format used. Search the pdf for "selection".

Regards,

Yvan
stage75

Re: turbine modelling

Post by stage75 »

So if I understand, on Salome each color corresponds to a number of this color ?
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: turbine modelling

Post by Yvan Fournier »

No, avoid color numbers with SALOME, and use group names. In Code_Saturne's getfbr(), you may use group names instead of color numbers. Please read the corresponding chapter in the user manual.
stage75

Re: turbine modelling

Post by stage75 »

Thank you Yvan,

I started to read the chapter ;)
stage75

Re: turbine modelling

Post by stage75 »

I think that my fatal error comes from my boundary conditions definitions :

So I remember that I should model a rotating iturbine in a basin of water. therefore my overall geometry is constituted by a turbine and a basin and then the water level in the basin (figure attached).

So by boundary conditions are:

THe differents faces of the turbine are the WALLS (name group: Turbine-faces) ,definied in "usclim.f90" like:

Code: Select all

[code]call getfbr('Turbine-faces', nlelt, lstelt)
do ilelt = 1, nlelt
  ifac = lstelt(ilelt)
  ! Wall: zero flow (zero flux for pressure)
  !       friction for velocities (+ turbulent variables)
  !       zero flux for scalars
  do iphas = 1, nphas
    itypfb(ifac,iphas)   = iparoi
  enddo
enddo
[/code]
THe walls of the basin : WALLS (name group: basin faces)

Code: Select all

call getfbr('basin faces', nlelt, lstelt)
do ilelt = 1, nlelt
  ifac = lstelt(ilelt)
  ! Wall: zero flow (zero flux for pressure)
  !       friction for velocities (+ turbulent variables)
  !       zero flux for scalars
  do iphas = 1, nphas
    itypfb(ifac,iphas)   = iparoi
  enddo
enddo
THe "upper face of the basin" : symetry (Upper-face)

[

Code: Select all

code]call getfbr('Upper-face', nlelt, lstelt)
do ilelt = 1, nlelt
  ifac = lstelt(ilelt)
  ! Wall: zero flow (zero flux for pressure)
  !       friction for velocities (+ turbulent variables)
  !       zero flux for scalars
  do iphas = 1, nphas
    itypfb(ifac,iphas)   = isymet
  enddo
enddo[/code]

So, since i want to couple the turbine with all geometry in subroutine "ussatc.f90" of SCR.1and SRC.2 i take:

Code: Select all

do ii = 1, nbcsat
  if (ii .eq. 1) then
   ! numsat = 1
    call defsat(numsat, namsat, 'all[]', ' ', ' ', 'all[]', iwarns)
What do you think? because i have the fatat error in this case

Thanks
Attachments
Capture.png
stage75

Re: turbine modelling

Post by stage75 »

Hi eveone,

please how can I do to define the coupling between my two instances (how can adapt my subroutine "ussatc.f90")!

I did in SRC.1

Code: Select all

do ii = 1, nbcsat
  if (ii .eq. 1) then
   ! numsat = 1
    call defsat(numsat, namsat, 'all[]', ' ', ' ', '[b]number of faces of my first intance[/b]', iwarns)
In SRC.2 I did,
do ii = 1, nbcsat
if (ii .eq. 1) then
! numsat = 1
call defsat(numsat, namsat, 'all[]', ' ', ' ', 'number of faces of my second instance', iwarns)

Is this right please!!
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: turbine modelling

Post by Yvan Fournier »

Hello,

I have tested and debugged internals, but not set up, rotor/stator cases with Code_Saturne, so I am not too familiar with the use of ussatc.f90.

With no details on the error (listing.*), I cannot tell you much, and I do not have details on the rest of your setup.

What I would recommend is to test both domains independently (using a reasonably close boundary condition on the faces where coupling shoud occur), and solve all data setup errors for this case first.
As a second step, couple the 2 domains, using ussatc.f90.

This is easier with version 2.2, as you each domain setup can be run independently, while with 2.0, you need to rebuild a separate case for each unstructured domain (but is tis still feasible).

Regards,

Yvan
stage75

Re: turbine modelling

Post by stage75 »

Hello,

I get this error in "listing.2"

Code: Select all

Unmatched Code_Saturne couplings:
---------------------------------

 Couplage Code_Saturne :
   id de couplage :             0
   nom local :                  ""
   numéro local :               -1
/home/itouche/Téléchargements/tmp/installer/ncs-2.0.4/src/base/cs_sat_coupling.c:2076: Erreur fatale.

Au moins 1 couplage Code_Saturne a été défini pour lequel
aucune communication avec une instance de Code_Saturne n'est possible.


Pile d'appels :
   1: 0x7ff0eabd0562 <cs_sat_coupling_all_init+0xab2> (libsaturne.so.0)
   2: 0x7ff0eaa9b345 <cs_run+0xc5>                    (libsaturne.so.0)
   3: 0x7ff0eaa9bda5 <main+0x1f5>                     (libsaturne.so.0)
   4: 0x7ff0e8709c4d <__libc_start_main+0xfd>         (libc.so.6)
   5: 0x40be89     <>                               (cs_solver)
Fin de la pile
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: turbine modelling

Post by Yvan Fournier »

This type of error occurs very early, before defining boundary conditions or even matching faces between meshes.

I just checked the examples for the definitions in DEFSAT for both ussatc.f90 files. NUMSAT should have value 2 for SRC.1, and value 1 for SRC.2 (or value -1 for automatic matching in both cases).
stage75

Re: turbine modelling

Post by stage75 »

In this case I get :

Code: Select all

The group or attribute "Face_53" in the
selection criterion:
"Face_53"
  does not match any edge face.
However this face I well defined in my boundary conditions!.
Post Reply