CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Flow dependent forces (http://www.cfd-online.com/Forums/openfoam-programming-development/90381-flow-dependent-forces.html)

lichmaster July 8, 2011 06:05

Flow dependent forces
 
Hi all,

I developed an incompressible turbulent single phase flow solver with a generalized actuator disk model acting as a local volume force. I can specify forces and torques as a prescribed input.
However, I'd like to compute these forces as function of local flow conditions (U and other parameters)... any hint on how could I do it?

Thank you :)

gschaider July 11, 2011 18:13

Quote:

Originally Posted by lichmaster (Post 315298)
Hi all,

I developed an incompressible turbulent single phase flow solver with a generalized actuator disk model acting as a local volume force. I can specify forces and torques as a prescribed input.
However, I'd like to compute these forces as function of local flow conditions (U and other parameters)... any hint on how could I do it?

Thank you :)

"function of local flow conditions" is rather general. An equally general answer would be "Program it"

lichmaster July 15, 2011 06:28

My question was general indeed... As an OF beginner, and also an OOP beginner, I had to learn how to gain access to field data from my own additional structures and use this info ('till now I had just copy/pasted/edited some tutorials)
Now I've managed to add a momentum source function of local U in a dictionary specified volume, something interesting to start playing with :)

gschaider July 18, 2011 11:07

Quote:

Originally Posted by lichmaster (Post 316231)
My question was general indeed... As an OF beginner, and also an OOP beginner, I had to learn how to gain access to field data from my own additional structures and use this info ('till now I had just copy/pasted/edited some tutorials)
Now I've managed to add a momentum source function of local U in a dictionary specified volume, something interesting to start playing with :)

The question is what your primary goal is

- learning C++ in OpenFOAM (a valid goal)
- solve your problem and play around (as you said in the first post) "forces as function of local flow conditions"

In the first case the best recommendation is to do it the way everyone did: dig through the sources.

In the second case you might want to have a look at swak4foam. Instead of the vol-Field that you use as a source-term add an expressionSource-object. And for that you can specify expressions at run-time (there is a solver/case using that in the Examples). These expressions can depend on the current flow-field, but also on the state of the flow on patches, in cellSets, at the location of probes (depending on what you mean with "local flow conditions"). Once you know more concretly what it is that you want to do you can always go back and implement it yourself in C++

Bernhard

Disclaimer: as I wrote swak this might be a case of "if you've got a hammer every problem looks like a nail"

lichmaster July 19, 2011 04:48

Quote:

Originally Posted by gschaider (Post 316483)
The question is what your primary goal is

- learning C++ in OpenFOAM (a valid goal)
- solve your problem and play around (as you said in the first post) "forces as function of local flow conditions"

In the first case the best recommendation is to do it the way everyone did: dig through the sources.

In the second case you might want to have a look at swak4foam. Instead of the vol-Field that you use as a source-term add an expressionSource-object. And for that you can specify expressions at run-time (there is a solver/case using that in the Examples). These expressions can depend on the current flow-field, but also on the state of the flow on patches, in cellSets, at the location of probes (depending on what you mean with "local flow conditions"). Once you know more concretly what it is that you want to do you can always go back and implement it yourself in C++

Bernhard

Disclaimer: as I wrote swak this might be a case of "if you've got a hammer every problem looks like a nail"

Actually I'm digging into part of the code and tweaking existing solvers to learn how OF works.
It's a trial and error procedure, but i think there is simply too much code for an OOP newby to simply understand it just by reading it: i'm much more used to structured Fortran code :)

Thanks for the pointer, anyway :)


All times are GMT -4. The time now is 11:36.