Sorry for the late reply, I've been really busy!
I'm not sure why you're getting the behaviour that you observe. Possibly U has gone out of scope or something? The write() function just writes the current U field to the 0/U file. I'd probably need to see it for myself, feel free to post your files in a tarball and I can take a quick look. |
Thanks Laurence for your attention even with all your work. Well, this is the code:
Code:
// Velocity field initialization Code:
# include "createTime.H" As you can see, after rewriting in memory the U vector field I call the .write() method to write the field to the hard disk. The problem is that if you run the code once, the initializated U field doesn't remain in memory, i.e. the advection equation is solved with another field, maybe zero, I don't know. But, in the other hand, if you run the code some steps, then stop it and run it again with the /0/U recently written things go well. That's all. Regards. |
This worried me slightly, so I took a look, and I think I've figured it out.
The scalar transport equation takes phi as the coefficient in fvm::div, not U. So you have overwritten U, but now you have to recreate the flux. So just put Code:
#include "createPhi.H" Code:
#include "USetUp.H" |
Laurence, I've been working in another things last months but I've returned to this problem. Your suggestion was right, FOAM was assembling the flux with the original U not with the one calculated by my code. I had to put the
Code:
#include "createPhi.H" Code:
#include "USetUp.H" Code:
#ifndef createPhi_H Regards. |
Dear Santiago,
I am struggling with getting a parabolic internal field for pipe flow in openfoam and I've found your post very useful. Could you please give me some hints on the line "U.internalField()=omega*(axis^palanca);" ? Another silly question, where shall I put the code, in 0/U or somewhere else? Do I need to derive my own solver for it? I really appreciate your reply. Thank you very much. Best regards, Tony |
Greetings to all!
FYI for future readers: Tony's question has been in essence answered here: http://www.cfd-online.com/Forums/ope...tml#post468380 @Tony: Regarding your question about Santiago's implementation: from what I can figure out from the first few posts, it seems that he created a variant of the solver scalarTransportFoam and added a new header file that includes the code discussed in this thread. It takes a while to explain it in more detail, so I suggest that you have a look at the following tutorials, in order to get a bit more perspective into the details:
Best regards, Bruno |
Hi, Bruno
Thank you very much for the information. I will have a look at that and get back to you if I have further questions. Best regards, Tony |
All times are GMT -4. The time now is 01:07. |