dc electric arc

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Kyle
Posts: 18
Joined: Wed Jun 20, 2018 9:29 pm

Re: dc electric arc

Post by Kyle »

Rodion,

My simulation of your case also had uniform enthalpy at 1.4e4, I should have specified that instead of the temperature, that's my bad.

I will try your recommendations and see if they fix the problem.

Thanks,
Kyle
rodion
Posts: 98
Joined: Wed Jan 11, 2017 4:13 pm

Re: dc electric arc

Post by rodion »

Dear Kyle,

Well, actually for specific physics inivar.f90 calls ppiniv which in turn is supposed to call cs_user_f_initialization. But for some reason it does not happen.
So I guess if you copy the file inivar.f90 to your SRC folder along with the other user code files and just call the function cs_user_f_initialization from there as follows, it may work.

Code: Select all

call cs_user_f_initialization(nvar, nscal, dt)
call user_initialization()
Also you can track the whole process by printing some debug info to the output window like

Code: Select all

write(*,'(I5,I5,A,I5,I5)')irangp,ntcabs,' INIVAR ',nvar,nscal
Probably this code file is not active at all.

Also if you look into the case by the following link maybe you will find some useful information. Because initialization worked well there.
https://drive.google.com/file/d/1UlHgji ... 5BKCA/view

I hope you find the solution soon.

Best regards,
Rodion
Kyle
Posts: 18
Joined: Wed Jun 20, 2018 9:29 pm

Re: dc electric arc

Post by Kyle »

Hello Rodion,

After working with your case more, I've found that my Code_Saturne does not read the "cs_user_initialization.c" file. I found this out by changing the enthalpy value for everything outside of the hot column, and I saw that the uniform enthalpy value of the result remained the same, which matches the enthalpy that corresponds to the reference temperature in the "setup.xml" file. I looked at the listing and other such files in the results case that you sent me, but I couldn't find anything to suggest what my issue is. I attached a couple relevant files from my own version of your case. Do you have any idea what might be causing my issue?

For the case that Yvan provided, I tried adding "inivar.f90" to the SRC folder and modifying it like you suggested, but doing so didn't produce any change in the result. I also tried modifying the original src/base/inivar.f90 and reconfiguring/reinstalling Code_Saturne in case that was the problem, but that also didn't help. I added the "write" line to inivar.f90 to try and get additional information, but it didn't print out anywhere; am I supposed to put that line in a different file? I'll keep digging through the files to see if I can find the problem, but if you think of anything else or notice me doing something incorrectly please let me know.

My edited section of inivar.f90 for reference

Code: Select all

else

  ! ON FAIT DE LA PHYSIQUE PARTICULIERE
  !   On pourrait remonter la partie init non utilisateur de ppiniv avant lecamo
  !     dans iniva0, mais il faudrait quand meme conserver ici l'appel a
  !     ppiniv car il encapsule les appels aux ss pgm utilisateur similaires a
  !     usiniv.

  iusini = 1

  call ppiniv(nvar, nscal, dt)

  if (ippmod(icompf).ge.0.and.(    isuite.eq.0                 &
                               .or.isuite.eq.1.and.ileaux.eq.0)) then

    if (     ithvar.ne. 60000.and.ithvar.ne.100000                    &
        .and.ithvar.ne.140000.and.ithvar.ne.150000.and.ithvar.ne.210000) then
        write(nfecra,1000) ithvar
        iok = iok + 1
    endif

    ivoid = -1
    call cs_cf_thermo(ithvar, ivoid,  rvoid, rvoid, rvoid, vvoid)

  endif

endif

write(*,'(I5,I5,A,I5,I5)')irangp,ntcabs,' INIVAR ',nvar,nscal !added by Kyle
call cs_user_f_initialization (nvar, nscal, dt) !added by Kyle
call user_initialization()
Thanks,
Kyle
Attachments
listing.txt
(115.73 KiB) Downloaded 270 times
compile.log
(46.13 KiB) Downloaded 297 times
Yvan Fournier
Posts: 4209
Joined: Mon Feb 20, 2012 3:25 pm

