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

Problem in fvMesh.C when using topological changes. OpenFoam 2-2-x

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 14, 2013, 12:57
Default Problem in fvMesh.C when using topological changes. OpenFoam 2-2-x
  #1
New Member
 
Join Date: May 2013
Location: Santa Fé, Argentina
Posts: 5
Rep Power: 13
Horacio Aguerre is on a distinguished road
Hi All,

I have the following problem when I run cases with topological changes on the mesh (I have implemented a layering strategy which uses the layerAdditionRemoval class).

OpenFoam Version: 2.2.0

File: fvMesh.C

Method: mapFields(const mapPolyMesh& meshMap)


When mapping the old cells volume ,(just mapping to new cell labels), (fvMesh.C:562)

Code:
if (V0Ptr_)
    {
        scalarField& V0 = *V0Ptr_;

        scalarField savedV0(V0);
        V0.setSize(nCells());

        forAll(V0, i)
        {
            if (cellMap[i] > -1)
            {
                V0[i] = savedV0[cellMap[i]];
            }
            else
            {
                V0[i] = 0.0;
            }
        }
    }
Here it is waited that V0PTr_ to be the old time level pointer to cells volume. However V0Ptr_ is mapped previously by, (fvMesh.C:550)

Code:
MapDimensionedFields<scalar, fvMeshMapper, volMesh>(mapper);
and then the V0PTr_, which is assigned to savedV0, looses its relation with cellMap and the mapping

Code:
V0[i] = savedV0[cellMap[i]];
results uncorrect. (When cells are removed due to topological changes on the mesh, the program crashes due to try to access to a wrong memory position because now cellMap[i] is bigger than list savedV0 size).

I have seen that in the previous OpenFOAM version 2.0-x, the MapDimensionedFields was not use in fvMesh.C. But, after OpenFoam version 2.1-x the MapDimensionedFields were added.

The cases run without problems when i comment either the line (fvMesh.C:550) or the group after (fvMesh.C:562).

Is the "mapping", that is done from (fvMesh.C:562), no more necessary when the MapDimensionedFields is used before?

Thanks, Horacio.
Horacio Aguerre 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
To solve combustion problem in openFoam yash.aesi OpenFOAM 0 July 10, 2013 08:35
compiler problem with OpenFOAM installation belkadi OpenFOAM Installation 4 May 22, 2013 11:26
[OpenFOAM] Color display problem to view OpenFOAM results. Sargam05 ParaView 16 May 11, 2013 01:10
Problem with mpirun with OpenFOAM jiejie OpenFOAM 3 July 7, 2010 20:30
OpenFOAM 1.6 CreatePatch Problem TarifaPirata OpenFOAM Bugs 1 September 10, 2009 05:35


All times are GMT -4. The time now is 15:43.