|
[Sponsors] |
How to do dot product of velocity and normal at wall boundary in createFields.H? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 21, 2019, 23:41 |
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 |
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. |
|
October 23, 2019, 08:37 |
|
#2 |
New Member
Join Date: Jun 2017
Posts: 9
Rep Power: 0 |
You can try using grovy BC...
|
|
October 24, 2019, 22:03 |
|
#3 |
Member
Bidesh Sengupta
Join Date: Sep 2018
Location: Sngapore
Posts: 76
Rep Power: 8 |
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 |
|
Tags |
createfields.h, dot product, foamextend, openfoam |
|
|
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 |