Case for CS1.3 adaptation to CS4.2

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
rodion
Posts: 98
Joined: Wed Jan 11, 2017 4:13 pm

Case for CS1.3 adaptation to CS4.2

Post by rodion »

Hello everybody,
I have the case which was created for Code_Saturne 1.3 several years ago. It is related to an elecric arc in Argon atmosphere.
It contains:
— files with Fortran code (covofi.F; elflux.F; ellecd.F; elphyv.F; elthht.F; eltssc.F; gradrc.F; Makefile; scalai.F; tabutil.h; uselcl.F; useli1.F; useliv.F; uselph.F; uselrc.F; ushist.F; usini1.F; usiniv.F; usppmo.F; usthht.F; ustsns.F; ustssc.F; viscfa.F)
— files with properties of Argon and metals of cathode and anode
— mesh in GAMBIT neutral format
— output data
— cs13.exe (it can't run on Windows 10)
— direct.dat, donnees.dat, resume, suiava, suiavx (I don't know what is it)

I have no typical folder structure (DATA, RESU, SCRIPTS, SRC).
I need to adapt this case to Code_Saturne 4.2 and then improve it.

Could you please explain, what should I change in these files to initialize and recalculate the case on Windows and Linux both?
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: Case for CS1.3 adaptation to CS4.2

Post by Yvan Fournier »

Hello,

I do not recommend using Code_Saturne 4.2; as it will only be maintained until late April (when 5.0 will be released).

So I recommend moving to 4.3, for which the setup is similar to what will be in 4.3.
Most definitions are now available through the GUI, so you should:

- check all the data setup in your files, and define all the equivalent settings through the GUI if possible
- check the user examples in the code documentation (using the Doxygne documentation ,which you may find using the Documentation menu of the GUI) for electric arcs to adapt the rest.

covofi was never a user subroutine, so I do not know for which reason it was in your setup (it might have contained a bug fix, or might not have been important at all).

If the people who did the initial setup cleaned up their routines to only contain the important (non-default) settings, this should not be too hard. If the setup contained a bit of everything, and you have a good description of the case you are trying to run, restarting from scratch might be the simpler solution.

Best regards,

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

Re: Case for CS1.3 adaptation to CS4.2

Post by rodion »

Hello Yvan,

Thank you for your answer.
CS 4.3 doesn't not start on my PC (Windows 10), that's why I use CS 4.2. Maybe it will change after Windows updates. I tried CS on virtual machine with Lubuntu in VirtualBox, but the desktop environment freezes after launch of any CS 4 and works good with CS 3. That's why I use CS on Windows.

I need to use CS for this case without GUI.
Should I change those Fortran files or add some aditional files to the directory?

For example, I have subroutine usipph in the file usini1.F. Should I create the file cs_user_parameters.f90 and move usipph in it?

Maybe the file cs_user_scripts.py is necessary or I can just define mesh name somewhere else?
Like this:
def define_domain_parameters(domain):
if domain.param == None:
domain.meshes = nozzle2.5mm_15mm.neu

And where should I put files cs_user*.f90?

Best regards
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: Case for CS1.3 adaptation to CS4.2

Post by Yvan Fournier »

Hello,

Yes, you can define the mesh in cs_user_scripts.py in define_domain_parameters just like you indicated.

All the user subroutines should go in SRC (you can check in SRC/REFERENCE for base user files, and SRC/EXAMPLES for many examples).

But why can't you use user subroutines ? Especially on Windows...

Also, when you say the version 4.3 does not start on Windows, do you have an install problem, the graphical interface does not start, or the code does not start when you press the button in the interface ? If the issue is the last one, you can work around it by running SCRIPTS/runcase.bat directly. In any case, feedback is helpful.

Regards,

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

Re: Case for CS1.3 adaptation to CS4.2

Post by rodion »

Thank you for your answer, Ywan.

Sorry, I didn't understand

1) Are the files cs_user_scripts.py and cs_user_parameters.f90 necessary or I can put the whole additional code to the files I already have?
I'm asking because first of all I want just to recalculate the case with minimum changes. And for example I already have subroutine usipph in the file usini1.F.

2) Should I change something in Fortran files? e.g. names of variables or functions, maybe they are different for new version of CS.

Best regards
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: Case for CS1.3 adaptation to CS4.2

Post by Yvan Fournier »

Hello,

There have been significant changes between versions 1.3 and 2.0 (automatic mode to unformatted Fortran), between 2.0 and 3.0 (removal of iphas), and between 3.0 and 4.0 (many minor changes), so many subroutines have changed significantly.

Using the GUI/XML, we have an automatic upgrade feature, but for user subroutines, that would be much too complex, so there is no such thing as a conversion with "minimal changes" to run a case defined in 1.3 with user subroutines only to 4.0. You really need to rebuild the setup. This is why I suggest using the GUI and working from you case description.

Regards,

Yvan
Post Reply