|
[Sponsors] |
October 14, 2011, 12:47 |
finite area method
|
#1 |
Member
luca
Join Date: Feb 2011
Posts: 34
Rep Power: 15 |
Hi all.
I am trying to use the finite area method. I need to calculate the divergence of a boundary field q_b. I am trying to initialize my areaVectorField without success: Code:
areaVectorField q_bed ( IOobject ( "q_bed", runTime.timeName(), faMesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), faMesh ); Code:
q_bed.internalField() = volSurfaceMapping.mapToSurface(q_b.boundaryField()); Code:
volScalarField dh_dt = fam::div ( q_bed.boundaryField() ) Thanks |
|
October 17, 2011, 12:40 |
|
#2 |
Senior Member
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 18 |
What kind of errors are being thrown? This would help get to the bottom of your issues.
|
|
October 18, 2011, 07:10 |
|
#3 |
Member
luca
Join Date: Feb 2011
Posts: 34
Rep Power: 15 |
Ok.
I am trying to declare volSurfaceMupping: Code:
volSurfaceMapping vsm(aMesh); Code:
undefined reference to `Foam::faMesh::faMesh(Foam::polyMesh const&)' |
|
October 18, 2011, 08:25 |
|
#4 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
It depends on where your error is located/comes from.
But it seems as if you are mixing aMesh and faMesh? Give it the same "name" everywhere. Also, did you include the necessary libraries in your options file (Make folder)? |
|
October 18, 2011, 09:14 |
|
#5 |
Senior Member
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17 |
Hi Guys,
the problem starts with your initialization: Code:
areaVectorField q_bed ( IOobject ( "q_bed", runTime.timeName(), faMesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), faMesh ); Code:
areaVectorField q_bed ( IOobject ( "q_bed", runTime.timeName(), aMesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), aMesh ); The second more important point is, that faMeshes are not directly connected to the objectRegistry, because in contrary to fvMesh it is not derived from polyMesh but from GeoMesh<polyMesh>. The first is derived from the objectRegistry the latter not. Because of that you need to use Code:
areaVectorField q_bed ( IOobject ( "q_bed", runTime.timeName(), aMesh.thisDb(), IOobject::MUST_READ, IOobject::AUTO_WRITE ), aMesh ); Best Kathrin Last edited by kathrin_kissling; October 18, 2011 at 09:31. |
|
October 18, 2011, 09:27 |
|
#6 | ||
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
Thanks Kathrin,
Quote:
Quote:
Code:
areaVectorField q_bed ( IOobject ( "q_bed", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), aMesh, dimensionedVector ("q_bed", dimensionSet(0, 2, -1, 0, 0, 0, 0), vector::zero) ); Arne |
|||
October 18, 2011, 09:30 |
|
#7 |
Senior Member
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17 |
Sorry,
a () was missing aMesh.thisDB(); works for me! And now the data is registered where it belongs to: the faMesh. Otherwise you register it to the fvMesh, what is not wrong, but imagine you come to a point, where there is no fvMesh present. That what has happened to me. Best Kathrin PS: I will edit the previous snippet |
|
October 18, 2011, 09:34 |
|
#8 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
Ok, it compiles. As I guess you already had some experience with faMeshes and the objectRegistry, could you tell me a bit more about differences of using "mesh" and "aMesh.thisDb()" in IOobject? This would be great.
Arne Edit: Ok. In the meantime you already answered my question ;-) Thanks. That sounds reasonable. |
|
October 18, 2011, 10:07 |
|
#9 |
Member
luca
Join Date: Feb 2011
Posts: 34
Rep Power: 15 |
Which are the library needed for this?
I added: Code:
#include "faCFD.H" #include "createFaMesh.H" |
|
October 18, 2011, 10:25 |
|
#10 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
You would also need:
Code:
#include "faMesh.H" Niels |
|
October 18, 2011, 11:36 |
|
#11 |
Member
luca
Join Date: Feb 2011
Posts: 34
Rep Power: 15 |
Thanks
I added that one as well. still, I can see that the error appear when I introduce Code:
#include "createFaMesh.H" Code:
pimpleMyDyMFoam.C:(.text+0x5346): undefined reference to `Foam::faMesh::faMesh(Foam::polyMesh const&)' |
|
October 18, 2011, 11:46 |
|
#12 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
Have you remembered to add the necessary lines in Make/options for you to work with FAM?
|
|
October 18, 2011, 12:53 |
|
#13 |
Senior Member
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17 |
Hi Nils,
i think the latter is more important, since the faMesh.H is already introduced by faCFD.H @lulo By the way is this your first error in the line? |
|
October 19, 2011, 07:46 |
|
#14 |
Member
luca
Join Date: Feb 2011
Posts: 34
Rep Power: 15 |
Thanks to all of you!
I have compiled it correctly. Now I have solved the exner equation: Code:
areaVectorField q_bed ( IOobject ( "q_bed", runTime.timeName(), aMesh.thisDb(), IOobject::READ_IF_PRESENT, IOobject::NO_WRITE ), aMesh, dimensionedVector ("q_bed", dimensionSet(0, 2, -1, 0, 0, 0, 0), vector::zero) ); volSurfaceMapping vsm(aMesh); q_bed.internalField() = vsm.mapToSurface(q_b_slide.boundaryField()); areaScalarField dh_dt = - fac::div(q_bed) * 1.0/ (1-n); I could see that there are some interpolation method in src/finiteArea/interpolation. I think I should use edgeInterpolation and I tried: Code:
edgeInterpolation interpolateE(aMesh); pointScalarField dh_dt_points_1 = interpolateE.edgeInterpolation(dh_dt); // This is of course wrong |
|
October 15, 2014, 11:41 |
|
#15 |
Member
Fei Fan
Join Date: Jul 2013
Location: NanJing, China
Posts: 54
Rep Power: 13 |
Hi Niels:
I want to use FAM to solve Exner equation. my of version is foam-extend-3.1. Before the FAM used, everything is ok. However, as the q_bed of volMesh mapping to areaMesh and faCFD.H creatfamesh.H famesh.H are introduce, some errors occured, as below: Code:
In file included from /home/administrator/foam/foam-extend-3.1/src/foam/lnInclude/MeshObject.H:39:0, from /home/administrator/foam/foam-extend-3.1/src/finiteArea/lnInclude/faMesh.H:40, from /home/administrator/foam/foam-extend-3.1/src/finiteArea/lnInclude/faCFD.H:7, from pimpFoam.C:49: /home/administrator/foam/foam-extend-3.1/src/foam/lnInclude/meshObjectBase.H: In function ‘int main(int, char**)’: /home/administrator/foam/foam-extend-3.1/src/foam/lnInclude/meshObjectBase.H:45:1: error: ‘namespace’ definition is not allowed here namespace Foam ^ In file included from /home/administrator/foam/foam-extend-3.1/src/finiteArea/lnInclude/faMesh.H:40:0, from /home/administrator/foam/foam-extend-3.1/src/finiteArea/lnInclude/faCFD.H:7, from pimpFoam.C:49: /home/administrator/foam/foam-extend-3.1/src/foam/lnInclude/MeshObject.H:44:1: error: ‘namespace’ definition is not allowed here namespace Foam ^ In file included from /home/administrator/foam/foam-extend-3.1/src/foam/lnInclude/MeshObject.H:139:0, from /home/administrator/foam/foam-extend-3.1/src/finiteArea/lnInclude/faMesh.H:40, from /home/administrator/foam/foam-extend-3.1/src/finiteArea/lnInclude/faCFD.H:7, from pimpFoam.C:49: /home/administrator/foam/foam-extend-3.1/src/foam/lnInclude/MeshObject.C:31:1: error: a template declaration cannot appear at block scope template<class Mesh, class Type> ^ /home/administrator/foam/foam-extend-3.1/src/foam/lnInclude/MeshObject.C:55:1: error: expected ‘;’ before ‘template’ template<class Mesh, class Type> ^ In file included from pimpFoam.C:48:0: /home/administrator/foam/foam-extend-3.1/src/finiteVolume/lnInclude/initContinuityErrs.H:37:8: warning: unused variable ‘sumLocalContErr’ [-Wunused-variable] scalar sumLocalContErr = 0; ^ /home/administrator/foam/foam-extend-3.1/src/finiteVolume/lnInclude/initContinuityErrs.H:38:8: warning: unused variable ‘globalContErr’ [-Wunused-variable] scalar globalContErr = 0; ^ /home/administrator/foam/foam-extend-3.1/src/finiteVolume/lnInclude/initContinuityErrs.H:39:8: warning: unused variable ‘cumulativeContErr’ [-Wunused-variable] scalar cumulativeContErr = 0; ^ pimpFoam.C:292:1: error: expected ‘}’ at end of input } ^ make: *** [Make/linux64GccDPOpt/pimpFoam.o] 错误 1 the options file is Code:
EXE_INC = \ -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ -I$(LIB_SRC)/finiteVolume/lnInclude\ -I$(LIB_SRC)/finiteArea/lnInclude\ -I$(LIB_SRC)/sampling/lnInclude EXE_LIBS = \ -lincompressibleTransportModels \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleLESModels \ -lfiniteVolume \ -lfiniteArea \ -lmeshTools \ -llduSolvers Fan Fei Last edited by wyldckat; October 18, 2014 at 18:13. Reason: Added [CODE][/CODE] |
|
October 15, 2014, 11:57 |
|
#16 |
Member
Fei Fan
Join Date: Jul 2013
Location: NanJing, China
Posts: 54
Rep Power: 13 |
Hi everyone:
This problem have solved. The # include "faCFD.H" sholud be as a global variable, add it before the main program. Best regards Fan Fei |
|
December 8, 2014, 05:36 |
|
#17 | ||
Member
Fei Fan
Join Date: Jul 2013
Location: NanJing, China
Posts: 54
Rep Power: 13 |
Quote:
I have a question about the faMesh and dynamicMesh. in openfoam extend 3.1. there are two solvers use famesh and dynamicMesh. The location is tutorials/surfaceTracking/interTrackFoam and bubbleInlerTrackFoam. as below picture. however the code of interTrackFoam is: ----------------------------------- Quote:
Best regards Fan fei |
|||
March 13, 2018, 09:24 |
|
#18 |
New Member
LXJ
Join Date: Apr 2015
Posts: 12
Rep Power: 11 |
Hi lulo,
Sorry to trouble you. Do you have slove your problem? Now I meet a problem when i calculated the bed load transport rate (qbi=q0*τ/τi - C*|q0|dη/dxi) component in the i direction by using FE3.2 famesh, i found the result of dη/dxi in two sides in y direction (two sides patch: symmetryPlane) is wrong. Which I explained here: The problem of bed load transport rate based on FE3.2-famesh. Do you meet it or how to slove it? Thanks. Best, LXJ |
|
July 11, 2019, 18:07 |
|
#19 |
Member
Amir
Join Date: Jan 2017
Posts: 32
Rep Power: 9 |
Dear Niels,
I want to use the sand sliding method similar to you in "Mass conservation in computational morphodynamics: uniform sediment and infinite availability". Could you please let me know how can I have access to quadrilaterals to form the dual mesh. Many thanks in advance, Amir Last edited by albet; July 13, 2019 at 18:39. |
|
July 14, 2019, 10:04 |
|
#20 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
Hi Amir,
You will have to construct it from the faMesh. The dual mesh does not exist in the released version. Kind regards Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
Tags |
finite area method |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How can be calculate a surface integral in the finite element method? | HectorRedal | Main CFD Forum | 3 | March 13, 2015 09:25 |
Lattice Boltzmann method vs Finite Element Method and Finite Volume Method | solemnpriest | Main CFD Forum | 3 | August 12, 2013 12:00 |
floating point exception Finite area | DiegoNaval | OpenFOAM | 1 | November 10, 2011 14:45 |
formulation of finite element&finite volume method | ravindra | FLUENT | 0 | June 27, 2007 13:04 |
tidal flow simulation using finite volume method | Jason Qiu | Main CFD Forum | 0 | October 20, 2002 03:34 |