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

Manipulation of every single mesh node inside the domain (OpenFoam)

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 1, 2012, 22:51
Default Manipulation of every single mesh node inside the domain (OpenFoam)
  #1
New Member
 
Join Date: Jan 2011
Posts: 5
Rep Power: 15
davide is on a distinguished road
Hello everyone,

I am new to OpenFoam and I would like to simulate an unsteady model that requires moving boundary/mesh motion analysis.

However, the motion of the mesh nodes are already prescribed (known) as a function of time. so I do not need to use any dynamic mesh solver to calculate the position of each node.

Is it possible in OpenFoam to manipulate the position of each mesh node inside the domain as a function of time?

I appreciate if someone would help me with this issue.

Thanks
D
davide is offline   Reply With Quote

Old   November 5, 2012, 17:34
Default
  #2
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 17
kmooney is on a distinguished road
Hi D,

You can do something like this to manipulate the mesh point locations as you like. You will need to incorporate this CV motion into your solver though relative/abs flux treatments.

Uniform mesh point manipulation can be quite easy:

Code:
        vectorField delCentroid(mesh.points().size(), deltaC);

        vectorField newPoints = mesh.points() + delCentroid;

        mesh.movePoints(newPoints);
Here I'm moving the mesh every timestep by a vector deltaC. You could loop through the motion vectors in 'newPoints' and move them independently if you wanted.

I hope that helps you out a bit.

Cheers!
Kyle
kmooney is offline   Reply With Quote

Old   November 27, 2012, 14:28
Default
  #3
New Member
 
Join Date: Jan 2011
Posts: 5
Rep Power: 15
davide is on a distinguished road
Hey Kyle,

Thanks for the reply.

I will give it a shot and let you know the results.

Thanks
D
davide is offline   Reply With Quote

Old   November 28, 2012, 18:18
Default
  #4
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
hello
I have the same problem.where in solver i should add this code?
Thank you.
immortality is offline   Reply With Quote

Old   December 20, 2015, 07:58
Default
  #5
Member
 
Avdeev Evgeniy
Join Date: Jan 2011
Location: Togliatty, Russia
Posts: 69
Blog Entries: 1
Rep Power: 21
j-avdeev will become famous soon enough
Send a message via Skype™ to j-avdeev
Hello.
If someone still interested.

Code:
	vector deltaC; 
	deltaC.x() = 0.01;
	deltaC.y() = 0.01;
	deltaC.z() = 0.01;
	
	vectorField delCentroid(mesh.points().size(), deltaC);
	forAll(mesh.points(),i)
	{
            Info << "mesh.points() " << mesh.points()[i] << nl << endl;
	}

        vectorField newPoints = mesh.points() + delCentroid;
        mesh.movePoints(newPoints);

        runTime.write();
This example moves whole mesh on (0.01; 0.01; 0.01) every timestep. It is probably useless, but it showes how mesh.movePoints() works.
j-avdeev is offline   Reply With Quote

Old   May 12, 2017, 18:19
Default
  #6
New Member
 
Clark Yan
Join Date: Jun 2015
Location: Ottawa, Canada
Posts: 5
Rep Power: 10
Clarkyan is on a distinguished road
Quote:
Originally Posted by j-avdeev View Post
Hello.
If someone still interested.

Code:
	vector deltaC; 
	deltaC.x() = 0.01;
	deltaC.y() = 0.01;
	deltaC.z() = 0.01;
	
	vectorField delCentroid(mesh.points().size(), deltaC);
	forAll(mesh.points(),i)
	{
            Info << "mesh.points() " << mesh.points()[i] << nl << endl;
	}

        vectorField newPoints = mesh.points() + delCentroid;
        mesh.movePoints(newPoints);

        runTime.write();
This example moves whole mesh on (0.01; 0.01; 0.01) every timestep. It is probably useless, but it showes how mesh.movePoints() works.
Hi Avdeev,

Thank you for your code. I was wondering if you can indicate where we can add this type of code to? The source code of a solver like "displacementLaplacian" or a motion type like "oscillatingDisplacement"?

Thanks,
Clark
Clarkyan is offline   Reply With Quote

Old   January 24, 2019, 17:39
Default
  #7
New Member
 
Khalid Abdelaziz
Join Date: Jan 2019
Posts: 1
Rep Power: 0
khalid302 is on a distinguished road
Quote:
Originally Posted by kmooney View Post
Hi D,

You can do something like this to manipulate the mesh point locations as you like. You will need to incorporate this CV motion into your solver though relative/abs flux treatments.

Uniform mesh point manipulation can be quite easy:

Code:
        vectorField delCentroid(mesh.points().size(), deltaC);

        vectorField newPoints = mesh.points() + delCentroid;

        mesh.movePoints(newPoints);
Here I'm moving the mesh every timestep by a vector deltaC. You could loop through the motion vectors in 'newPoints' and move them independently if you wanted.

I hope that helps you out a bit.

Cheers!
Kyle
Hello Kyle,


I tried the code that you posted and got the following error:


--> FOAM FATAL ERROR:
V0 is not available

From function fvMesh::V0() const
in file fvMesh/fvMeshGeometry.C at line 382.

Any help would be appreciated.

Thanks,
Khalid
khalid302 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
[snappyHexMesh] SnappHexMesh Mesh creating a Mesh inside a Cylinder? abu OpenFOAM Meshing & Mesh Conversion 1 April 4, 2017 10:57
Domain Imbalance HMR CFX 5 October 10, 2016 06:57
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 10:38
[Commercial meshers] mesh from ANSA to OpenFOAM bephi OpenFOAM Meshing & Mesh Conversion 18 April 8, 2013 08:14
query about domain and mesh motion of tube carrying fluid hasan56 CFX 3 October 26, 2011 17:53


All times are GMT -4. The time now is 06:28.