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

Calculation of Custom Flux 'phip'

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 22, 2021, 02:30
Default Calculation of Custom Flux 'phip'
  #1
New Member
 
Zhang Qibo
Join Date: Oct 2021
Posts: 7
Rep Power: 4
Gareth_CN is on a distinguished road
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)
 ^~~~~~~~~~~~~~~~
I think this error is caused by the different types of objects on both sides of '='. But I am not cleared about this(I am newbie to OpenFOAM)

Hope someone could give me some advice!

Best wishes!

Gareth
Gareth_CN is offline   Reply With Quote

Old   November 22, 2021, 05:12
Default
  #2
New Member
 
Zhang Qibo
Join Date: Oct 2021
Posts: 7
Rep Power: 4
Gareth_CN is on a distinguished road
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
Gareth_CN is offline   Reply With Quote

Reply

Tags
phi;flux


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
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


All times are GMT -4. The time now is 17:31.