How to modify vectorField in runtime
Hi Foamers,
I am now facing a problem with respect to the use of vectorIOField. My solver needs to read such a Field when it's changed during the simulation. I used: Code:
positionsFile_(this->coeffDict().lookup("positionsFile")), I appreciate your help. carlen |
Quick answer: See this post of mine: http://www.cfd-online.com/Forums/ope...tml#post513974 - post #5
|
Hi bruno,
I read you post and now my code looks like this Code:
const word positionsFile_ = this->coeffDict().lookup("positionsFile"); Code:
template<class CloudType> Code:
error: invalid use of member function (did you forget the ‘()’ ?) Thank you in advance, Carlen |
Hi Carlen,
My guess is that the error you're looking at is actually something that happens as a consequence of an earlier error message. Uhm.. I tested this just now and I got the same error message, without any previous errors... well this is certainly weird... OK, I reproduced the error because I used this: Code:
vectorField positions_(); Code:
vectorField positions_; Therefore, my guess is that the error message you've gotten is actually pointing to another line!? Best regards, Bruno |
Hi Bruno,
Thanks for your reply. I wasnt pointing to any line in my code. I double checked my code and it does not seem to be wrong. Any idea how to solve this problem? Best regards, carlen |
Hi,
Can you please tell us what is this in both cases? Well, it is clear that in the second case it is carlenManualInjection class. Has it got owner property? Or is it a method? |
Hi Alex,
I wrote this injector based on MaunalInjection. What I did is basically using an IOdictionary to read positions, diameters and velocities of particles from file. Code:
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Code:
regIOobject::readIfModified() : Thank you very much for you time. Best, carlen |
Anyone who knows how to solve this problem, please, help me out. I have stuck here for one week.
Thank you in advance, carlen |
Hi,
I am not quite sure if I get right what you are doing. So here are my questions: 1. Is it standard solver or your own? 2. If you have something that generates sprayCloud* files on every time step, why this thing can not just call a carlenManualInjection class method with content of the files as a parameters? 3. This is in fact commentary, not a question. As the files are re-read by regIOobject class, you can look at the implementation of this functionality in the class. Or even add regIOobject to the base classes of your class and override read and readIfModified methods. |
Quote:
Thank you very much for your help Alex. Best, carlen |
Hi Carlen
I think I'm doing something fairly similar to you, except rather than making my own injection model, I've just modified 'kinematicLookupTableInjection'. I've added another column to the lookupTable, and it works fine: however the injector only reads the file when initialising the solution. How did you make the injector re-read the dictionaries? Code:
template<class CloudType> Any suggestions are appreciated, I've been stuck on this for weeks. |
All times are GMT -4. The time now is 21:24. |