Error in velocity field definition?

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
kennethchaw
Posts: 36
Joined: Sat Oct 01, 2016 6:31 pm

Error in velocity field definition?

Post by kennethchaw »

Hi all,

I just started to try user subroutine to run a simple study with CS 4.0.6 on a Linux MATE machine. I just modified the necessary user subroutines as in guide. However, error prompted "Fortran pointer of rank 1 requested for values of field ". I have checked out some other threads but it seems I do not have those problems ?


Thanks,
Kenneth
Attachments
test_bline_chimney.tar.gz
(2.21 MiB) Downloaded 204 times
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Error in velocity field definition?

Post by Yvan Fournier »

Hello,

It seems the problem in your case is that ibeta is not defined, so your usphyv routine in not correct.

ibeta (for the thermal expansion field) is only defined with both irovar and a non-SGDH thermal turbulent gradient hypothesis (for example GGDH).

Does the use of ibeta come from an example you used? In this case, where is that example from ?

Regards,

Yvan
kennethchaw
Posts: 36
Joined: Sat Oct 01, 2016 6:31 pm

Re: Error in velocity field definition?

Post by kennethchaw »

Hi Yvan,

The problem is from my coursework, while the steps I followed the tutorial by Hartree Centre. Anyway, I have activated the irovar and the turbulent flux model (Anyway, I not really understand how ibeta will be defined from this, what value it gives?), it now proceeds to "Starting Calculation"...but the listing stucked at the pre-processing, I have done something else wrongly?

Attached is the updated study file.

Thanks,
Kenneth
Attachments
test_bline_chimney.tar.gz
(3.67 MiB) Downloaded 198 times
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Error in velocity field definition?

Post by Yvan Fournier »

Hello,

To set up cases, I recommend also building and using a debug version of the code (configured using --enable-debug).

This helps find issues such as here.

In your cs_user_boundary_conditions.f90 file, line 493, you set ii = 2, for scalar 2, but have only one scalar. So you need to fix this setup.

Regards,

Yvan
kennethchaw
Posts: 36
Joined: Sat Oct 01, 2016 6:31 pm

Re: Error in velocity field definition?

Post by kennethchaw »

Hi,

Sorry...Is the debug mode need to be configured before creating the study?? or even before installing?

Anyway, how do u you identify the problem if this error always comes up: "Fortran pointer of rank 1 requested for values of field "velocity", which have rank 2." ?

Thanks again,
Kenneth
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Error in velocity field definition?

Post by Yvan Fournier »

Hello,

The debug mode needs to be configured before installing (you can do an install to a secondary path so as to keep your main install for use once the case is debugged).

The identification of the problem is quite indirect:
- the Fortran pointer of rank 1 tells me you used ...get_val_s instead of get_val_v
- looking at your code, I see ...get_val_s is not used for velocity, but for ibeta
- I suspect that if ibeta = 0, iprpfl(ibeta) = 0, which is also the field id for velocity
- I use "grep" to search the source code for the existenc of ibeta
...

Best regards,

Yvan
kennethchaw
Posts: 36
Joined: Sat Oct 01, 2016 6:31 pm

Re: Error in velocity field definition?

Post by kennethchaw »

Hi...

Isn't get_val_s for scalar field? as I wish to call the scalar temperature values (the boundary condition) to calculate the density?
I cannot understand why do I have to call anything for velocity after all I don specify any velocity inlet etc?

Thanks much!
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Error in velocity field definition?

Post by Yvan Fournier »

Hello,

You don't have to specify anything for velocity, but the code mixes things up because you reference a field that does not exist (ibeta). Note that you would probably have a clearer error message with 4.3 or 5.0.

Are you using reference files from the coursework, or following it step-by-step ?

Regards,

Yvan
kennethchaw
Posts: 36
Joined: Sat Oct 01, 2016 6:31 pm

Re: Error in velocity field definition?

Post by kennethchaw »

Hi...

I See... I followed it step by step.

Rgds,
Kenneth
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Error in velocity field definition?

Post by Yvan Fournier »

Hello,

Do you have a "reference setup" from the course which you could compare to your setup (so as to be able to check if you missed a step ?).

Best regards,

Yvan
Post Reply