|
[Sponsors] |
Unable to apply fvConstraints in custom solver |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 18, 2023, 05:49 |
Unable to apply fvConstraints in custom solver
|
#1 |
New Member
Join Date: Aug 2023
Posts: 2
Rep Power: 0 |
Hello everyone, I'm new here and have little experience with OpenFOAM so please bear with me.
I am working on a custom solver, which is conceptually very similar to potentialFoam. I have to apply some constraints to the solver, which I'm trying to do through the fvConstraints dictionary specifications. The custom solver compiles correctly, however upon execution an error will be raised when calling "createFvConstraints.H", which looks like: Code:
Creating fvConstraints from "system/fvConstraints" Selecting finite volume constraint type limitVelocity #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigSegv::sigHandler(int) at ??:? #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" #3 Foam::fvConstraint::New(Foam::word const&, Foam::dictionary const&, Foam::fvMesh const&) at ??:? #4 Foam::fvConstraints::fvConstraints(Foam::fvMesh const&) at ??:? #5 ? in "/home/admin/OpenFOAM/admin-10/platforms/linux64GccDPInt32Opt/bin/fcrFoam" #6 ? in "/home/admin/OpenFOAM/admin-10/platforms/linux64GccDPInt32Opt/bin/fcrFoam" #7 ? in "/lib/x86_64-linux-gnu/libc.so.6" #8 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #9 ? in "/home/admin/OpenFOAM/admin-10/platforms/linux64GccDPInt32Opt/bin/fcrFoam" Segmentation fault (core dumped) Here is a more detailed example of what I've tried: Let's say I make a custom solver using potentialFoam as prototype: "myPotentialFoam". I will only modify it to include the fvConstraints specifications. So what I do is: In myPotentialFoam.C, include fvConstraints.H at the beginning: Code:
#include "fvCFD.H" #include "nonOrthogonalSolutionControl.H" #include "fvConstraints.H" Code:
#include "createMRF.H" #include "createFvConstraints.H" Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 10 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { format ascii; class dictionary; location "system"; object fvConstraints; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // limitU { type limitVelocity; active yes; selectionMode all; max 75.0; } // ************************************************************************* // Code:
./Allclean blockMesh myPotentialFoam Any tip would be appreciated, thank you in advance for your help! |
|
August 21, 2023, 03:26 |
|
#2 |
New Member
Join Date: Aug 2023
Posts: 2
Rep Power: 0 |
In the end, I figured it out by myself.
For anyone interested, the solution was to add an entry in Make/options so that the fvConstraints library is linked. Effectively, modifying Make/options from: Code:
EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -lfiniteVolume \ -lmeshTools Code:
EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -lfiniteVolume \ -lmeshTools \ -lfvModels \ -lfvConstraints |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CPUs vs GPUs for CFD? | hami11 | Hardware | 22 | July 23, 2024 16:59 |
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch | gschaider | OpenFOAM Installation | 225 | August 25, 2015 20:43 |
how to apply an sudden displacement or Force of a cylinder with solid solver? | allenfieldin | OpenFOAM Running, Solving & CFD | 11 | February 15, 2015 21:37 |
flow solver won't recognize custom library | hakonbar | OpenFOAM Programming & Development | 2 | April 7, 2014 09:09 |
[Commercial meshers] ST_Malloc: out of memory.malloc_storage: unable to malloc Velocity SA, | cfdproject | OpenFOAM Meshing & Mesh Conversion | 0 | April 14, 2009 16:45 |