|
[Sponsors] |
November 22, 2021, 02:30 |
Calculation of Custom Flux 'phip'
|
#1 |
New Member
Zhang Qibo
Join Date: Oct 2021
Posts: 7
Rep Power: 4 |
Hello,
I want to calculate the flux 'phip' based on the interpolation velocity obtained by boundary `timeVaryingMappedFixedValue`. Here is my Code: Code:
const Field<scalar>& phip = this->patch().boundaryMesh().mesh().Sf() & fieldMapper_.map(); `fieldMapper_.map()` is the mapped patch field. I get the error message as belows when I compile the new BC Code:
error: invalid initialization of reference of type ‘const Foam::Field<double>&’ from expression of type ‘Foam::tmp<Foam::Field<Foam::Vector<double> > >’ const Field<scalar>& phip = ^~~~ error: no match for ‘operator&’ (operand types are ‘const Foam::Vector<double>’ and ‘const double’) PRODUCT_OPERATOR(innerProduct, &, dot) /home/gareth/OpenFOAM/OpenFOAM-8/src/OpenFOAM/lnInclude/FieldM.H:272:31: note: in definition of macro ‘TFOR_ALL_F_OP_F_OP_F’ OP2 List_ELEM(f3, f3P, i); \ ^~~ /home/gareth/OpenFOAM/OpenFOAM-8/src/OpenFOAM/lnInclude/FieldFunctions.C:775:1: note: in expansion of macro ‘PRODUCT_OPERATOR’ PRODUCT_OPERATOR(innerProduct, &, dot) ^~~~~~~~~~~~~~~~ Hope someone could give me some advice! Best wishes! Gareth |
|
November 22, 2021, 05:12 |
|
#2 |
New Member
Zhang Qibo
Join Date: Oct 2021
Posts: 7
Rep Power: 4 |
Hello,
I got the outputs of `this->patch().boundaryMesh().mesh().Sf()`, and found that this was not what I thought. It returns face area vectors of all faces, including all patch faces and internal faces. How could I only get the face area vectors of the current boundary patch? Best regards, Gareth |
|
Tags |
phi;flux |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Momentum FLux Calculation | AS_Aero | CFX | 0 | May 30, 2017 05:19 |
Calculation of Mass Flux in a Mass Transport Problem | h_fathi | OpenFOAM | 0 | May 31, 2015 08:05 |
Warning 097- | AB | Siemens | 6 | November 15, 2004 04:41 |
Flux Calculation between moving interface. | Apurva Shukla | Main CFD Forum | 0 | August 17, 1999 03:56 |
Turbulence Model and Accuracy of convective flux calculation | Lokesh Agrawal | Main CFD Forum | 1 | November 14, 1998 23:24 |