|
[Sponsors] |
[mesh manipulation] Generating nonuniform meshes with sizefunction |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 12, 2006, 16:13 |
Generating nonuniform meshes with sizefunction
|
#1 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
Is it possible to generate non-uniform grids with nodes positioned following a distribution expressed by an analitical function?
Regards, Alberto
__________________
Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541) OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. |
|
April 12, 2006, 16:17 |
Yes. Generate a uniform mesh
|
#2 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
Yes. Generate a uniform mesh and then move the points :-)
Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
April 12, 2006, 16:19 |
Yes. Generate a uniform mesh
|
#3 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
Yes. Generate a uniform mesh and then move the points :-)
Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
April 12, 2006, 16:54 |
Do you mean with the moveMesh
|
#4 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
Do you mean with the moveMesh solver?
I gave a look, but it doesn't seem I can use a user defined function but only linear, quadratic and exponential (I need an hyperbolic tangent). Alberto
__________________
Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541) OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. |
|
April 12, 2006, 17:07 |
How about just doing a little
|
#5 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
How about just doing a little custom code like this:
pointField newPoints = mesh.points(); forAll (newPoints, i) { // Your code here, calculate the point position } mesh.movePoints(newPoints); mesh.write(); Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
April 13, 2006, 06:40 |
Thanks Hrv. It works! :-)
|
#6 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
Thanks Hrv. It works! :-)
__________________
Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541) OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. |
|
March 28, 2007, 06:43 |
Hi Alberto,
Could you possi
|
#7 |
Senior Member
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18 |
Hi Alberto,
Could you possibly give an example of how to move the internal points of a uniform mesh? (Just the few lines within the forAll(newPoints,i){} ) Thanks, Frank
__________________
Frank Bos |
|
March 29, 2007, 15:49 |
Check your mail :-)
A.
|
#8 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
Check your mail :-)
A.
__________________
Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541) OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. |
|
December 23, 2007, 12:41 |
Hi
I want to solve channel f
|
#9 |
New Member
ehsan yasari
Join Date: Mar 2009
Location: Gothenburg, Sweden
Posts: 14
Rep Power: 17 |
Hi
I want to solve channel flow with hyperbolic mesh in one direction. i am new in O-F, how can i generate hyperbolic mesh in O-F? Regards Thanks for your help |
|
December 25, 2007, 20:14 |
Hello Ehsan,
the trick is exa
|
#10 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
Hello Ehsan,
the trick is exactly the one explained by Hrvoje in this thread. Create a uniform mesh, with the number of nodes you need in the three directions. Then write a small utility which: - Reads the mesh (see how this is done in all solvers or mesh manipulation utilities). - Does pointField newPoints = mesh.points(); forAll (newPoints, i) { // Your code here, calculate the point position } mesh.movePoints(newPoints); mesh.write(); using an analytical expression to relate the position of a node in a uniform grid to the new position (this is commonly done to generate grids for channel flow simulations). Regards, Alberto
__________________
Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541) OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. |
|
December 26, 2007, 08:09 |
Hello Alberto
Thank you very
|
#11 |
New Member
ehsan yasari
Join Date: Mar 2009
Location: Gothenburg, Sweden
Posts: 14
Rep Power: 17 |
Hello Alberto
Thank you very much for your guide. Could you possibly give your code? And tell me where should I add this code? Excuse me for my basic question because I am new in O_F. Best regards |
|
December 30, 2007, 14:02 |
hello Alberto
Thank you very
|
#12 |
New Member
ehsan yasari
Join Date: Mar 2009
Location: Gothenburg, Sweden
Posts: 14
Rep Power: 17 |
hello Alberto
Thank you very much for your help,it works well. Best Regards. |
|
December 31, 2007, 14:09 |
You're welcome :-)
Happy ne
|
#13 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
You're welcome :-)
Happy new year, Alberto
__________________
Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541) OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. |
|
January 4, 2008, 11:56 |
Happw new year Alberto
I am
|
#14 |
New Member
ehsan yasari
Join Date: Mar 2009
Location: Gothenburg, Sweden
Posts: 14
Rep Power: 17 |
Happw new year Alberto
I am going to run a channel395 with channel oodles solver, when i choose mixedsmagorinskey model and laplace filter, after some iteration, courant number diverged. but when i used simple filter it works,and also when i changed the mesh into uniform mesh, it works. Do you have any idea about this problem? Best Regards. |
|
January 9, 2008, 00:55 |
Hello Alberto,
Thanks for y
|
#15 |
Member
vof_user
Join Date: Mar 2009
Posts: 67
Rep Power: 17 |
Hello Alberto,
Thanks for your hyperbolicSpacingChannel code. It works well with the given channel395 case. Thanks. |
|
July 15, 2009, 13:14 |
|
#16 |
Senior Member
John Deas
Join Date: Mar 2009
Posts: 160
Rep Power: 17 |
Hi, I would like to output the polyMesh in a new time directory. I tried to add
Code:
runTime++; mesh.write(); Code:
Requested field U does not exist in the database From function Foam::fieldAverage::initialise() in file fieldAverage/fieldAverage.C at line 108. FOAM exiting |
|
July 15, 2009, 13:25 |
|
#17 |
Senior Member
John Deas
Join Date: Mar 2009
Posts: 160
Rep Power: 17 |
To be more accurate, here is my new code
Code:
#include "argList.H" #include "Time.H" #include "polyMesh.H" #include "transformField.H" #include "fvMesh.H" using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Main program: int main(int argc, char *argv[]) { # include "setRootCase.H" # include "createTime.H" # include "createMesh.H" pointField points=mesh.points(); // Reading non-uniform grid parameters Info<< "Reading hyperbolicSpacingProperties\n" << endl; IOdictionary hyperbolicSpacingProperties ( IOobject ( "hyperbolicSpacingProperties", runTime.constant(), polyMesh::meshSubDir, runTime, IOobject::MUST_READ, IOobject::NO_WRITE, false ) ); Info<< "Reading A coefficient\n" << endl; dimensionedScalar A ( hyperbolicSpacingProperties.lookup("A") ); Info<< "A = " << A.value() << endl << endl; Info<< "Reading B coefficient\n" << endl; dimensionedScalar B ( hyperbolicSpacingProperties.lookup("B") ); Info<< "B = " << B.value() << endl << endl; // Adapting the grid points.replace(vector::Y, A.value()*points.component(vector::Y) + (1.0 - A.value())*(1.0 - Foam::tanh(B.value()*(1.0 - points.component(vector::Y)))/(Foam::tanh(B.value())))); // Setting the default precision of the points data to 10 IOstream::defaultPrecision(10); mesh.movePoints(points); runTime++; mesh.write(); //Writing points // Info << "Writing points into directory " << points.path() << nl << endl; // points.write(); return(0); } |
|
July 15, 2009, 14:35 |
|
#18 |
Senior Member
Henrik Rusche
Join Date: Mar 2009
Location: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18 |
Dear John,
this error is not at all obvious ;-) My bet is that you have a functionObject (fieldAverage to be precise) which I asking for U, but cannot find it. Comment it and all will be fine - I hope Henrik |
|
July 15, 2009, 16:23 |
|
#19 |
Senior Member
John Deas
Join Date: Mar 2009
Posts: 160
Rep Power: 17 |
I think one day I saw a piece of code which deactivated functionObjects, but I can not find it again. Do you see what I am refering to ?
-EDIT- Just found it, it seems to be the Code:
functionObjectlist::off() |
|
July 15, 2009, 16:37 |
|
#20 |
Senior Member
Henrik Rusche
Join Date: Mar 2009
Location: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18 |
Dear John,
the keyword is "active_" ... $FOAM_SRC/postProcessing/forces/lnInclude/forces.H Henrik |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Generating hex meshes | STutexas | OpenFOAM Meshing & Mesh Conversion | 1 | February 24, 2016 03:55 |
generating OpenFOAM meshes with pointwise | robo | OpenFOAM Pre-Processing | 1 | April 29, 2014 14:47 |
Doxygen documentation | Tanay | OpenFOAM Installation | 9 | September 23, 2011 12:40 |
ParaView and Qt 4.3.5 on Mac OS X 10.6 | Adrian | OpenFOAM | 3 | August 8, 2010 04:16 |
Generating big meshes with GAMBIT on NT | Andrew Ooi | FLUENT | 12 | February 2, 2000 23:26 |