CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   New boundary condition in solver (https://www.cfd-online.com/Forums/openfoam/123002-new-boundary-condition-solver.html)

Ricardo September 2, 2013 12:15

New boundary condition in solver
 
Hello, I have new boundary condition "convectiveValue" based on fixedValue condition.

I would like use this code in my solver
Code:

if(T.boundaryField()[patchID1].type() == convectiveValueFvPatchScalarField::typeName)
    {convectiveValueFvPatchScalarField& tValue = refCast<convectiveValueFvPatchScalarField>(T.boundaryField()[patchID1]);
....

I get error message

Code:

mylaplacianFoam.C:(.text.startup+0x1f95): undefined reference to `Foam::convectiveValueFvPatchField<double>::typeName'
collect2: ld returned 1 exit status

I have #include "convectiveValueFvPatchFields.H" in solver file and link to header in Make/options

any Idea what is wrong?:(
Thanks
Richard

nimasam September 3, 2013 00:17

besides library path you should name library binary file which you want to add in the section
Quote:

EXE_LIBS

Ricardo September 3, 2013 03:08

I added it, but nothing changed.. :(

Code:

EXE_INC = -I$(LIB_SRC)/finiteVolume/lnInclude\
        -I$(FOAM_RUN)/Newton/
   
EXE_LIBS = -lfiniteVolume \
            -L$(FOAM_USER_LIBBIN)/libconvectiveValue.so


jherb September 3, 2013 09:04

Try:
Code:

   
EXE_LIBS = -lfiniteVolume \
            -L$(FOAM_USER_LIBBIN) \
            -lconvectiveValue

(under the assumption that your library is called libconvectiveValue.so and resides in $FOAM_USER_LIBBIN)

Ricardo September 3, 2013 13:20

It works, thank You very much! :D

Ricardo September 4, 2013 06:27

Hello, I have a little question about using interpolationTable. I would like using data measured data ("$FOAM_CASE/constant/sample.dat") for calculating of BC. I tried various combination of constructors, but without succes.

Code:

interpolationTable<List<Tuple2<scalar,scalar> > >
Would you be so kind and give me a sample of code for interpolating scalar value from file?

Thanks
Richard :o


Solved: bad generic types...


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