Creating a new field variable
Posted: Thu Aug 13, 2015 10:30 am
Hello,
Through the user subroutines, is it possible to create a new field variable?
In cs_user_parameters I added the following lines:
itycat = FIELD_INTENSIVE + FIELD_PROPERTY
ityloc = 3
idim1 = 3
ilved = .true.
inoprv = .false.
call field_create('var1', itycat, ityloc, idim1, ilved, inoprv, f_id)
call field_set_key_int(f_id, keyvis, 1)
call field_set_key_int(f_id, keylog, 1)
In the setup.log and in the listing file for each time iteration, my new field variable var1 is present. In cs_user_extra_operations.f90, I use field_get_val_v(var1, p_var1) to call the variable and assign it a value. However, in the listing file and results file, the value is zero. To double check that my routine in cs_user_extra_operations.f90 works, I output my results directly and obtain what I was expecting.
Is there something fundamentally wrong with this approach? I surmise that the field variable is not being saved when it is called in cs_user_extra_operations, but I can't come up with an explanation why.
Thank you,
Andrew
Through the user subroutines, is it possible to create a new field variable?
In cs_user_parameters I added the following lines:
itycat = FIELD_INTENSIVE + FIELD_PROPERTY
ityloc = 3
idim1 = 3
ilved = .true.
inoprv = .false.
call field_create('var1', itycat, ityloc, idim1, ilved, inoprv, f_id)
call field_set_key_int(f_id, keyvis, 1)
call field_set_key_int(f_id, keylog, 1)
In the setup.log and in the listing file for each time iteration, my new field variable var1 is present. In cs_user_extra_operations.f90, I use field_get_val_v(var1, p_var1) to call the variable and assign it a value. However, in the listing file and results file, the value is zero. To double check that my routine in cs_user_extra_operations.f90 works, I output my results directly and obtain what I was expecting.
Is there something fundamentally wrong with this approach? I surmise that the field variable is not being saved when it is called in cs_user_extra_operations, but I can't come up with an explanation why.
Thank you,
Andrew