Commit e6935c52 authored by Mattijs Janssens's avatar Mattijs Janssens
Browse files

Merge branch 'master' of /home/noisy2/OpenFOAM/OpenFOAM-dev

parents 57949f8e a9b8a507
......@@ -238,8 +238,7 @@ void Foam::kineticTheoryModel::solve()
volScalarField ThetaSqrt = sqrt(Theta_);
// 'thermal' conductivity (Table 3.3, p. 49)
volScalarField kappa_ =
conductivityModel_->kappa(alpha, Theta_, gs0_, rhoa_, da_, e_);
kappa_ = conductivityModel_->kappa(alpha, Theta_, gs0_, rhoa_, da_, e_);
// particle viscosity (Table 3.2, p.47)
mua_ = viscosityModel_->mua(alpha, Theta_, gs0_, rhoa_, da_, e_);
......@@ -351,8 +350,7 @@ void Foam::kineticTheoryModel::solve()
mua_.min(1.0e+2);
mua_.max(0.0);
lambda_ = (4.0/3.0)*sqr(alpha_)*rhoa_*da_*gs0_*(1.0 + e_)
*ThetaSqrt/sqrtPi;
lambda_ = (4.0/3.0)*sqr(alpha_)*rhoa_*da_*gs0_*(1.0 + e_)*ThetaSqrt/sqrtPi;
Info<< "kinTheory: max(Theta) = " << max(Theta_).value() << endl;
......
<ServerManagerConfiguration>
<ProxyGroup name="sources">
<SourceProxy
name="PV3FoamReader"
class="vtkPV3FoamReader">
<!-- File name - compulsory -->
<StringVectorProperty
name="FileName"
command="SetFileName"
number_of_elements="1">
<FileListDomain
name="files"/>
</StringVectorProperty>
<!-- Time info sent to animation controls (top of window) -->
<DoubleVectorProperty
name="TimestepValues"
information_only="1">
<TimeStepsInformationHelper/>
<Documentation>
Available timestep values.
</Documentation>
</DoubleVectorProperty>
<DoubleVectorProperty
name="TimeRange"
information_only="1">
<TimeRangeInformationHelper/>
</DoubleVectorProperty>
<!-- ExtrapolateWalls check box -->
<IntVectorProperty
name="ExtrapolateWalls"
command="SetExtrapolateWalls"
number_of_elements="1"
default_values="0">
<BooleanDomain
name="bool"/>
</IntVectorProperty>
<!-- Include sets check box -->
<IntVectorProperty
name="IncludeSets"
command="SetIncludeSets"
number_of_elements="1"
default_values="0">
<BooleanDomain
name="bool"/>
</IntVectorProperty>
<!-- Include zones check box -->
<IntVectorProperty
name="IncludeZones"
command="SetIncludeZones"
number_of_elements="1"
default_values="0">
<BooleanDomain
name="bool"/>
</IntVectorProperty>
<!-- Show patch names check box -->
<IntVectorProperty
name="ShowPatchNames"
command="SetShowPatchNames"
number_of_elements="1"
default_values="0">
<BooleanDomain name="bool"/>
</IntVectorProperty>
<!-- Available regions array -->
<StringVectorProperty
name="RegionArrayInfo"
information_only="1">
<ArraySelectionInformationHelper
attribute_name="Region"/>
</StringVectorProperty>
<StringVectorProperty
name="RegionStatus"
command="SetRegionArrayStatus"
number_of_elements="0"
repeat_command="1"
number_of_elements_per_command="2"
element_types="2 0"
information_property="RegionArrayInfo">
<ArraySelectionDomain
name="array_list">
<RequiredProperties>
<Property name="RegionArrayInfo"
function="ArrayList"/>
</RequiredProperties>
</ArraySelectionDomain>
</StringVectorProperty>
<!-- Available volFields array -->
<StringVectorProperty
name="VolFieldArrayInfo"
information_only="1">
<ArraySelectionInformationHelper
attribute_name="VolField"/>
</StringVectorProperty>
<StringVectorProperty
name="VolFieldStatus"
command="SetVolFieldArrayStatus"
number_of_elements="0"
repeat_command="1"
number_of_elements_per_command="2"
element_types="2 0"
information_property="VolFieldArrayInfo">
<ArraySelectionDomain
name="array_list">
<RequiredProperties>
<Property name="VolFieldArrayInfo"
function="ArrayList"/>
</RequiredProperties>
</ArraySelectionDomain>
</StringVectorProperty>
<!-- Available pointFields array -->
<StringVectorProperty
name="PointFieldArrayInfo"
information_only="1">
<ArraySelectionInformationHelper
attribute_name="PointField"/>
</StringVectorProperty>
<StringVectorProperty
name="PointFieldStatus"
command="SetPointFieldArrayStatus"
number_of_elements="0"
repeat_command="1"
number_of_elements_per_command="2"
element_types="2 0"
information_property="PointFieldArrayInfo">
<ArraySelectionDomain
name="array_list">
<RequiredProperties>
<Property name="PointFieldArrayInfo"
function="ArrayList"/>
</RequiredProperties>
</ArraySelectionDomain>
</StringVectorProperty>
<!-- Available Lagrangian fields array -->
<StringVectorProperty
name="LagrangianFieldArrayInfo"
information_only="1">
<ArraySelectionInformationHelper
attribute_name="LagrangianField"/>
</StringVectorProperty>
<StringVectorProperty
name="LagrangianFieldStatus"
command="SetLagrangianFieldArrayStatus"
number_of_elements="0"
repeat_command="1"
number_of_elements_per_command="2"
element_types="2 0"
information_property="LagrangianFieldArrayInfo">
<ArraySelectionDomain
name="array_list">
<RequiredProperties>
<Property name="LagrangianFieldArrayInfo"
function="ArrayList"/>
</RequiredProperties>
</ArraySelectionDomain>
</StringVectorProperty>
<!-- Cache mesh check box -->
<IntVectorProperty
name="CacheMesh"
command="SetCacheMesh"
number_of_elements="1"
default_values="1">
<BooleanDomain
name="bool"/>
</IntVectorProperty>
<!-- Update GUI check box -->
<IntVectorProperty
name="UpdateGUI"
command="SetUpdateGUI"
number_of_elements="1"
default_values="0">
<BooleanDomain
name="bool"/>
</IntVectorProperty>
</SourceProxy>
</ProxyGroup>
<ProxyGroup name="sources">
<SourceProxy
name="PV3FoamReader"
class="vtkPV3FoamReader">
<!-- File name - compulsory -->
<StringVectorProperty
name="FileName"
command="SetFileName"
number_of_elements="1"
animateable="0">
<FileListDomain name="files"/>
<Documentation>
Specifies the filename for the OpenFOAM Reader.
</Documentation>
</StringVectorProperty>
<!-- Send discrete time info to the animation panel -->
<DoubleVectorProperty
name="TimestepValues"
repeatable="1"
information_only="1">
<TimeStepsInformationHelper/>
<Documentation>
Available timestep values.
</Documentation>
</DoubleVectorProperty>
<!-- Send continuous time info to the animation panel -->
<DoubleVectorProperty
name="TimeRange"
information_only="1">
<TimeRangeInformationHelper/>
</DoubleVectorProperty>
<!-- Available Parts (volume, patches, lagrangian) array -->
<StringVectorProperty
name="PartArrayInfo"
information_only="1">
<ArraySelectionInformationHelper attribute_name="Part"/>
</StringVectorProperty>
<StringVectorProperty
name="PartStatus"
label="Mesh Parts"
command="SetPartArrayStatus"
number_of_elements="0"
repeat_command="1"
number_of_elements_per_command="2"
element_types="2 0"
information_property="PartArrayInfo"
animateable="0">
<ArraySelectionDomain name="array_list">
<RequiredProperties>
<Property name="PartArrayInfo" function="ArrayList"/>
</RequiredProperties>
</ArraySelectionDomain>
</StringVectorProperty>
<!-- Available volFields array -->
<StringVectorProperty
name="VolFieldArrayInfo"
information_only="1">
<ArraySelectionInformationHelper attribute_name="VolField"/>
</StringVectorProperty>
<StringVectorProperty
name="VolFieldStatus"
label="Volume Fields"
command="SetVolFieldArrayStatus"
number_of_elements="0"
repeat_command="1"
number_of_elements_per_command="2"
element_types="2 0"
information_property="VolFieldArrayInfo"
animateable="0">
<ArraySelectionDomain name="array_list">
<RequiredProperties>
<Property name="VolFieldArrayInfo" function="ArrayList"/>
</RequiredProperties>
</ArraySelectionDomain>
</StringVectorProperty>
<!-- Available Lagrangian fields array -->
<StringVectorProperty
name="LagrangianFieldArrayInfo"
information_only="1">
<ArraySelectionInformationHelper attribute_name="LagrangianField"/>
</StringVectorProperty>
<StringVectorProperty
name="LagrangianFieldStatus"
label="Lagrangian Fields"
command="SetLagrangianFieldArrayStatus"
number_of_elements="0"
repeat_command="1"
number_of_elements_per_command="2"
element_types="2 0"
information_property="LagrangianFieldArrayInfo"
animateable="0">
<ArraySelectionDomain name="array_list">
<RequiredProperties>
<Property name="LagrangianFieldArrayInfo" function="ArrayList"/>
</RequiredProperties>
</ArraySelectionDomain>
</StringVectorProperty>
<!-- Available pointFields array -->
<StringVectorProperty
name="PointFieldArrayInfo"
information_only="1">
<ArraySelectionInformationHelper attribute_name="PointField"/>
</StringVectorProperty>
<StringVectorProperty
name="PointFieldStatus"
label="Point Fields"
command="SetPointFieldArrayStatus"
number_of_elements="0"
repeat_command="1"
number_of_elements_per_command="2"
element_types="2 0"
information_property="PointFieldArrayInfo"
animateable="0">
<ArraySelectionDomain name="array_list">
<RequiredProperties>
<Property name="PointFieldArrayInfo" function="ArrayList"/>
</RequiredProperties>
</ArraySelectionDomain>
</StringVectorProperty>
<!-- Extrapolate Walls check-box -->
<IntVectorProperty
name="ExtrapolateWalls"
command="SetExtrapolateWalls"
number_of_elements="1"
default_values="0"
animateable="0">
<BooleanDomain name="bool"/>
<Documentation>
Extrapolate internalField to wall and empty patches
</Documentation>
</IntVectorProperty>
<!-- Include Sets check-box -->
<IntVectorProperty
name="IncludeSets"
command="SetIncludeSets"
number_of_elements="1"
default_values="0"
animateable="0">
<Documentation>
Searches the polyMesh/sets/ directory
</Documentation>
<BooleanDomain name="bool"/>
</IntVectorProperty>
<!-- Include Zones check-box -->
<IntVectorProperty
name="IncludeZones"
command="SetIncludeZones"
number_of_elements="1"
default_values="0"
animateable="0">
<Documentation>
ZoneMesh information is used to find {cell,face,point}Zones.
The polyMesh/ directory is only checked on startup.
</Documentation>
<BooleanDomain name="bool"/>
</IntVectorProperty>
<!-- Show Patch Names check-box -->
<IntVectorProperty
name="ShowPatchNames"
command="SetShowPatchNames"
number_of_elements="1"
default_values="0"
animateable="0">
<BooleanDomain name="bool"/>
<Documentation>
Show patch names in render window.
</Documentation>
</IntVectorProperty>
<!-- Cache Mesh check-box -->
<IntVectorProperty
name="CacheMesh"
command="SetCacheMesh"
number_of_elements="1"
default_values="1"
animateable="0">
<BooleanDomain name="bool"/>
<Documentation>
Cache the fvMesh in memory.
</Documentation>
</IntVectorProperty>
<!-- Update GUI check box -->
<IntVectorProperty
name="UpdateGUI"
command="SetUpdateGUI"
number_of_elements="1"
default_values="0"
animateable="0">
<BooleanDomain name="bool"/>
<Documentation>
A simple way cause a reader GUI modification.
</Documentation>
</IntVectorProperty>
</SourceProxy>
</ProxyGroup>
</ServerManagerConfiguration>
......@@ -36,6 +36,7 @@
vtkCxxRevisionMacro(vtkPV3FoamReader, "$Revision: 1.5$");
vtkStandardNewMacro(vtkPV3FoamReader);
#undef EXPERIMENTAL_TIME_CACHING
vtkPV3FoamReader::vtkPV3FoamReader()
{
......@@ -47,23 +48,30 @@ vtkPV3FoamReader::vtkPV3FoamReader()
FileName = NULL;
foamData_ = NULL;
output1_ = NULL;
output0_ = NULL;
// Add second output for the Lagrangian
this->SetNumberOfOutputPorts(2);
vtkMultiBlockDataSet *lagrangian;
lagrangian = vtkMultiBlockDataSet::New();
lagrangian->ReleaseData();
this->GetExecutive()->SetOutputData(1, lagrangian);
lagrangian->Delete();
TimeStep = 0;
TimeStepRange[0] = 0;
TimeStepRange[1] = 0;
CacheMesh = 0;
CacheMesh = 1;
ExtrapolateWalls = 0;
IncludeSets = 0;
IncludeZones = 0;
ShowPatchNames = 0;
UpdateGUI = 1;
UpdateGUIOld = 1;
UpdateGUI = 0;
RegionSelection = vtkDataArraySelection::New();
PartSelection = vtkDataArraySelection::New();
VolFieldSelection = vtkDataArraySelection::New();
PointFieldSelection = vtkDataArraySelection::New();
LagrangianFieldSelection = vtkDataArraySelection::New();
......@@ -77,7 +85,7 @@ vtkPV3FoamReader::vtkPV3FoamReader()
);
SelectionObserver->SetClientData(this);
RegionSelection->AddObserver
PartSelection->AddObserver
(
vtkCommand::ModifiedEvent,
this->SelectionObserver
......@@ -114,14 +122,20 @@ vtkPV3FoamReader::~vtkPV3FoamReader()
delete [] FileName;
}
RegionSelection->RemoveObserver(this->SelectionObserver);
if (output0_)
{
output0_->Delete();
}
PartSelection->RemoveObserver(this->SelectionObserver);
VolFieldSelection->RemoveObserver(this->SelectionObserver);
PointFieldSelection->RemoveObserver(this->SelectionObserver);
LagrangianFieldSelection->RemoveObserver(this->SelectionObserver);
SelectionObserver->Delete();
RegionSelection->Delete();
PartSelection->Delete();
VolFieldSelection->Delete();
PointFieldSelection->Delete();
LagrangianFieldSelection->Delete();
......@@ -149,38 +163,40 @@ int vtkPV3FoamReader::RequestInformation
return 0;
}
vtkInformation *outInfo = outputVector->GetInformationObject(0);
int nInfo = outputVector->GetNumberOfInformationObjects();
if (!foamData_)
if (Foam::vtkPV3Foam::debug)
{
vtkDebugMacro("RequestInformation: creating foamData_");
vtkMultiBlockDataSet* output = vtkMultiBlockDataSet::SafeDownCast
(
outInfo->Get(vtkMultiBlockDataSet::DATA_OBJECT())
);
if (Foam::vtkPV3Foam::debug)
cout<<"RequestInformation with " << nInfo << " item(s)\n";
for (int infoI = 0; infoI < nInfo; ++infoI)
{
cout<< "constructed vtkPV3Foam with output: ";
output->Print(cout);
outputVector->GetInformationObject(infoI)->Print(cout);
}
}
if (!foamData_)
{
foamData_ = new Foam::vtkPV3Foam(FileName, this);
}
else
{
foamData_->UpdateInformation();
foamData_->updateInfo();
}
int nTimeSteps = 0;
double* timeSteps = foamData_->findTimes(nTimeSteps);
outInfo->Set
(
vtkStreamingDemandDrivenPipeline::TIME_STEPS(),
timeSteps,
nTimeSteps
);
// set identical time steps for all ports
for (int infoI = 0; infoI < nInfo; ++infoI)
{
outputVector->GetInformationObject(infoI)->Set
(
vtkStreamingDemandDrivenPipeline::TIME_STEPS(),
timeSteps,
nTimeSteps
);
}
double timeRange[2];
if (nTimeSteps)
......@@ -190,21 +206,25 @@ int vtkPV3FoamReader::RequestInformation
if (Foam::vtkPV3Foam::debug > 1)
{
cout<<"nTimeSteps " << nTimeSteps << "\n";
cout<<"timeRange " << timeRange[0] << " to " << timeRange[1] << "\n";
cout<<"nTimeSteps " << nTimeSteps << "\n"
<<"timeRange " << timeRange[0] << " to " << timeRange[1]
<< "\n";
for (int i = 0; i < nTimeSteps; ++i)
for (int timeI = 0; timeI < nTimeSteps; ++timeI)
{
cout<< "step[" << i << "] = " << timeSteps[i] << "\n";
cout<< "step[" << timeI << "] = " << timeSteps[timeI] << "\n";
}
}
outInfo->Set
(
vtkStreamingDemandDrivenPipeline::TIME_RANGE(),
timeRange,
2