Dictionary update from a boundary condition: is it possible?
Hello, I've read that it is possible to update a parameter from a dictionary from the main solver writing the following in the runTime loop:
Code:
myDict.set("name",value); I'm doing the following (all these in the BC code) 1- I call the parameter 2- After some operations, the value of the parameter changes 3- I set the parameter to the dictionary Everything compiles and runs OK, but the parameter doesn't get updated...I would appreciate any help :) |
Hi Joe,
I've been trying to do it on the ABL Inlet boundary conditions, I want to update the Uref after some iterations, but even if I change its values manually it won't change. The only way I found to do it is by changing, for example, the U file section where the boundary conditions are. This is actually not feasible if you want to run lots of cases, and I didn't use it. I am really hopping someone can answer to your question with an effective way of doing it! Best regards, Luis |
Hey Fellows
Searching a little bit would be beneficial sometimes ;);) https://www.cfd-online.com/Forums/op...de-solver.html https://www.cfd-online.com/Forums/op...ct-scalar.html If you need further elaboration, let me know Regards |
Thank you Bobi for your quick response.
In the link you suggested they update the dictionary from the runTime loop, but I was asking if this update dict.set("name",value) could be made from a BC. Specifically this is my case: the parameter in the dictionary contains the total mass of my physical domain, and from an specific patch, part of this mass is being lost, so based on what is lost I need to update the value of the total mass. Maybe I can do this from the main solver...but I still haven't figure out how. Making it from the BC instead would be straight forward. Regards! |
Hi JoeFriend
AFAIK, at the boundaries, you can use <refCast> to assign a custom relation (like fixed flux) to boundaries. I believe you need to add couple of lines as a header file and add it to the main solver, to recalculate and update your total mass within the solver. Regards |
Hey Bobi, thanks for your help. Its finally working. Apparently its not possible to update a dictionary using the set() function, but it is possible to update subdictionaries, so I had to create one. This is how my dictionary file was before...
Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
/*--------------------------------*- C++ -*----------------------------------*\ |
All times are GMT -4. The time now is 18:01. |