March 30, 2017, 06:29
|
externalCoupled BC/function object without patch
|
#1
|
New Member
James Bridgwater Court
Join Date: Jan 2016
Posts: 14
Rep Power: 11
|
Hi FOAMers,
Hopefully someone can help me. I'm developing a co-simulation between OpenFOAM and another program that uses the output data from the 'forces' run-time functionObject, along with the solver log file itself, to calculate the resistance that should be applied to the moving body in my OpenFOAM simulation (a numerical wave tank, solver interDyMFoam/olaDyMFoam). Because I want to use the p_rgh values on the moving body for postProcessing I'm unable to apply the resistance as a pressure distributed across the patch, so my approach has been to get the other program to update a restraint that I've #include-d in my constant/dynamicMeshDict file. I've been managing the co-simulation interaction from a C++ application that administers the two pieces of software and calls code that I've written for the other program to make use of the lock-file synchronisation functionality provided by externalCoupled, and that interaction itself has been working pretty nicely.
However, I've been having problems with the OpenFOAM solution, as use of externalCoupled - the boundary condition in OF3.0.1, which I've been applying to a 'safe' bit of my domain boundary and spoofing the data for - leads the solver time step to drop off a cliff, and the solution to eventually fail with huge values of alpha.water and residual error. To clarify, the spoofed data that I was providing was the data that OpenFOAM itself had calculated for that patch, just bounced back at it - and the safe bit of my domain boundary was some of the air part of my outlet boundary. I tried using the functionObject form of externalCoupled provided with OF v1612+, hoping to be able to avoid having to spoof data by not needing to apply it to a specific patch, but it seems to require the 'regions' keyword to be defined.
So, my question is sort of two-fold:
- Is it already possible to use externalCoupled without needing to provide solution data for a patch in the OpenFOAM simulation?
- If not, does there exist the functionality within OpenFOAM to define part of the surface of a geometry file as a different patch? (as far as I'm aware, I'm unable to define named regions within my geometry file
)
The second part of the question comes about because my alternative approach would be to apply the calculated resistance as a pressure on a small part of the moving body instead. Failing that, I'll have to look into adapting the externalCoupled functionality into a function object that does what I want it to do, which could take some time as I'm no C++ expert!
Thanks,
James
|
|
|