|
[Sponsors] |
Dictionary update from a boundary condition: is it possible? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 10, 2017, 12:27 |
Dictionary update from a boundary condition: is it possible?
|
#1 |
New Member
Join Date: Oct 2016
Posts: 20
Rep Power: 10 |
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 |
|
August 10, 2017, 18:46 |
|
#2 |
Member
Luis Eduardo
Join Date: Jan 2011
Posts: 85
Rep Power: 15 |
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 |
|
August 10, 2017, 21:04 |
|
#3 |
Senior Member
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 16 |
Hey Fellows
Searching a little bit would be beneficial sometimes Snippet for redefining fixedGradient boundary condition for a patch inside solver objectRegistry::lookupObject<scalar> If you need further elaboration, let me know Regards |
|
August 11, 2017, 18:10 |
|
#4 |
New Member
Join Date: Oct 2016
Posts: 20
Rep Power: 10 |
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! |
|
August 14, 2017, 17:36 |
|
#5 |
Senior Member
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 16 |
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 |
|
August 16, 2017, 13:34 |
|
#6 |
New Member
Join Date: Oct 2016
Posts: 20
Rep Power: 10 |
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++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object batchProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // BatchMass 1; // ************************************************************************* // Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object batchProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Mass { BatchMass 1; } // ************************************************************************* // |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CFD analaysis of Pelton turbine | amodpanthee | CFX | 31 | April 19, 2018 19:02 |
Centrifugal fan-reverse flow in outlet lesds to a mass in flow field | xiexing | CFX | 3 | March 29, 2017 11:00 |
Question about heat transfer coefficient setting for CFX | Anna Tian | CFX | 1 | June 16, 2013 07:28 |
Error finding variable "THERMX" | sunilpatil | CFX | 8 | April 26, 2013 08:00 |
asking for Boundary condition in FLUENT | Destry | FLUENT | 0 | July 27, 2010 01:55 |