|
[Sponsors] |
Snippet for redefining fixedGradient boundary condition for a patch inside solver |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 3, 2017, 18:36 |
Snippet for redefining fixedGradient boundary condition for a patch inside solver
|
#1 |
Senior Member
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 15 |
Dear Fellows
I want to redifine fixedGradient boundary condition for a specified patch inside my source code. i.e. whenever the code sees "fixedGradient" in 0/cPlus file (cPlus is a volScalarField and a dependent variable) My snippet now looks like: Code:
const polyPatchList& patches = mesh.boundaryMesh(); forAll (patches,patchI){ if(cPlus.boundaryField()[patchI].type() == 'fixedGradient'){ fixedGradientPatchField& fgPatchField ( refCast<fixedGradientPatchField>(cPlus.boundaryField()[patchI]) ); fgPatchField.gradient() = fvc::snGrad(cPlus) + cPlus * fvc::snGrad(Ue); } } in which & are dependent scalar variables that should be calculated at the boundary patch from previous time step. However the code compilation returns this error: Code:
createFields.H:501:3: error: ‘fgPatchField’ was not declared in this scope In file included from interFoamEHDIon.C:79:0: The second error is: Code:
createFields.H:532:12: error: ‘fixedGradientFvPatchVectorField’ was not declared in this scope createFields.H:533:74: error: no matching function for call to ‘refCast(Foam::fvPatchField<Foam::Vector<double> >&)’ Last edited by babakflame; March 4, 2017 at 17:17. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wind turbine simulation | Saturn | CFX | 58 | July 3, 2020 01:13 |
Problem with cyclic boundaries in Openfoam 1.5 | fs82 | OpenFOAM | 36 | January 7, 2015 00:31 |
Error finding variable "THERMX" | sunilpatil | CFX | 8 | April 26, 2013 07:00 |
[blockMesh] Cyclic BC's: Possible face ordering problem? (Channel flow) | sega | OpenFOAM Meshing & Mesh Conversion | 3 | September 28, 2010 12:46 |
[Gmsh] Import gmsh msh to Foam | adorean | OpenFOAM Meshing & Mesh Conversion | 24 | April 27, 2005 08:19 |