CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

writing solid body position to a file - sixdof issue

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree7Likes
  • 4 Post By fsaltara
  • 3 Post By simon-2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 5, 2014, 12:13
Default writing solid body position to a file - sixdof issue
  #1
New Member
 
Join Date: Mar 2009
Posts: 21
Rep Power: 18
fsaltara is on a distinguished road
When using the sixdof solver, how is it possible to write the time history of the body position to a file, like it is done with the forces?
simon-2, araujo, zhan and 1 others like this.
fsaltara is offline   Reply With Quote

Old   February 26, 2014, 14:35
Default
  #2
New Member
 
Join Date: Sep 2013
Posts: 10
Rep Power: 12
simon-2 is on a distinguished road
hi,
unfortunately, i don't know how to do this well, but i'm also looking for a solution to this problem. Obviously, there is no ready-to-use functionObject for logging positions as there is for forces.
using other functionObjects, i got the demanded values, but in a very bad structure:

i used functionObject "writeRegisteredObject" in controlDict to write object "dynamicMeshDict":
a)
Code:
functions
{
    positions 
    {
        // Forcibly write registered objects

        type            writeRegisteredObject;
        functionObjectLibs ("libIOFunctionObjects.so");
	log 		yes;
        
        outputControl   timeStep;
        outputInterval  1;
        writeInterval   1;

        // Objects to write
        objectNames    ( dynamicMeshDict );
    } 
};

this produces folders and files for every single timestep

this means, i would get thousands of files like
caseRoot/80.01/uniform/sixDoFRigidBodyMotionState.gz
caseRoot/80.0199/uniform/sixDoFRigidBodyMotionState.gz
caseRoot/80.0298/uniform/sixDoFRigidBodyMotionState.gz
and so on, each containing a file like
b)
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "80.0199/uniform";
    object      sixDoFRigidBodyMotionState;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

centreOfMass    ( 3.3 0 0.1386375 );

orientation     ( 0.99807619 0 0.061999301 0 1 0 -0.061999301 0 0.99807619 );

velocity        ( 0 0 0.0045163445 );

acceleration    ( 1.3211615 -2.6233042 0.84606626 );

angularMomentum ( 0 -0.2529557 0 );

torque          ( 1109.8274 99.511973 -24.488035 );


// ************************************************************************* //
but does NOT create a logfile.
in fact, this is the information i was looking for, but i would prefer to get a single file like

c)
Code:
#time centreOfMass orientation velocity acceleration angularMomentum Torque
80.0199 ( 3.3 0 0.1386375 ) ( 0.99807619 0 0.061999301 0 1 0 -0.061999301 0 0.99807619 ) ( 0 0 0.0045163445 ) ( 1.3211615 -2.6233042 0.84606626 ) ( 0 -0.2529557 0 ) ( 1109.8274 99.511973 -24.488035 )
80.0298 ( ... ... ... ) (.. ... ... .. .. .. .. .. ..) (.. .. ..) (.. .. ..) (... .. ..)
80.0398 ( ... ... ... ) (.. ... ... .. .. .. .. .. ..) (.. .. ..) (.. .. ..) (... .. ..)
80.0497 ( ... ... ... ) (.. ... ... .. .. .. .. .. ..) (.. .. ..) (.. .. ..) (... .. ..)
like for forces output.

i know its just a matter of batch processing to collect all b)-files to a single c)-file, but it is not very clean to temporary overflood the case-directory with thousands of folders, containing folders, containig archives, containing files... before collapsing them all to one single text file.

So does anyone know a smarter solution to log these values in a single file at runtime?

regards
simon
araujo, mo_na and thanosniotis like this.
simon-2 is offline   Reply With Quote

Old   February 26, 2014, 18:31
Default
  #3
New Member
 
Leonardo Antonio de Araujo
Join Date: Feb 2014
Location: Porto Alegre
Posts: 17
Rep Power: 12
araujo is on a distinguished road
Send a message via Skype™ to araujo
have you tried to write as a "probe" in the controlDirect file?
araujo is offline   Reply With Quote

Old   February 26, 2014, 20:18
Default
  #4
New Member
 
Join Date: Sep 2013
Posts: 10
Rep Power: 12
simon-2 is on a distinguished road
probes does not work for my case, as it needs a "probeLocation", and centreOfMass is not inside any cell, because the simulated space lies outside the object - probe seems to take a value of a field in a specified location. Therefore, i tried to track the value of pointDisplacement in my centreOfMass location, with above conclusions..
but how to access motionState, which is not a field?
simon-2 is offline   Reply With Quote

Old   February 27, 2014, 04:22
Default
  #5
New Member
 
Leonardo Antonio de Araujo
Join Date: Feb 2014
Location: Porto Alegre
Posts: 17
Rep Power: 12
araujo is on a distinguished road
Send a message via Skype™ to araujo
I'm having the same issue as well, I wish to track the amplitude and trajectory of the center of mass of a cylinder subjected to VIV. Check out this tool:
http://openfoamwiki.net/index.php/Co...omRegexp-files

it may be helpful.
araujo is offline   Reply With Quote

Old   May 26, 2016, 07:49
Default
  #6
Member
 
mo_na's Avatar
 
Mona
Join Date: Mar 2016
Location: Berlin
Posts: 49
Rep Power: 10
mo_na is on a distinguished road
Hey Simon,

did you find a way of writing all the information into one file?
That would be great!
Otherwise: You said that it was "just a matter of batch processing to collect all b)-files to a single c)-file". Could you maybe help me with that? I have no clue how to do it...

Cheers,
Mona
mo_na is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Other] OpenFOAM Installation for navalFoam sachinlb OpenFOAM Community Contributions 22 July 28, 2017 05:26
[swak4Foam] swak4Foam-groovyBC build problem zxj160 OpenFOAM Community Contributions 18 July 30, 2013 13:14
2.0.x on Mac OSX niklas OpenFOAM Installation 74 March 28, 2012 16:46
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 01:24


All times are GMT -4. The time now is 03:53.