Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renumberMesh crashes when lengthScale is cubeRootVol #11

Open
timofeymukha opened this issue Oct 27, 2023 · 0 comments
Open

renumberMesh crashes when lengthScale is cubeRootVol #11

timofeymukha opened this issue Oct 27, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@timofeymukha
Copy link
Owner

timofeymukha commented Oct 27, 2023

When lengthScale is set to cubeRootVol (whichis the default), the utility renumberMesh will crash with

--> FOAM FATAL ERROR: (openfoam-2306)
unallocated autoPtr of type N4Foam5FieldIdEE

    From T& Foam::autoPtr<T>::operator*() [with T = Foam::Field<double>]
    in file /home/timofey/code/openfoam/OpenFOAM-v2306/src/OpenFOAM/lnInclude/autoPtrI.H at line 95.

Very strange bug, the crash seems to happen due to the function

void Foam::SingleCellSampler::createLengthListCubeRootVol()
{
    // Cell volumes
    const scalarField & V = mesh_.V();
    
    forAll(lengthList_, i)
    {
        lengthList_[i] = pow(V[indexList_[i]], 1.0/3.0);
    }
}

particularly due to the mesh_.V();. If one removes any mention of mesh_V() things work... I have no idea what is happening.

Setting lengthScale to WallNormalDistance works fine, even though that also uses the mesh class, even more extensively in fact.

@timofeymukha timofeymukha changed the title renumberMesh crashes with lengthScale is cubeRootVol renumberMesh crashes when lengthScale is cubeRootVol Oct 27, 2023
@timofeymukha timofeymukha added the bug Something isn't working label Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant