Dear all: I want to modify
I want to modify the x, y and z value of U. What do I do? Could you please give help?
Thank you very much,
If you mean the U components o
If you mean the U components of the initial condition, open the
directory and edit the U file according to your needs.
Sorry, read "initial condition
Sorry, read "initial condition" as "initial or baoundary conditions".
Dear Alberto Passalacqua: T
Dear Alberto Passalacqua:
Thanks a lot.
I have read the initial value. I mean I want to change them after read in icoFoam.C. And I have add the code. But some errors is here when I run it. Could you please give more help.
// modifying the value of the U
volScalarField Ux = U.component(vector::X);
volScalarField Uy = U.component(vector::Y);
volScalarField Uz = U.component(vector::Z);
const vectorField& centers = mesh.C().internalField();
forAll (centers, celli)
double angle = 180;
Ux = Ux*Foam::sin(angle);
Uy = Uy*Foam::cos(angle);
Uz = 0;
--> FOAM FATAL ERROR : Different dimensions for =
dimensions : [0 1 -1 0 0 0 0] = [0 0 0 0 0 0 0]
From function dimensionSet::operator=(const dimensionSet& ds) const
in file dimensionSet/dimensionSet.C at line 158.
Thank you very much.
There are two major mistakes i
There are two major mistakes in the above code.
First, you are working on a copy of the U field.
what you probably want is to create a reference.
You should then use volScalarField& instead.
Second, you are looping over the cells which probably means that you want to get the cell values,i.e
Ux[celli] = U[celli].component(vector::X) etc...
third, Xian you have posted an identical question on another topic (under a really useles topic since it applies on every post in here), this is REALLY bad. Now we have 2 forums to talk about the same thing and you have done this before: I am begging you on my knees.
Please dont do it again or you will go on my ignore list.
Dear Niklas Nordin: Thanks
Dear Niklas Nordin:
Thanks a lot.
You are right. But I only worry nobody to see. Since somebody were noticed, I surely do as you said.
|All times are GMT -4. The time now is 01:44.|