CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   not solve all components of a vector (velocity) (https://www.cfd-online.com/Forums/openfoam-programming-development/117309-not-solve-all-components-vector-velocity.html)

Henning86 May 6, 2013 12:01

not solve all components of a vector (velocity)
 
hi,


im currently running an axisymmetric case (1 cell thick). But all Direction of the velocity are solved, which results in the problem that i need longer calculation times and the Uz compoent are calculated wrong.

the wrong solution of the Uz direction should affect the solver accuarcy.

They could simply be set to zero(i know how to do this). it would be way more elegant to simply not solve in the z-direction so valueable calculation time could be saved.

My only approach for now is (that a haven't test yet) to manipolate the fvmesh.SolutionD and fvmesh.geometricD. Both of those function are const so i could manipolate them with a pointer over another variable.

The problem here is i don't know where these functions are used as well.

Does anyboy know if there is a more elegant approach?



Best regards

Henning

mturcios777 May 6, 2013 14:09

OpenFOAM already has in built ways to deal with 2D problems. Did you set your boundaries on the front and back to "empty" and your axis to "axis"?

Henning86 May 6, 2013 17:22

thanks for the response

the frontSide and backSide are declared as wedge and the axis is declared as empty. But the axis has no faces. But if i dont delete the faces (collapseEdge) and set the boundary condition of the axis to empty. OpenFoam calculates Ux and Uz but not Ux and Uy.

is there a boundary conditions called axis?

mturcios777 May 6, 2013 19:55

Sorry, I was inaccurate. The boundary condition you should use is "symmetryPlane" (see the movingCone tutorial in for pimpleDyMFoam). Also, how are your coordinate planes oriented?

Henning86 May 7, 2013 03:56

sadly that doesn't solve the problem.its 3D after all and there are really slow velocity in the Uz direction after some times steps.

In my probelm theses begin to add up after 500000 iteration the can't be neglected anymore. Definition of a 2D mesh is made in the class polymesh. It can only be 2D if the BC empty and wedge are used. i think


Is there some solver option in the fvsolution dict to block one direction?

Henning86 May 7, 2013 08:12

it works:


you can say the solver to not solve on set of equation by typing this

Code:


 
 Vector<label>& geoP = const_cast<Vector<label>&>(mesh.geometricD());
  geoP.x()=1;
  geoP.y()=1;
  geoP.z()=-1;
 
    Vector<label>& solP = const_cast<Vector<label>&>(mesh.solutionD());
  solP.x()=1;
  solP.y()=1;
  solP.z()=-1;

The solution is a work around to save time. but is in the end not very accurate. The proper way should be to create a new BC and modify the polymesh so it recognizes 2D axisymmetric cases.

PS hope that solution doesn't cause some major troubles.

2538sukham August 23, 2021 02:06

It's an old thread however I am stumbling along the same line of problem. Where do we put these codes. In the solver PISO/PIMPLE loop? I would like my solver to solve only in x direction. I found some threads regarding this but I couldn't get a workaround.


All times are GMT -4. The time now is 17:01.