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

Problem with operator fvm::laplacian

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Voulet

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   April 27, 2022, 14:33
Default Problem with operator fvm::laplacian
  #1
Member
 
Pablo Alarcón
Join Date: Mar 2018
Location: Liège
Posts: 59
Rep Power: 8
palarcon is on a distinguished road
Dear all

I'm trying to perform a proof of concept by solving a Poisson equation.
This part is purely ''mathematical'' but because if the computation works I will add it to another OF solver.
The mathematical part inside the code is as follows:

Code:
scalar vVoid 		= 0.1;
vector cosSin(0.7071068,0.7071068,0);
Cxy = vVoid + (1-vVoid)*rho;	// volScalarField
Coh = Cxy * cosSin;				// volVectorField

fvScalarMatrix TarrivalEqn
(
	fvm::laplacian(Coh,Tarrival)
);
TarrivalEqn.solve();
Unfortunately, when I try to compile it I get the following error

Code:
Compiling enabled on 8 cores
Making dependency list for source file overhangFoam.C
g++ -std=c++14 -m64 -pthread -DOPENFOAM=2012 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -Wno-unknown-pragmas  -O3  -DNoRepository -ftemplate-depth-100 -I/usr/lib/openfoam/openfoam2012/src/finiteVolume/lnInclude -I/usr/lib/openfoam/openfoam2012/src/meshTools/lnInclude -iquote. -IlnInclude -I/usr/lib/openfoam/openfoam2012/src/OpenFOAM/lnInclude -I/usr/lib/openfoam/openfoam2012/src/OSspecific/POSIX/lnInclude   -fPIC -c overhangFoam.C -o Make/linux64GccDPInt32Opt/overhangFoam.o
g++ -std=c++14 -m64 -pthread -DOPENFOAM=2012 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -Wno-unknown-pragmas  -O3  -DNoRepository -ftemplate-depth-100 -I/usr/lib/openfoam/openfoam2012/src/finiteVolume/lnInclude -I/usr/lib/openfoam/openfoam2012/src/meshTools/lnInclude -iquote. -IlnInclude -I/usr/lib/openfoam/openfoam2012/src/OpenFOAM/lnInclude -I/usr/lib/openfoam/openfoam2012/src/OSspecific/POSIX/lnInclude   -fPIC -Xlinker --add-needed -Xlinker --no-as-needed  Make/linux64GccDPInt32Opt/overhangFoam.o -L/usr/lib/openfoam/openfoam2012/platforms/linux64GccDPInt32Opt/lib \
    -lfiniteVolume -lfvOptions -lmeshTools -lOpenFOAM -ldl  \
     -lm -o /home/pablo/OpenFOAM/pablo-v2012/platforms/linux64GccDPInt32Opt/bin/overhangFoam
/usr/bin/ld: Make/linux64GccDPInt32Opt/overhangFoam.o: in function `Foam::fv::laplacianScheme<double, Foam::Vector<double> >::New(Foam::fvMesh const&, Foam::Istream&)':
overhangFoam.C:(.text._ZN4Foam2fv15laplacianSchemeIdNS_6VectorIdEEE3NewERKNS_6fvMeshERNS_7IstreamE[_ZN4Foam2fv15laplacianSchemeIdNS_6VectorIdEEE3NewERKNS_6fvMeshERNS_7IstreamE]+0x4b): undefined reference to `Foam::fv::laplacianScheme<double, Foam::Vector<double> >::IstreamConstructorTablePtr_'
/usr/bin/ld: overhangFoam.C:(.text._ZN4Foam2fv15laplacianSchemeIdNS_6VectorIdEEE3NewERKNS_6fvMeshERNS_7IstreamE[_ZN4Foam2fv15laplacianSchemeIdNS_6VectorIdEEE3NewERKNS_6fvMeshERNS_7IstreamE]+0x209): undefined reference to `Foam::fv::laplacianScheme<double, Foam::Vector<double> >::IstreamConstructorTablePtr_'
collect2: error: ld returned 1 exit status
make: *** [/usr/lib/openfoam/openfoam2012/wmake/makefiles/general:150: /home/pablo/OpenFOAM/pablo-v2012/platforms/linux64GccDPInt32Opt/bin/overhangFoam] Error 1
Fields ''rho'', ''Cxy'' qnd ''Tarrival'' are defined as volScalarField with dimensions (Nelem x 1) and field Coh is a volVectorField with dimensions (Nelem x 3).

I know for certain that the problem arises when computing fvm::laplacian, because the types of the fields is not compatible with the operator.

I found a really old discussion that deals with the same problem, but unfortunately I don't understand how can I solve it in my case (original question convert dimensioned<double>’ to ‘double’, answer
convert dimensioned<double>’ to ‘double’)

The mathematical problem I'm trying to solve is in the attached file:

Does anyone knows how to solve it? My gut tells me I'm missing some fundamental stuff, but I can not see it.

Thanks you in advance
Attached Images
File Type: jpg eqn.jpg (39.5 KB, 11 views)
palarcon is offline   Reply With Quote

 


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
SU2-7.0.1 on ubuntu 18.04 hyunko SU2 Installation 7 March 16, 2020 04:37
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
Gambit - meshing over airfoil wrapping (?) problem JFDC FLUENT 1 July 11, 2011 05:59
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13


All times are GMT -4. The time now is 16:56.