Problems creating a volScalarField with expressionField function-object
Hi all,
Recently I have been trying to develop a boundary condition for convective heat transfer using swak4foam. For more information you can go to my last post regarding this problem (externalwallheatfluxtemperature-bc-h-function-twall). I'm still a bit lost about this matter, but, as a start, I tried to create a field named "hExtV" to define the convective heat transfer at the external wall (patch). To do so I have been reading all the documentation I have found about swak4foam. Firstly, I tried to create the new field with funkySetFields. After it was executed a new file with the mentioned name was created in the coresponding region directory, as expected. After that, I tried to modify its value with the manipulatePachField function object, but an error appeared and I wasn't allowed to do that. Now I don't remember the error message, but I googled it and I found that executing the following function object it may be seen if the field was created successfully. Code:
listFields My second attempt was to create the field with the expressionField FO instead of funkySetFields. The field creation was successful as it can be seen in the output: Code:
Creating expression field hExtV ... type:volScalarField At this stage, I would like to know what I am doing wrong. What should I do in order to create the file in the region directory? I attach the functions subdictionary specification so that you can see how I did it and the funkySetFields call I used. Code:
functions Code:
funkySetFields -create -field hExtV -time 0 -expression '0' -dimension '[1 0 -3 -1 0 0 0]' Many thanks in advance! Alex |
Well, after some trials I found out why expressionField function object didn't create the field file in the directory <time>/<region>/h_extV. The point is that when I opened this thread I had only checked the 0/<region> directory and, for some reason I can't figure out, the FO is not creating the field in the time 0 but it does for the following time steps. On the other hand, funkySetFields creates the field in the time 0 due to the -time 0 flag I used.
Besides that, I still have problems with the manipulatePatchField FO. As stated in the previous post, this FO cannot manipulate the field created with funkySetFields utility since it says that the field doesn't exist (the field file is created in the 0 time folder but it's not listed when listRegisteredObjects FO is applied). However, when the field is created by means of the use of manipulatePatchField FO it seems that it does manipulate the field according to what it shows the output of the solver (see below), but no <time>/<region>/h-extV file shows any value. ·extract of the solver's log file Code:
Creating expression field h_ExtV ... type:volScalarField Code:
dimensions [1 0 -3 -1 0 0 0]; Code:
functions 1. Why does expressionField not create the field at the first time (time 0)? What should I do to make it create it? 2. Why is manipulatePatchField supposedly manipulating (and (re)writing) the field but no value is writen in the field file and it remains untouched with the same value time after time? In the case I am testing h_extV takes (or at least that's what I want to) the same value than T field at the patch as you can see above in the controlDict code attached. Of course this is meaningless, it's just for testing and trying to understand how to use these FO's. Then I don't understand why the output says Code:
The minimum value 8.6192246 and the maximum 9.2404733 differ. I will use the average 9.2120186 I will appreciate any hint you can give me in regards of these FO's usage. If you need more info, just let me know! Many thanks in advance, Alex |
Can anyone, please, give me some hint about my problems with creating and manipulating new fields?
Many thanks in advance. Alex |
All times are GMT -4. The time now is 19:25. |