|
[Sponsors] |
April 27, 2022, 15:33 |
Problem with operator fvm::laplacian
|
#1 |
Member
Pablo Alarcón
Join Date: Mar 2018
Location: Liège
Posts: 59
Rep Power: 8 |
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(); 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 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 |
|
April 28, 2022, 08:54 |
|
#2 |
Senior Member
|
Hi Pablo,
Have you take a look at solidFoam solver? https://www.openfoam.com/documentati...1d4e7b6b2.html Laplacian term in anisotropic case will be similar to what you want. https://www.openfoam.com/documentati...8H_source.html I guess you need a volSymmTensorField. https://www.openfoam.com/documentati...ce.html#l00011 Good luck! |
|
April 30, 2022, 15:38 |
|
#4 | |
Member
Pablo Alarcón
Join Date: Mar 2018
Location: Liège
Posts: 59
Rep Power: 8 |
Quote:
Because scalarTransportFoam uses a velocity field that inside the solver is considered by means of the phi field, but my fields have nothing to do with the velocity or the fluxes... just plain ''mathematical'' equations. Nonetheless, thanks for the information! |
||
April 30, 2022, 15:46 |
|
#5 | |
Member
Pablo Alarcón
Join Date: Mar 2018
Location: Liège
Posts: 59
Rep Power: 8 |
Quote:
|
||
May 1, 2022, 15:17 |
|
#6 |
Member
Join Date: Jun 2019
Posts: 41
Rep Power: 7 |
I'm not a profesionnal mathematician but it's only mathematicaly correct if you use a tensor instead of a vector isn't it ?
= divergence of a vector. = divergence of a vector. Ie in fine you make the divergence of a vector. Thus you can't do : because you then get a scalar inside the divergence.
__________________
« Debugging is what CFD is about. 5 minutes to modify your code, 5 months to find why it does not work anymore. » Last edited by Voulet; May 2, 2022 at 05:42. |
|
May 2, 2022, 04:27 |
|
#7 | |
Member
Pablo Alarcón
Join Date: Mar 2018
Location: Liège
Posts: 59
Rep Power: 8 |
Quote:
The problem was is that I'm trying to implement something that was developed by an student in Matlab, where elementwise operations between vectors or matrices and vectors can be done without any pain. The solution was to ''simply'' perform the laplacian between a volTensorField (my original matrix, in here Coh but defined properly now) and a volScalarField (Tarrival). |
||
May 2, 2022, 08:49 |
|
#8 |
Senior Member
|
Hi Pablo,
As you can see the equation by Voulet, Coh will be a volSymmTensorField instead of a volVectorField. A Laplacian term in solidFoam with anisotropic setting uses volSymmTensorField. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SU2-7.0.1 on ubuntu 18.04 | hyunko | SU2 Installation | 7 | March 16, 2020 05:37 |
UDF compiling problem | Wouter | Fluent UDF and Scheme Programming | 6 | June 6, 2012 05:43 |
Gambit - meshing over airfoil wrapping (?) problem | JFDC | FLUENT | 1 | July 11, 2011 06:59 |
natural convection problem for a CHT problem | Se-Hee | CFX | 2 | June 10, 2007 07:29 |
Adiabatic and Rotating wall (Convection problem) | ParodDav | CFX | 5 | April 29, 2007 20:13 |