CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Please give advice and help for the change the x y and z in U

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 17, 2005, 17:21
Default Dear all: I want to modify
  #1
Senior Member
 
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 17
liugx212 is on a distinguished road
Dear all:

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,
xiang
liugx212 is offline   Reply With Quote

Old   December 18, 2005, 09:35
Default If you mean the U components o
  #2
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
If you mean the U components of the initial condition, open the

/case_name/0

directory and edit the U file according to your needs.

Alberto
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   December 18, 2005, 09:38
Default Sorry, read "initial condition
  #3
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Sorry, read "initial condition" as "initial or baoundary conditions".
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   December 18, 2005, 14:24
Default Dear Alberto Passalacqua: T
  #4
Senior Member
 
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 17
liugx212 is on a distinguished road
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.

code:
// 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;
}

error:

--> 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.

FOAM aborting

Aborted


Thank you very much.
xiang
liugx212 is offline   Reply With Quote

Old   December 19, 2005, 03:15
Default There are two major mistakes i
  #5
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
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.

N
niklas is offline   Reply With Quote

Old   December 19, 2005, 23:45
Default Dear Niklas Nordin: Thanks
  #6
Senior Member
 
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 17
liugx212 is on a distinguished road
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.

Thanks again.
liugx212 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Could someone please give advice? Frank Wedburn Main CFD Forum 11 September 26, 2005 14:31
Can anybody give me advice luckyluke OpenFOAM Running, Solving & CFD 11 August 4, 2005 12:20
please give me some advice. cfd lover Main CFD Forum 0 November 5, 2004 04:50
give me some advice about compressible LES. Bin Li Main CFD Forum 3 September 19, 2003 14:01
Could you give me your advice? Kim FLUENT 0 March 8, 2002 06:44


All times are GMT -4. The time now is 21:10.