Page 2 of 2

Re: Problem when selecting internal faces

Posted: Mon Jul 19, 2010 1:05 am
by David Monfort
You're right about the two precisions on the surface area calculation (damned copy and paste...) and the z-component use.
I downloaded the mesh too. Thanks.
David

Re: Problem when selecting internal faces

Posted: Mon Jul 19, 2010 10:48 am
by Stéphane Blanchet
No problem,
But do you have any idea about my problem concerning the "chrash"?
Stéphane

Re: Problem when selecting internal faces

Posted: Mon Jul 19, 2010 2:36 pm
by David Monfort
Forgot about the crash...
No idea at all actually :(
The best way to circumvent the error is usually to proceed by "dichotomy"
run in serial mode use only the mandatory user subroutines (generally: usini1.f90, usclim.f90, maybe usphyv.f90) add the other routines one by one add some "write(*,*) passed" in different parts of the code ...
And see when it crashes! If nothing works you can also run the code under the valgrind tool (see the runcase.help for more example)
David

Re: Problem when selecting internal faces

Posted: Wed Jul 28, 2010 4:22 pm
by Stéphane Blanchet
Hello,
I found the error, some of my variables had to be set as "real", not as "integer" as I did.
Anyway, now it seems to work but I have some doubt about the values I get.
Indeed, I check the values (pressure) I get in the listing with probes and with the usdpst.f90 subroutine (I extract the same volume, and I check the values with paraview).
The result is that I found the same values with the probes and with paraview (about 77 Pa), but the values I get with the usproj.f90 subroutine is quite different (about 66 Pa).
I only use usproj and usdpst as subroutines. I also checked with the x-velocity and I have  the same problem.
 
Furthermore, when I ran the calculation in parallel mode, I didn't get the same result with the usprof.f90 subroutine (about 63 Pa instead of 66). Is this a flaw of the parallel writing?
Any idea?
Best Regards,
Stéphane

Re: Problem when selecting internal faces

Posted: Fri Jul 30, 2010 4:42 am
by Yvan Fournier
Hello,

When running in parallel, the point used for the reference pressure may change, so the pressure value at probes may change. See this bug and the accompanying patch:  https://code-saturne.info/products/code-saturne/issues/30 .

Still, this does not explain the difference with ParaView. Note that when using probes in Code_Saturne, by default, the value is taken not at the probe, but at the cell center closest to the probe (with no interpolation), while ParaView uses some sort of interpolation. So if your probes do not match cell centers and you have a pressure gradient, this may also explain part of the difference.

Best regards,

  Yvan

Re: Problem when selecting internal faces

Posted: Fri Jul 30, 2010 11:48 am
by Stéphane Blanchet
Hello,

Thank you for your answer, I was aware for the interpolation in Paraview, but as you said, it does not explain this difference.

I attached my usproj.f90 subroutine, if you can take a look, it would be very kind. Maybe I did something wrong...

Concerning parallel runs, I noticed that when I use call parsom to sum over the domain, I get strange values (in the hst file I create) and completely random depending on the run (it can be 1e13 or 1e-8, etc.), except for the last iteration where the value is the same as if I did not use call parsom...
 
Best Regards,

Stéphane

Re: Problem when selecting internal faces

Posted: Thu Aug 05, 2010 7:02 pm
by David Monfort
Hello Stéphane,

You forgot the indirection on the selected cells (see in bold here-below). Here is what you should do:

Code: Select all

average_pressure = 0.
vol = 0.

call getcel('0 < x < 0.0011', nlelt, lstelt)

do ilelt = 1, nlelt
  iel = lstelt(ilelt)
  average_pressure = average_pressure + rtp(iel,ipr(1))*volume(iel)
  vol = vol + volume(iel)
enddo

call parsom(average_pressure)
call parsom(vol)

average_pressure = average_pressure / vol 
Let us know if it works.

David

Re: Problem when selecting internal faces

Posted: Fri Aug 06, 2010 11:04 am
by Stéphane Blanchet
Hello,

Thank you for your answer.

Now it works, but I have still an issue in parallel runs: when I use call parsom, I get strange values in my .hst file. It is strange because when I do not use these commands in parallel runs, I get the same values as in serial runs...

Any idea?

Best Regards,

Stéphane