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

How to do dot product of velocity and normal at wall boundary in createFields.H?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By BSengupta

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 21, 2019, 23:41
Default How to do dot product of velocity and normal at wall boundary in createFields.H?
  #1
Member
 
Bidesh Sengupta
Join Date: Sep 2018
Location: Sngapore
Posts: 76
Rep Power: 8
BSengupta is on a distinguished road
I am trying to find collection efficiency at the wall in OpenFoam, but could not do it as I am getting error. I have written it as:


volScalarField U_x = U.component(vector::X);
volScalarField U_y = U.component(vector::Y);
volScalarField U_z = U.component(vector::Z);

label patchLabel = mesh.boundaryMesh().findPatchID("wall");
scalarField& pUx = U_x.boundaryField()[patchLabel];
scalarField normal_x=mesh.Sf().boundaryField()[patchLabel].component(0)/mesh.magSf();
scalarField& pUy = U_y.boundaryField()[patchLabel];
scalarField normal_y=mesh.Sf().boundaryField()[patchLabel].component(1)/mesh.magSf();
scalarField& pUz = U_z.boundaryField()[patchLabel];
scalarField normal_z=mesh.Sf().boundaryField()[patchLabel].component(2)/mesh.magSf();

scalarField CE = (pUx*normal_x + pUy*normal_y + pUz*normal_z)/(mag(U_Air) * mag(rho_Air));

scalarField betaCE
(
IOobject
(
"betaCE",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
CE
);


Error:



createFields.H:138:5: error: no matching function for call to ‘Foam::Field<double>::Field(Foam::IOobject, Foam::scalarField&)’
);




Can any one guide me to find dot product of velocity and normal at wall. Thanks a lot.

Last edited by BSengupta; October 22, 2019 at 01:39.
BSengupta is offline   Reply With Quote

Old   October 23, 2019, 08:37
Default
  #2
New Member
 
Join Date: Jun 2017
Posts: 9
Rep Power: 0
The Mad Scientist is on a distinguished road
You can try using grovy BC...
The Mad Scientist is offline   Reply With Quote

Old   October 24, 2019, 22:03
Default
  #3
Member
 
Bidesh Sengupta
Join Date: Sep 2018
Location: Sngapore
Posts: 76
Rep Power: 8
BSengupta is on a distinguished road
Thanks a lot for your reply. I have tackled the problem in some other way. I am writing the snippet of code (may be useful to others like me):


In createFields.H


volScalarField CE
(
IOobject
(
"CE",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("CE",dimensionSet(0,0,0,0,0),0.)
);



In main.C file


label wallID=mesh.boundaryMesh().findPatchID("wall");
CE.boundaryField()[wallID] = mesh.Sf().boundaryField()[wallID]
& U.boundaryField()[wallID]
* rho.boundaryField()[wallID]
/ mesh.magSf().boundaryField()[wallID]
/ mag(U_Inf)
/ mag(rho_Inf)
;


Thanks,
Bidesh
vivek162 likes this.
BSengupta is offline   Reply With Quote

Reply

Tags
createfields.h, dot product, foamextend, openfoam


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
Question about adaptive timestepping Guille1811 CFX 25 November 12, 2017 18:38
Multiphase flow - incorrect velocity on inlet Mike_Tom CFX 6 September 29, 2016 02:27
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 07:20
Water subcooled boiling Attesz CFX 7 January 5, 2013 04:32
Multicomponent fluid Andrea CFX 2 October 11, 2004 06:12


All times are GMT -4. The time now is 15:05.