CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

overInterDymFoam - How to define dynamicMeshDict for an attenuator type device

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 6, 2023, 10:13
Red face overInterDymFoam - How to define dynamicMeshDict for an attenuator type device
  #1
New Member
 
Nian
Join Date: Jun 2019
Posts: 15
Rep Power: 7
noodleluvmay is on a distinguished road
Hello everyone,

I've been trying to build a case for simulating wave interaction with an attenuator-type wave energy converter device, and I want to set the case up as shown in Figure 1. where the 2 box bodies are allowed to freely rotate around the hinge in the middle as waves pass through, and the hinge is free to move vertically (in the future potentially considering to add mooring to the geometry and allow the hinge to move freely).

I have currently set the dynamicMeshDict as follows, where I have applied joints to move freely in Y and Z, and rotate about Y axis (I think). I've also set with the transform keyword for the centre of rotation to be at the origin initially (0 0 0).

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1806                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      dynamicMeshDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

motionSolverLibs    ("librigidBodyMeshMotion.so");

dynamicFvMesh       dynamicOversetFvMesh;

dynamicOversetFvMeshCoeffs
{
}

motionSolver        rigidBodyMotion;

// rigidBodyMotionCoeffs  - not needed any more
//  {
report          on;

solver
{
	type Newmark;
//     gamma   0.1;    // Velocity integration coefficient
 //   beta    0.1;    // Position integration coefficient
}

accelerationRelaxation 0.7;

//- prescribedRotation requires some sub-iterations to converge faster
//  to desired value.
// nIter   3;

bodies
{
	box1
	{

		type            rigidBody;
		parent          root;
		patches       	(box1);
		
		innerDistance   100;
		outerDistance   101;

		centreOfMass    (-20 0 0);
		  // Cuboid dimensions
		Lx              40;
		Ly              4;
		Lz              4;

		// Density of the solid
		rhoSolid        500;

		// Cuboid mass
		mass            #calc "$rhoSolid*$Lx*$Ly*$Lz";

		inertia         (1 0 0 1 0 1);
		transform       (1 0 0 0 1 0 0 0 1) (0 0 0);

		joint
		{
			type            composite;
			joints
			(
				{
					type Px;
				}
				{
					type Pz;
				}
				{
					type Ry;
				}
			);
		}
		
		constraints
		{
			fixedAxis
			{
				sixDoFRigidBodyMotionConstraint plane;
				normal (0 1 0); // constrained in y plane?
			}
		}
	
		restraints
		{
			 AngularDamper
			 {
				 sixDoFRigidBodyMotionRestraint      sphericalAngularDamper;
				 coeff                               5000;                //angular damping coefficient in Nms/rad
			 } 
		}

	} //end box1
	
    box2
	{
		type            rigidBody;
	    parent          root;
		patches         (box2);
		
		innerDistance   100;    // With overset we want to avoid the mesh
		outerDistance   101;	// deformation so have large innerDistance

		// Cuboid mass -- very simple setup. For more complicated shapes
		// see utility surfaceInertia
		 // Cuboid dimensions
		Lx              40;
		Ly              4;
		Lz              4;

		// Density of the solid
		rhoSolid        500;

		// Cuboid mass
		mass            #calc "$rhoSolid*$Lx*$Ly*$Lz";

		inertia         (1 0 0 1 0 1);
		centreOfMass    (20 0 0); // relative to the centreOfMass
										// of parent body
										// (here root = global coord system)

		// Transformation tensor and centre of rotation
		transform       (1 0 0 0 1 0 0 0 1) (0 0 0);

		joint
		{
			type            composite;
			joints
			(
				{
					type Px;
				}
				{
					type Pz;
				}
				{
					type Ry;
				}
			);
		}
		
		constraints
		{
			fixedAxis
			{
				sixDoFRigidBodyMotionConstraint plane;
				normal (0 1 0); // constrained in y plane?
			}
		}
	
		restraints
		{
			 AngularDamper
			 {
				 sixDoFRigidBodyMotionRestraint      sphericalAngularDamper;
				 coeff                               5000;                //angular damping coefficient in Nms/rad
			 } 
		}
	} // end body_Aft
}
  
  

//  } // end of rigidBodyMotionCoeffs


// ************************************************************************* //
However, I am not sure if this is the correct way/syntax for setting something like this up, and I am not sure if the 'joint', 'transform', 'constraints' and 'restraints' definitions were set up properly regarding the 2 bodies and the joint.

In an initial trial run, the results at around 4s show the Centre of Rotation shifting to -85 m in Z which seems unphysical (or maybe I've interpreted it wrongly?):

Code:
Rigid-body motion of the fwd
    Centre of rotation: (0 0 -85.1395255871)
    Orientation: (1 0 0 0 1 0 0 0 1)
    Linear velocity: (0 0 -40.8709835732)
    Angular velocity: (0 0 0)
Rigid-body motion of the aft
    Centre of rotation: (0 0 -85.1395255871)
    Orientation: (1 0 0 0 1 0 0 0 1)
    Linear velocity: (0 0 -40.8709835732)
    Angular velocity: (0 0 0)
inverseDistance : detected 2 mesh regions
    zone:0 nCells:9576000  voxels:(85 85 85) bb:(-90.0000603573 -12.0000603573 -20.0000603573) (-34.0180396427 0.147119357345 -0.987181642655)
    zone:1 nCells:5615950  voxels:(85 85 85) bb:(-40.0000076955 -4.00000769553 -4.00000769553) (-34.0998923045 7.85500095484e-06 -1.09999230447)
Overset analysis : nCells : 15191950
    calculated   : 14708262
    interpolated : 250840 (interpolated from local:236708  mixed local/remote:14126  remote:6)
    hole         : 232848
I'm very new to setting up body dynamics in OpenFOAM, so I would appreciate any thoughts and input.

Thanks, everyone!
Attached Images
File Type: png overInterDymFoam1.png (10.2 KB, 15 views)
noodleluvmay is offline   Reply With Quote

Reply

Tags
dynamicoverset, hinge motion, overinterdymfoam, overset, rigid body motion


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
Hydrogen storage by metal hydride longbk FLUENT 12 August 1, 2023 21:13
UDF for tracking interface in 2 phase VOF method. Cooper24 Fluent UDF and Scheme Programming 16 October 26, 2021 06:42
An odd ERROR mdakbari Fluent UDF and Scheme Programming 7 April 4, 2016 05:30
udf-Surface Reaction Rate-parse error in line 34 priya_1985 FLUENT 1 November 10, 2014 03:48
flow simulation across a small fan jane luo Main CFD Forum 15 April 12, 2004 18:49


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