porting solver from v5 to v7
Hi everyone,
some time ago, I wrote a solver for OpenFOAM 5, which I now need to port to version 7. My problem is that the mesh.solver() method no longer exists version 7. I am thus stuck with this bit of code: Code:
// corrector for Yi Code:
// corrector for Yi best, Dries |
Dear Dries,
both codes are equal. The part mesh.solver("Yi"), just told FOAM which linear solver to use, here, the "Yi" dictionary is searched in the fvSolutions and these settings are applied. Both codes of you are identical in terms of equations. The difference is:
However, I donīt get the idea of the equation? Implicit part - explicit part? Is this a numerical trick? Both are equal. |
Dear Tobias,
thanks for your quick explanation. In that case, I will have to dig deeper to find out why the simulation is failing. best, Dries |
Hi, I updated my previous message to improve quality and my english. Just one more comment.
You should be able to use your previous code still (https://cpp.openfoam.org/v6/namespac...0126875aa319): Code:
Code:
solve Additionally, it would be good to know your compilation error. Nevertheless, both calculations are equal. |
If I understand your last suggestion correctly, this means that the mesh.solver() method if just the code that reads the dictionary in fvSolutions to find out what type of solver the user has specified.
|
Correct, if I got you right. The method solver() is a function that you apply onto the object named 'mesh'. This object is of type 'fvMesh' which includes the public derivative to the 'solutions' class in which the function solver() is defined.
This function returns a dictionary. The dictionary which is returned is based on the argument you provide. To be more precisely, the function is actually defined as 'solver(const word)'. What it does is to return the dictionary you set in the fvSolutions related to the word you set. E.g., mesh.solver("h") will return the linear solver settings specified within the dictionary 'h' in the fvSolutions file. If there is no dict specified, you get an error. . |
Ok. Thank you very much for the explanation!
|
All times are GMT -4. The time now is 00:10. |