Specify value of surfaceVectorField
Hello,
I have a problem when I specify surfaceVectorField. I will compute flow velocity of each cell face by my own program instead of using fvc::interpolation(U). So I declare a surfaceVectorField called Uf in the createFields.H, just like velocity: surfaceVectorField Uf ( IOobject ( "Uf", runTime.timeName(), mesh, IOobject::READ_IF_PRESENTS, IOobject::NO_WRITE ), mesh ); In each time step I will assign Uf, for example Uf[faceID].x()=x velocity I computed ,which is also applied for y and z But while executing the program, I have this error: free(): invalid pointer Aborted (core dumped) If I comment this line, then there be no problem. It looks like if I specify Uf directly, the program will free Uf twice. My questions are: 1. How do I assign surfaceVectorField by value and 2. why Uf will be free twice? I have earlier did the same to velocity (volVectorField) but there is no problem. I will appreciate for any advice. Thank you |
https://www.openfoam.com/documentati...8H_source.html
Maybe the way the face flux phi is created helps |
Hello, mAlletto,
Thank you for your answer. I did the same way to create my variable. I have found the reason due to this error Quote:
|
All times are GMT -4. The time now is 07:09. |