|
[Sponsors] |
Setting patch field values equal to internal field values |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 21, 2014, 16:38 |
Setting patch field values equal to internal field values
|
#1 |
Member
Vincent Leroy
Join Date: Jul 2012
Location: Rhode-Saint-Genèse, Belgium
Posts: 43
Rep Power: 14 |
Dear foamers,
I am trying to set patch values of a given field equal to the corresponding internal field values. This shouldn't be too complicated, but it seems to be not as trivial as I would have expected. Here is what I wrote (let's name our volScalarField 'myField'): Code:
const fvPatchList & patches = mesh.boundary(); forAll(patches, iPatch) { UList<scalar> myList(myField.boundaryField()[iPatch].patchInternalField()); forAll(myField.boundaryField()[iPatch], iCell) { myField.boundaryField()[iPatch][iCell] = myList[iCell]; } } |
|
October 21, 2014, 16:49 |
|
#2 |
Senior Member
|
Hi,
what's wrong with fixedInternalValue patch type? It does the thing this way: Code:
template<class Type> void Foam::fixedInternalValueFvPatchField<Type>::manipulateMatrix ( fvMatrix<Type>& matrix ) { // Apply the patch internal field as a constraint in the matrix matrix.setValues(this->patch().faceCells(), this->patchInternalField()); } |
|
Tags |
boundary, internal field, patch field |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Commercial meshers] Fluent3DMeshToFoam | simvun | OpenFOAM Meshing & Mesh Conversion | 50 | January 19, 2020 16:33 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
Interpolate internal field onto patch / boundary | Jonas | OpenFOAM Programming & Development | 0 | October 22, 2013 15:12 |
CheckMeshbs errors | ivanyao | OpenFOAM Running, Solving & CFD | 2 | March 11, 2009 03:34 |
[Gmsh] Import gmsh msh to Foam | adorean | OpenFOAM Meshing & Mesh Conversion | 24 | April 27, 2005 09:19 |