CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

alpha1<eps?0:u in compressibleTwoPhaseEulerFoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   January 28, 2014, 18:23
Default alpha1<eps?0:u in compressibleTwoPhaseEulerFoam
  #1
Senior Member
 
Wouter van der Meer
Join Date: May 2009
Location: Elahuizen, Netherlands
Posts: 130
Rep Power: 8
wouter is on a distinguished road
Hello All,

how can I do something like:
Code:
    volScalarField clipValue(1E-18);
    volVectorField U1_clip
    (
        IOobject
        (
            "U1_clip",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        alpha1 < clipValue?scalar(0):U1 // clip Ux if alphax <clipValue
    );
This does not work so do I need to loop through all cells?

Best regards
Wouter
wouter is offline   Reply With Quote

Old   January 29, 2014, 06:05
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
akidess will become famous soon enough
pos(alpha1-clipValue)*U1
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
*Help define the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oam-technology
akidess is offline   Reply With Quote

Old   January 29, 2014, 15:57
Default
  #3
Senior Member
 
Wouter van der Meer
Join Date: May 2009
Location: Elahuizen, Netherlands
Posts: 130
Rep Power: 8
wouter is on a distinguished road
hello All,
Thank you akidess for your answer. I tried various types (scalar, volScalarField(did not compile), label) for the clipvalue but I probable did not find the right one.
The result for U1_clip are (0 0 0) or (0 0.1 0) the first one is what I expected except that it is on unexpected places (alpha1 > 1E-18) and the other one is no good at all because the value of U at those places is (0.00970724 0.0137527 -0.0250987). Something goes wrong with the subtraction or with the multiplication. Could you please give me a direction where to look.

best regards
Wouter

Edit: it did work only I had to place the statements in write.H not in createFields.H. I used : const dimensionedScalar clipValue("clipValue",dimless,1.0e-8)

Last edited by wouter; January 29, 2014 at 18:53. Reason: found the solution
wouter is offline   Reply With Quote

Reply

Tags
clip u1 twophaseeuler

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On



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