Hi all, does someone know h
does someone know how to create a vector field out of scalar fields (concerning user defined bc)? Or anything similar?
here is the problem:
I do have scalar fields for Ux, Uy, Uz and want to create a vector field for the velocity of an inlet. but inlet=vector(Ux Uz Uy) does not work.
But something like that does n
But something like that does not work:
scalarField Ux = sqrt((s-d*d*a)*(s-d*d*a)/(n_1*n_1 + n_2*n_2))* n_1;
scalarField Uy = sqrt((s-d*d*a)*(s-d*d*a)/(n_1*n_1 + n_2*n_2))* n_2;
scalar Uz = 0.0;
U.boundaryField()[inletPatchID][faceI] = vector(Ux, Uy, Uz);
here is the error message:
no matching function for call to 'Foam::Vector<foam::scalar>::Vector(Foam::scalarFi eld&, Foam::scalarField&, Foam::scalar&)'
Do you see the mistake?
You're trying to combine two s
You're trying to combine two scalar fields and one individual scalar into an individual vector. You can't stuff an entire field into a vector.
What you need instead is (I think):
= vector(Ux.boundaryField()[inletPatchID][faceI], Uy.boundaryField()[inletPatchID][faceI], Uz);
That way, you're making the vector out of three individual scalar values.
probably do it like that. Defi
probably do it like that. Define a function which returns the desired vector with the faceCentre as an argument
vector getInletVector(const vector centre)
inletVector.x() = centre.x() * ....
inletVector.y() = ....
inletVector.z() = 0.0;
and then call your geometry function like
Hi, is there a command for edi
Hi, is there a command for editing the outermost cells that are next to a specific patch without having to loop throu a cell index?
Not as far as I know, you'll h
Not as far as I know, you'll have to get the patchCells and work your way through them.
(I assume with editing you mean changing the value)
Thanks for your answer, Wit
Thanks for your answer,
With editing I actually ment setting a value that will be constant and uniform for the whole celllayer.
I found the following entry on cellFace on the forum that might help me:
" If you want lots of faces and cells, go onto the boundary patch and as for faceCells(), which gives you cells on the inside of the patch. This is good if you want to do lots of them, but if you only want one face of one cell, that would involve search, which is not good.
This would look something like:
const fvPatchVectorField& patchU = U.boundaryField()[patchI];
const labelList::subList fc = patchU.patch().faceCells();
Yup, just use faceCells - that
Yup, just use faceCells - that gives you the cell index hext to a patch face.
|All times are GMT -4. The time now is 17:09.|