CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] velocity of a patch by using swak4Foam (https://www.cfd-online.com/Forums/openfoam-community-contributions/123191-velocity-patch-using-swak4foam.html)

sasanghomi September 6, 2013 09:31

velocity of a patch by using swak4Foam
 
Hi Foamers,

I am using dynamicMesh in a simulation and I want to save the velocity of a moving patch versus time . Can I do this action by using swak4Foam . Can you say me How ca I do that??

Thanks and best regards,
Sasan.

gschaider September 6, 2013 15:16

Quote:

Originally Posted by sasanghomi (Post 450220)
Hi Foamers,

I am using dynamicMesh in a simulation and I want to save the velocity of a moving patch versus time . Can I do this action by using swak4Foam . Can you say me How ca I do that??

Thanks and best regards,
Sasan.

Short answer: in principle yes, but you've got to be more specific

Before I go into details: what will always work is getting the position via "pos()" and during postprocessing calculate the velocity from this.

The rest depends on the type of mesh-motion you're using:

If the mesh motion is specified via a field cellMotionU, pointMotionU or similar then you just have to access that field like you would access any field. If you're not sure whether there is such a field use the listRegisteredObjects-functionObject and have a look at the list.

If the motion-solver works without such a field then the only chance is to do the classic "this position minus old position divided by timestep" -dance. There is a thing called storedVariables in swak that allows you to store "pos()" and use it at the next timestep. BUT: this only works if you've got a motion-solver that keeps the structure of the mesh the same (especially the number of faces on the patch must stay the same and the order in which they are numbered too)

So you really have to say what kind of mesh-motion you're doing.

General: whenever possible I tried to anticipate the problems with mesh-motion and either work around them or (as in the case of changing patch-numbers) make sure that the code fails in a controlled way. But it has been some time since I did anything especially for mesh motion. Part of the problem is that it setting up good test cases for that takes almost as much time as fixing these things. So if there are problems I'll need a small test case that reproduces the problem before I even consider fixing it.

sasanghomi September 8, 2013 07:08

Hi Bernhard ,

Thank you very much for your complete reply. Actually I am using sonicTurbDyMEngineFoam solver and simpleEngineTopoFvMesh class for handling the dynamicMesh and I don't use pointMotionU.

Thanks and best regards,
Sasan.

gschaider September 9, 2013 14:30

Very important with mesh-motion: always state which version of OF you use. Because that is where the two flavours of OF massively differ
Quote:

Originally Posted by sasanghomi (Post 450471)
Thank you very much for your complete reply. Actually I am using sonicTurbDyMEngineFoam solver and simpleEngineTopoFvMesh class for handling the dynamicMesh and I don't use pointMotionU.

Quick glance at the (1.6-ext) sources didn't show any obvious fields to use. Which doesn't mean there aren't any (it was really quick). So use the listRegisteredObjects FO to see if there are any likely candidates. If there aren't you'll have to derive the velocity from the positions.

Sorry for not being more helpful


All times are GMT -4. The time now is 22:30.