CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   reading .dat file in tanksloshing2d (http://www.cfd-online.com/Forums/openfoam-solving/92889-reading-dat-file-tanksloshing2d.html)

musahossein September 28, 2011 12:27

reading .dat file in tanksloshing2d
 
IN InterDyMFoam, the tanksolshing for 6 degree of freedom can read a data file with extension .dat. Can the same be done for the 2d tank?

wyldckat October 1, 2011 16:41

Greetings musahossein,

My experience with the "DyM" type solvers is limited, but I think it should work with 2D models as well, similarly to the traditional cavity tutorial; the ".dat" file should only make moves in X and Y, without any moves in Z, otherwise you're going to have problems...

Best regards,
Bruno

musahossein October 16, 2011 12:00

Cannot read data file for 2D Tanksloshing in interDyMFoam
 
Thanks for your suggestion. I tried to run the 2D Tanksloshing file by making the following changes to the dynamicMeshDict file, for lack of better information.

FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dynamicFvMesh solidBodyMotionFvMesh;

solidBodyMotionFvMeshCoeffs
{
solidBodyMotionFunction tabulated2DoFMotion;
tabulated2DoFMotionCoeffs
{
CofG ( 0 0 0 );
timeDataFileName "$FOAM_CASE/constant/2DoF.dat";
}
}

Upon running, I get the following error log:

Build : 2.0.1-51f1de99a4bc
Exec : interDyMFoam
Date : Oct 16 2011
Time : 10:42:21
Host : musa-Satellite-M35X
PID : 4701
Case : /home/musa/OpenFOAM/musa-2.0.1/run/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Selecting dynamicFvMesh solidBodyMotionFvMesh
Selecting solid-body motion function tabulated2DoFMotion


--> FOAM FATAL ERROR:
Unknown solidBodyMotionFunction type tabulated2DoFMotion

Valid solidBodyMotionFunctions are :

7
(
SDA
linearMotion
multiMotion
oscillatingLinearMotion
oscillatingRotatingMotion
rotatingMotion
tabulated6DoFMotion
)


From function solidBodyMotionFunction::New( const dictionary& SBMFCoeffs, const Time& runTime)
in file solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C at line 52.

FOAM exiting

I am not surprised - since I have tried to use the commands in the dynamicmeshDict file for the 3D 6DoF file. OpenFoam gives several options in the solid body motion function as shown above. Can any of those be used when trying to read a 2d data file?

Thanks

wyldckat October 16, 2011 13:19

Hi musahossein,

Try using "tabulated6DoFMotion", but like I tried to say, set all of the other degrees of motion to 0.00000.

In other words: don't forget that in OpenFOAM 2D is in fact 3D, but with a single cell in one of the directions, along with the definition of "type empty;" on both sides of that direction. I suppose you are already familiar with this, but just in case see the first tutorial in the user guide: www.openfoam.com/docs/user/cavity.php

Now, when you've got said pseudo-2D geometry, you probably can still use the "tabulated6DoFMotion" mesh motion, simply because your 2D mesh is set in a 3D space! And by setting to "0.000" the table entries related to the 3rd dimension, you'll get a 2D motion!

Best regards,
Bruno

musahossein October 17, 2011 22:26

is end time in controldict in interDyMFoam overwritten by .dat file?
 
In the control dict file for Tanksloshing2D end time is given as 40. If I am having a data file read, instead of using SDA to provide all the parameters, where the time ends at 3.6 seconds, then is the end time in the control dict file over ridden? Comments appreciated!

wyldckat October 18, 2011 18:29

Hi musahossein,

  • "controlDict" dictates the simulation time.
  • The mesh motion data specifies the known relation between time and space.
  • Therefore:
    • If the motion data has 40s, but you only simulate 3.6s, then only 3.6s are simulated.
    • If the motion data has 3.6s, but you try to simulate 40s, then it will crash/stop simulating at 3.6s and complain about the missing information.
I hope this answers your question!

Best regards,
Bruno

musahossein October 18, 2011 21:15

Quote:

Originally Posted by wyldckat (Post 328494)
Hi musahossein,

  • "controlDict" dictates the simulation time.
  • The mesh motion data specifies the known relation between time and space.
  • Therefore:
    • If the motion data has 40s, but you only simulate 3.6s, then only 3.6s are simulated.
    • If the motion data has 3.6s, but you try to simulate 40s, then it will crash/stop simulating at 3.6s and complain about the missing information.
I hope this answers your question!

Best regards,
Bruno

Many thanks!

musahossein October 24, 2011 21:36

6DoF.dat file
 
I looked at the 6DoF.dat file that is read in the example for the SoloshingTank6DoF solver in interDyMFoam. All the displacements are positive. How is it then when the solver is run, the result is a swaying and rocking motion? in other words oscillation is occurring?

wyldckat October 25, 2011 04:27

Hi musahossein,

Following the breadcrumbs:
As you can see in the tutorial's file "constant/dynamicMeshDict": https://github.com/OpenFOAM/OpenFOAM...ynamicMeshDict - it's that type of motion it's using.
In the first link you can also find other types of motion for "solidBodyMotionFvMesh".

Best regards,
Bruno

musahossein November 1, 2011 10:09

reading data from ".dat" file
 
Quote:

Originally Posted by wyldckat (Post 329292)
Hi musahossein,

Following the breadcrumbs:
As you can see in the tutorial's file "constant/dynamicMeshDict": https://github.com/OpenFOAM/OpenFOAM...ynamicMeshDict - it's that type of motion it's using.
In the first link you can also find other types of motion for "solidBodyMotionFvMesh".

Best regards,
Bruno

As I try to trace the different modules that do different things, I am not sure I understand where the data acutally read and the displaments computed. I found one header file "septernion.H". Doe this have the necessary references for reading ".dat" data file and deriving the translations?

wyldckat November 1, 2011 10:34

Hi musahossein,
Quote:

Originally Posted by musahossein (Post 330311)
As I try to trace the different modules that do different things, I am not sure I understand where the data acutally read and the displaments computed. I found one header file "septernion.H". Doe this have the necessary references for reading ".dat" data file and deriving the translations?

The file is read in the following method: http://foam.sourceforge.net/docs/cpp...ce.html#l00122
The calculations are made in the transformation method: http://foam.sourceforge.net/docs/cpp...ce.html#l00075
Notice the file name where these methods are.

As for the "septernion", this is returned by the transformation method, which is then used to do «perform translations and rotations in 3D space.» (seen here: http://foam.sourceforge.net/docs/cpp/a01773.html) I haven't looked who calls this method exactly, but my guess is that it is the dynamic mesh methods/classes that handle this, in the respective library.

This is why I said if you keep the third dimension related values always at zero, the motions will only be in 2D. Don't forget that OpenFOAM doesn't do finite volume in 2D, it always does it in 3D but can ignore the third dimension if so defined, just as shown in the first tutorial on the User Guide: http://www.openfoam.com/docs/user/cavity.php#x5-40002.1

Best regards,
Bruno

musahossein November 17, 2011 22:09

difference between ras and turbulent properties
 
I am trying to understand how the files and directories are set up in the sloshingTank2D in interDyMFoam. In the constant folder, there is file called RASProperties. In RASProperties, the RASModel is set as laminar, and turbulence is set to off. In the same folder, in the turbulenceProperties file, simulationType is set to laminar. My question is, if the turbulence is set to off in RASModel, is turbulenceProperties called at all during the analysis?

I would greatly appreciate it if someone can answer this. Many thanks to bruno for his many responses.

musahossein November 17, 2011 22:21

fvschemes
 
Here is another question. In sloshingTank2D (under multiphase, interDyMFOAM), there is a file called fvSchemes. In that file various schemes are listed. Are all these schemes used during analysis? if yes, how does the solver know which to apply when? Or are these to be selected by the user? I am not sure I understand the function of this file. Can anyone explain? Thanks

musahossein November 17, 2011 22:35

phase and alpha
 
The properties for phase1 and phase2 are set up intransportProperties file (constant folder for sloshingTank2D, interDyMFOAM). There are also parameters aplha1 and aplha2, denoting two phases in file setFieldsDict (system folder). Does phase1 and phase2 define the same phase as alpha1 and alpha2 ? If yes, how are the properties for phase1 and 2 transferred to alpha1 and 2 during the program run?

Advance thanks to whoever replies.


All times are GMT -4. The time now is 05:35.