|
[Sponsors] |
July 23, 2021, 15:07 |
Syntax of codedFixedValue
|
#1 |
Member
Join Date: Mar 2021
Posts: 39
Rep Power: 5 |
Hello to all,
I would like to clarify something. I would like to have a codedFixedValue boundary condition on 3 patches, all with the same condition. What is the correct syntax to do this: Form 1: Code:
"(patch1|patch2|patch3)" { type codedFixedValue; value uniform 0; name myCustomBoundary; code #{ const fvPatch& boundaryPatch = patch(); const vectorField& Cf = boundaryPatch.Cf(); scalarField& field = *this; // Loops over the patch forAll(Cf, faceI) { const scalar x = Cf[faceI].component(0); field[faceI] = x; } #}; } Code:
patch1 { type codedFixedValue; value uniform 0; name myCustomBoundary_a; code #{ const fvPatch& boundaryPatch = patch(); const vectorField& Cf = boundaryPatch.Cf(); scalarField& field = *this; // Loops over the patch forAll(Cf, faceI) { const scalar x = Cf[faceI].component(0); field[faceI] = x; } #}; } patch2 { type codedFixedValue; value uniform 0; name myCustomBoundary_b; code #{ const fvPatch& boundaryPatch = patch(); const vectorField& Cf = boundaryPatch.Cf(); scalarField& field = *this; // Loops over the patch forAll(Cf, faceI) { const scalar x = Cf[faceI].component(0); field[faceI] = x; } #}; } patch3 { type codedFixedValue; value uniform 0; name myCustomBoundary_c; code #{ const fvPatch& boundaryPatch = patch(); const vectorField& Cf = boundaryPatch.Cf(); scalarField& field = *this; // Loops over the patch forAll(Cf, faceI) { const scalar x = Cf[faceI].component(0); field[faceI] = x; } #}; } Are they interchangeable? Sorry is this is too basic! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF syntax error | Ratel | Fluent UDF and Scheme Programming | 4 | May 23, 2015 06:15 |
what is syntax error : missing ')' before ';' | aleisia | Fluent UDF and Scheme Programming | 8 | March 10, 2015 16:42 |
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 | keepfit | ParaView | 60 | September 18, 2013 04:23 |
Ansys Fluent 13.0 UDF compilation problem in Window XP (32 bit) | Yogini | Fluent UDF and Scheme Programming | 7 | October 3, 2012 08:24 |
error while compiling the USER Sub routine | CFD user | CFX | 3 | November 25, 2002 16:16 |