|
[Sponsors] |
May 13, 2010, 15:21 |
How to change mesh size at runtime
|
#1 |
Senior Member
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 19 |
In my model I want to be able to specify the length scales of my mesh at run time so that I don't always have to change the blockMesh file and run "blockMesh -case xyz" just to change my mesh size.
So what I want to do is use blockmesh to make my mesh with unit length and then at runtime just multiply the grid spacing by my actual length. Is this possible to do? I'm thinking that all I would have to do is find a way to multiply the mesh.deltaCoeffs() by my desired lengths. How can I do this? |
|
May 14, 2010, 05:27 |
|
#2 |
Senior Member
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21 |
pointField newPoints = mesh.points();
//modify newPoints mesh.movePoints(newPoints); |
|
May 14, 2010, 13:17 |
|
#3 |
Senior Member
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 19 |
Thanks eugene, this worked in changing my mesh, but when I use it I'm now getting an error at runtime that says:
Code:
V0 is not available From function fvMesh::V0() const in file fvMesh/fvMeshGeometry.C at line 338. Code:
const volScalarField::DimensionedInternalField& fvMesh::V0() const { if (!V0Ptr_) { FatalErrorIn("fvMesh::V0() const") << "V0 is not available" << abort(FatalError); } return *V0Ptr_; } PS. To change my mesh all I did was: Code:
pointField newPoints = mesh.points(); forAll(newPoints,i) { newPoints[i].component(0) = newPoints[i].component(0)*Length0; newPoints[i].component(1) = newPoints[i].component(1)*Length1; newPoints[i].component(2) = newPoints[i].component(2)*Length2; } mesh.movePoints(newPoints); |
|
May 16, 2010, 20:31 |
|
#4 |
Senior Member
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21 |
It appears the fvMesh now either requires that you set up a field V0 or a field meshPhi (in which case V0 is calculated automatically).
A bit irretating really. The only reasonable way to make this work without extra coding is to specify a flux field meshPhi in your starting time directory. Just use phi as a template and set everything to 0. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
[ICEM] Generating Mesh for STL Car in Windtunnel Simulation | tommymoose | ANSYS Meshing & Geometry | 48 | April 15, 2013 05:24 |
Mesh size | Mohsin | FLUENT | 7 | May 3, 2010 05:03 |
Changing mesh size for independency test | az_f | ANSYS Meshing & Geometry | 1 | August 27, 2009 14:55 |
Faces during change of topology in the mesh | virginie_e | OpenFOAM Running, Solving & CFD | 3 | August 15, 2009 14:32 |