Page 1 of 2

Error in velocity field definition?

Posted: Sun Mar 05, 2017 11:09 am
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

Re: Error in velocity field definition?

Posted: Mon Mar 06, 2017 1:40 am
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

Re: Error in velocity field definition?

Posted: Mon Mar 06, 2017 3:39 am
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

Re: Error in velocity field definition?

Posted: Mon Mar 06, 2017 11:23 pm
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

Re: Error in velocity field definition?

Posted: Tue Mar 07, 2017 7:52 am
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

Re: Error in velocity field definition?

Posted: Tue Mar 07, 2017 4:06 pm
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

Re: Error in velocity field definition?

Posted: Thu Mar 09, 2017 9:39 am
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!

Re: Error in velocity field definition?

Posted: Thu Mar 09, 2017 10:42 am
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

Re: Error in velocity field definition?

Posted: Fri Mar 10, 2017 6:46 am
by kennethchaw
Hi...

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

Rgds,
Kenneth

Re: Error in velocity field definition?

Posted: Fri Mar 10, 2017 4:24 pm
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