Re: dc electric arc

Post by Yvan Fournier »

Hello,

The "write" you added should appear in the "listing" file (you can use "nfecra" instead of "*" to make sure, but it should be the same).
Could you add a similar statement near the beginning of the file to make sure is is accounted for ? We have ahd issues with user files being ignored in the "packaged" version of Code_Saturne on Ubuntu, but not with a version installed by a user up to now.

Regards,

Yvan
Kyle
Posts: 18
Joined: Wed Jun 20, 2018 9:29 pm

Re: dc electric arc

Post by Kyle »

Hello Yvan,

I added the "write" to the beginning of the inivar.f90 file like you suggested, and it did appear in the "listing" file this time, right before the initialization of the variables. I added the section below; I don't know what the numbers before and after INIVAR mean, but I thought that you or Rodion might know. The corresponding "write" line is "write(*,'(I5,I5,A,I5,I5)')irangp,ntcabs,' INIVAR ',nvar,nscal", so it appear to me that irangp=0, ntcabs=0, nvar=9, and nscal=3.

Code: Select all

    0    0 INIVAR     9    3

 -----------------------------------------------------------


 ** VARIABLES INITIALIZATION
    ------------------------
One thing to note is that it only worked if I modified "inivar.f90" in its original location in src/base /inivar.f90 in the in the CS source directory and then reconfigured/reinstalled Code_Saturne. If I added "inivar.f90" to the SRC folder in the pfender case, it failed in the calculation step and the following errors appeared in "compile.log":

Code: Select all

/home/kyle_renfroe_pc/Code_Saturne/prod_studies/pfender/CASE1/RESU/20180706-0026/src_saturne/inivar.f90:161:52:

     elseif (iand(vcopt%idften, ANISOTROPIC_DIFFUSION).ne.0) then
                                                    1
Error: Symbol ‘anisotropic_diffusion’ at (1) has no IMPLICIT type
/home/kyle_renfroe_pc/Code_Saturne/prod_studies/pfender/CASE1/RESU/20180706-0026/src_saturne/inivar.f90:159:46:

     if (iand(vcopt%idften, ISOTROPIC_DIFFUSION).ne.0) then
                                              1
Error: Symbol ‘isotropic_diffusion’ at (1) has no IMPLICIT type
Configuring and reinstalling Code_Saturne only takes me about 15 minutes at this point, so getting "inivar.f90" to work from the SRC folder is not a high priority, although the error may still hint at the issue.

If one of you could help me understand the inivar line written to the listing file, I think we can make more progress on this issue.

Thank you,
Kyle
rodion
Posts: 98
Joined: Wed Jan 11, 2017 4:13 pm

Re: dc electric arc

Post by rodion »

Dear Kyle,

I use Code_Saturne on Windows with GUI. Probably it makes some difference.
I don't know what is the key difference between configuring CS for Windows and for Ubuntu. So I cannot imagine why some things work well on my computer with Windows and do not work on your Ubuntu instance. Maybe you need to start with Windows at first and get at least something working. Before I used to use Code_Saturne on VMs with Lubuntu and usually it worked but took more efforts than on Windows.
I just have tried starting the case with a modified inivar.f90 in the folder SRC and it worked well. The compilation goes well too.
In the output window I got the following lines:

Code: Select all

    4    0 INIVAR     9    3
    5    0 INIVAR     9    3
    3    0 INIVAR     9    3
    1    0 INIVAR     9    3
    0    0 INIVAR     9    3
    6    0 INIVAR     9    3
    2    0 INIVAR     9    3
    7    0 INIVAR     9    3
The inivar.f90 modification is as follows:

Code: Select all

write(*,'(I5,I5,A,I5,I5)')irangp,ntcabs,' INIVAR ',nvar,nscal
call user_initialization()
call cs_user_f_initialization(nvar, nscal, dt)
The configuration of the write statement is debatable. You can output some more useful information.
Please find the file attached.

