|
[Sponsors] |
Use of function objects to terminate transient simulations |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 5, 2017, 09:51 |
Use of function objects to terminate transient simulations
|
#1 |
New Member
Luca Cornolti
Join Date: Jun 2016
Location: Switzerland
Posts: 13
Rep Power: 10 |
I'm running a free surface problem with the interFoam solver of OpenFOAM v1706.
Schematically, the geometry can be described as a cylindrical tank with an open surface at the top, an outlet duct on the side surface and a inlet on the bottom surface. From the inlet, I'm filling the tank only with water. From the outlet duct both air and water flow out, as in a water channel problem. The height of water adjusts itself such that it allows the amount of water introduced thought the inlet to flow out from the outlet duct. I'm running some transient simulations to reach the final water level which changes with the inlet flow. In general the time needed to reach the steady state is not known a-rpiori and I have to run many simulations. Therefore, I'd like to use the function objects in the controlDict to stop the simulation when some criteria are reached. For example, when the total water flow at the inlet at the outlet duct are equal and the outlet flow does not significantly change with time. I checked this link to get some ideas: http://www.openfoam.com/releases/ope...on-control.php And I came out with the following code: Code:
functions { inletFlux { type surfaceFieldValue; libs ("libfieldFunctionObjects.so"); fields ( alphaPhi ); writeFields false; log true; surfaceFormat null; regionType patch; name inlet; operation sum; writeControl timeStep; } outletFlux { $inletFlux; name outlet; } averageInletFlux { type valueAverage; functionObjectLibs ( "libfieldFunctionObjects.so" ); writeControl timeStep; functionObject inletFlux; fields (???????); window 0.01; } averageOutletFlux { $averageInletFlux; functionObjectName outletFlux; } // Compute flux difference Fluxdifference { type ??????; } runTimeControl1 { type runTimeControl; functionObjectLibs ("libjobControl.so"); conditions { // Terminate when inlet and outlet fluxes difference is less than tolerance difference { type average; functionObjectName Fluxdifference; fields (??????); tolerance 1e-4; window 50; } // Terminate when average OutletFlux changes by less than a tolerance average1 { type average; functionObjectName averageOutletFlux; fields (??????); tolerance 1e-4; window 50; } } } } The problem is that I'm missing some information (lines with question marks), specifically: 1) what is the name of the field returned by inletFlux and outletFlux functionObjects on which I can operate (see the link for an example with forceCoeffs functionObjects)? 2) How to compute the difference of these two fluxes? Thank you for your suggestions, Luca Last edited by Tobi; October 6, 2017 at 05:09. Reason: Please use code tags. |
|
June 18, 2019, 10:07 |
|
#2 |
Senior Member
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9 |
Hello!
Did you manage to solve this conundrum? I have a very similar case at the moment. Thanks! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Transient Simulations | saisanthoshm88 | CFX | 7 | July 13, 2013 07:57 |
channelFoam for a 3D pipe | AlmostSurelyRob | OpenFOAM | 3 | June 24, 2011 14:06 |
ParaView for OF-1.6-ext | Chrisi1984 | OpenFOAM Installation | 0 | December 31, 2010 07:42 |
Droplet Evaporation | Christian | Main CFD Forum | 2 | February 27, 2007 07:27 |
URANS and Transient Simulations | bob | Main CFD Forum | 0 | October 1, 2003 04:54 |