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

How to change meshpoint coordiantes

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 27, 2007, 02:02
Default Hello everyone, in my solve
  #1
New Member
 
Thomas Gallinger
Join Date: Mar 2009
Posts: 28
Rep Power: 17
thomas is on a distinguished road
Hello everyone,

in my solver I need to change the coordinates of a meshpoint during running.
So I want to write something like:

point pos;
pos.x()=...
pos.y()=...
pos.z()=...

mesh.points()[indexmesh] = pos;

This gives me an compilation error, because mesh.point() is protected.

Does someone know, how to assign and change the point coordiantes?


Many Thanks
Thomas
thomas is offline   Reply With Quote

Old   July 27, 2007, 02:25
Default Hi Thomas, Have you test to
  #2
New Member
 
Martin Karlsson
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 13
Rep Power: 17
martin is on a distinguished road
Hi Thomas,

Have you test to wrap the points from the data base?
This might work (I haven't test it):
pointField& points=const_cast<pointfield&>(mesh.objectRegistry ::lookupObject<pointfield>("po int")); //Message board might destroy this line. It should be pointField and not pointfield, point and not po int

point pos;
pos.x()=...
pos.y()=...
pos.z()=...
points[indexmesh] = pos;

Regards,
Martin
martin is offline   Reply With Quote

Old   July 27, 2007, 03:02
Default Hi Martin, thanks for your
  #3
New Member
 
Thomas Gallinger
Join Date: Mar 2009
Posts: 28
Rep Power: 17
thomas is on a distinguished road
Hi Martin,

thanks for your reply!

I just tested and compiling works, but while running Foam crashes with the following error:

--> FOAM FATAL ERROR :
request for Field point from objectRegistry region0 failed
available objects of type Field are

0
(
)

From function
objectRegistry::lookupObject<type>(const word&) const

So, as I understand, the field "point" does not exist.

Any suggestion?
thomas is offline   Reply With Quote

Old   July 27, 2007, 03:20
Default Sorry for the last prosting.
  #4
New Member
 
Thomas Gallinger
Join Date: Mar 2009
Posts: 28
Rep Power: 17
thomas is on a distinguished road
Sorry for the last prosting.

Just asking for "points" in the const_cast call solved the problem and now I can access the point coordinates.

Again, thanks very much!
thomas is offline   Reply With Quote

Old   August 14, 2008, 08:30
Default Hi, I have trouble with a s
  #5
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19
braennstroem is on a distinguished road
Hi,

I have trouble with a similar approach during runtime:

pointField newPointAdded = zeroPoints + newPoints;
mesh.polyMesh::movePoints(newPointsmorphed);
mesh.write();

The new mesh works, but for the calculation the mesh needs some kind of an update otherwise it crashes. Does anyone know, how to tell openfoam, that there exist a new mesh? Would be nice, if anyone has a hint!?
Fabian
braennstroem is offline   Reply With Quote

Old   August 14, 2008, 09:37
Default It seems that I can reread the
  #6
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19
braennstroem is on a distinguished road
It seems that I can reread the fields with the general 'createFields.H' (e.g. the one of simpleFoam) after defining the new points, but if this is done every iteration it could be time consuming. There is probably a more elegant way.

Fabian
braennstroem is offline   Reply With Quote

Old   February 17, 2011, 04:25
Default
  #7
New Member
 
Join Date: Jan 2011
Posts: 6
Rep Power: 15
aPostrophic is on a distinguished road
I had the same problem.

Just use createDynamicMesh
.H instead of createMesh.H

and mesh.fvMesh::movePoints(newPointsmorphed); instead of mesh.polyMesh::movePoints(newPointsmorphed) and it works.

Last edited by aPostrophic; February 17, 2011 at 16:49.
aPostrophic is offline   Reply With Quote

Old   February 18, 2011, 17:40
Default
  #8
New Member
 
Join Date: Jan 2011
Posts: 6
Rep Power: 15
aPostrophic is on a distinguished road
Does anybody know how i can set the velocity in ( pointMotionU) for a special point on a patch?
aPostrophic is offline   Reply With Quote

Reply


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
UDF Cmu change selçuk ataş FLUENT 2 July 19, 2017 12:24
How to change Prt Gu Hanyang CFX 0 September 28, 2008 14:28
Looking for a change. Sunil Main CFD Forum 0 May 9, 2006 09:50
change the Junyan FLUENT 0 July 2, 2002 02:46
Air Change Diogo Bolster CFX 3 January 10, 2002 14:58


All times are GMT -4. The time now is 14:55.