irangp is the process rank
-1 in sequential mode
r (0 < r < n_processes) in distributed parallel run
ntcabs is the current absolute time step number. In case of restart, this is equal to ntpabs + number of new iterations.
nvar is the total number of variables
nscal is the total number of scalars
For more information please refer to the documentation:
https://www.code-saturne.org/cms/sites/ ... index.html

You get only one line for the process rank 0 of parallel job because you configured output to the listing file only from the process rank 0. You also can configure output from the other processes to the files listing_r<r>. But I prefer not to do that.

Also I have tried calling cs_user_f_initialization(nvar, nscal, dt) from inivar.f90 and it worked well. The initialization is done only in the Fortran file now. Please find the file attached. The initialization in the C file was removed. Please find the simulation case by the following link:
https://drive.google.com/open?id=1wK7Ol ... r-6_FfDaD1

I hope you get your first good results soon.

Best regards,
Rodion
Attachments
inivar.f90
(66.33 KiB) Downloaded 295 times
cs_user_initialization.f90
(5.5 KiB) Downloaded 267 times
Kyle
Posts: 18
Joined: Wed Jun 20, 2018 9:29 pm

Re: dc electric arc

Post by Kyle »

Hello Yvan, and Rodion,

Something has come to my attention that may help in solving the issue. The "write" line in "inivar.f90" appears in the listing file only if I modify the original /src/base/inivar.f90 and reconfigure/reinstall Code_Saturne, although even in this case the "cs_user_initialization.f90" file is not read. If I put the exact same "inivar.f90" in the SRC directory, the "write" line does not appear. I also tried to recreate the initialization file as a C file, with no success. Is it possible that none of the files in SRC ("cs_user_boundary_conditions.f90", "cs_user_initialization.f90", "inivar.f90", etc) are being read because of some separate problem?

Rodion has successfully run their own case using cs_user_initialization.c, as well as the combination of cs_user_initialization.f90 and the modified inivar.f90. When I run the exact same cases on my own computer, the initialization file is ignored. I think that "cs_user_boundary_conditions.f90" is also being ignored, because I have to manually define the boundary conditions with the GUI to make the case work. This seems to support my theory, though the difference between running Code_Saturne on Windows and Ubuntu could also be the problem.

What do you two think about this? Yvan mentioned previously that there have been issues with user files being ignored in the "packaged" version of Code_Saturne on Ubuntu, and although mine is user-installed, I think that this could be part of the problem.

Thanks,
Kyle
rodion
Posts: 98
Joined: Wed Jan 11, 2017 4:13 pm

Re: dc electric arc

Post by rodion »

Dear Kyle,

If I were you I would try using Code_Saturne on Windows to get at least something working.

Also in my case the boundary conditions from the GUI do not work at all for electric arc simulation. I define all the actual boundary conditions in the file cs_user_boundary_conditions.f90. The notification about the absence of the boundary conditions in the GUI changes nothing, you can just close it.

Best regards,
Rodion
Kyle
Posts: 18
Joined: Wed Jun 20, 2018 9:29 pm

Re: dc electric arc

Post by Kyle »

Dear Rodion,

I will take your advice and install Code_Saturne on Windows to see if that works.


Yvan,

I can try to make use of the Windows installation of Code_Saturne for now, but in the long term my mentors are very preferential towards Linux installations. You mentioned a couple of weeks ago that the hot column initialization problem did not occur when you ran the pfender case on the 5.3-alpha version of Code_Saturne. That version isn't available to the public yet, but is there any way that I could be given access to it to use for testing?

Also, if you think of anything that might be causing my installation of Code_Saturne to ignore the files in the SRC folder, please let me know.

Thank you,
Kyle
Kyle
Posts: 18
Joined: Wed Jun 20, 2018 9:29 pm

Re: dc electric arc

Post by Kyle »

Rodion,

I installed Code_Saturne on Windows and I was able to successfully run your case on it. I haven't tried the pfender case yet, but I plan to later today. I still don't know what my problem is for my Linux installation, but I'll keep trying to figure it out while I'm working with the Windows version.

Rodion and Yvan, thank you for all of the help and advice you've given me, I couldn't have made it this far without your help.

Thanks again,
Kyle
Post Reply