free surface initial displacement initialization

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
st268
Posts: 64
Joined: Fri May 31, 2013 10:45 am

Re: free surface initial displacement initialization

Post by st268 »

Hi Yvan,

I set it up with the GUI and only the cs_user_initialisation subroutine and it crashes with the same error so I guess it is in that subroutine! I have posted on an older post where I was discussing setting up a standing wave with Martin Ferrand (http://code-saturne.org/forum/viewtopic ... 3&start=10) in the hope that it is simply my not calling the correct variable for initialising the displacement.

Thanks again for all your help!
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: free surface initial displacement initialization

Post by Yvan Fournier »

Hello,

Does it also crash without the initialization user subroutine (in which case we can try to reproduce the issue ?).

If it only crashes with that routine, could you post both the routine and the GUI XML file (the combination of the two defining the setup completely, assuming a given mesh)

Regards,

Yvan
st268
Posts: 64
Joined: Fri May 31, 2013 10:45 am

Re: free surface initial displacement initialization

Post by st268 »

Hi Yvan,

So it is now working with the GUI only, though of course this does not fully define my case since I need the free surface to be initially displaced which I cannot do through the GUI.

When I include my cs_user_initialisation script to do this it exits with a memory error:
"SIGSEGV signal (forbidden memory area access) intercepted!"

A different error to before...progress?

I have attached the mesh, xml and cs_user_initialization scripts

Thanks again
Attachments
SloshingGUI.xml.zip
(2.07 KiB) Downloaded 307 times
2d_box_sloshing_cozzithesis.med.zip
(1.04 MiB) Downloaded 315 times
cs_user_initialization.f90.zip
(2.27 KiB) Downloaded 286 times
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: free surface initial displacement initialization

Post by Yvan Fournier »

Hello,

Checking your cs_user_initialization, I see that you should not be redifining:
integer impale(nnod)
double precision depale(3,nnod), xyzno0(3,nnod)
(which are then uninitialized in your case)
but:
use albase
If you still have issues after this fix, comment lines in your file (for example inside the loop) until you determine exactly which line is related to the crash.

Regards,

Yvan
st268
Posts: 64
Joined: Fri May 31, 2013 10:45 am

Re: free surface initial displacement initialization

Post by st268 »

Hello,

So I need to initialise impale and depale with something like:

call field_get_val_s(ivarfl(),impale)
call field_get_val_v(ivarfl(),depale)

Here is part of my issue. I do not know what the variable is I should be calling! I took the impale, depale stuff from the ALE tutorial, and redefined them as it threw uninitialised errors if I didn't. I'd never read or heard about albase before. Do I use xstr0, which is an ale variable, in which case I need to have defined a structure for internal coupling right?

Sorry I am very frustrated with this, I know my fortran is crap but I find it very hard to find specific variable information without knowing the name of the variable I am interested in. If you could point me to somewhere, anywhere, that explains what variables I should be using to set an initial mesh displacement without internal/external ale coupling I would be so so grateful.

Thanks,
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: free surface initial displacement initialization

Post by Yvan Fournier »

Hello,

No, these arrays are not currently defined as fields (they may be in the future), they are direclty defined as arrays in the albase module, so adding "use alebase" is enough.

In any case, when referring to a variable you find in older tutorials or examples, search for that name in the Doxygen documentation of the code. You should find both the matching module/field name, ... and description, at least in most cases (for example, impale is described, depale missing)...

Also, if you are not familiar with programming, as a general rule, whatever the programming language, think as if variables were math variables: if you use one without defining it first, things won't work. When a variable is defined in a module, you can expect that it has been initialized, but if you define it locally, you must define it yourself, and it must serve some local purpose.

Regards,

Yvan
st268
Posts: 64
Joined: Fri May 31, 2013 10:45 am

Re: free surface initial displacement initialization

Post by st268 »

Thanks Yvan,

I do use the Doxygen pages a lot but I guess in this case I can't find a variable in an old tutorial so don't have a starting off point for what I am looking for other than asking on this forum.

Could you confirm that depale, impale and xyzno0 are what I should be using to initialise a free surface displacement in cs_user_initialisation? They are used in usalcl.f90, where they have been defined in the variables section without calling abase. Depale also isn't included anywhere in albase as far as I can see.

Thanks
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: free surface initial displacement initialization

Post by Yvan Fournier »

Hello,

I'm actually not knowledgeable enough in the ALE part of the code to tell you what needs to be computed first, an what works, what doesn't...

xyzno0 is the "initial position" of vertices. Between depale (displacement) and impale (prescribed positions), I am not sure what is effective in the beginning of the time step and what becomes effective after...

I'll let Martin or someone who has more experience with ALE answer that one... or you can experiment...

Regards,

Yvan
st268
Posts: 64
Joined: Fri May 31, 2013 10:45 am

Re: free surface initial displacement initialization

Post by st268 »

Hello and happy new year,

I am still struggling with this. Is Martin currently active on the forum? Or anyone who is knowledgeable about the free surface side of code_saturne? Or should I be enquiring somewhere else?

Thanks
st268
Posts: 64
Joined: Fri May 31, 2013 10:45 am

Re: free surface initial displacement initialization

Post by st268 »

Bump.
Post Reply